mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-09 15:12:26 -04:00
add timeout at startup
This commit is contained in:
parent
623b07dfcc
commit
e36c35326a
2 changed files with 19 additions and 2 deletions
|
@ -59,11 +59,11 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void blur() {
|
public static void blur() {
|
||||||
transitions.blur(baseApplicationContainer);
|
transitions.blur(MainView.base);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void blurLight() {
|
public static void blurLight() {
|
||||||
transitions.blur(baseApplicationContainer, Transitions.DEFAULT_DURATION, true, false, 5);
|
transitions.blur(MainView.base, Transitions.DEFAULT_DURATION, true, false, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void removeBlur() {
|
public static void removeBlur() {
|
||||||
|
@ -87,6 +87,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
||||||
private Label btcSplashInfo;
|
private Label btcSplashInfo;
|
||||||
private List<String> persistedFilesCorrupted;
|
private List<String> persistedFilesCorrupted;
|
||||||
private static BorderPane baseApplicationContainer;
|
private static BorderPane baseApplicationContainer;
|
||||||
|
private static StackPane base;
|
||||||
private Popup p2PNetworkWarnMsgPopup, btcNetworkWarnMsgPopup;
|
private Popup p2PNetworkWarnMsgPopup, btcNetworkWarnMsgPopup;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -101,6 +102,8 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initialize() {
|
protected void initialize() {
|
||||||
|
MainView.base = this.root;
|
||||||
|
|
||||||
ToggleButton marketButton = new NavButton(MarketView.class, "Market");
|
ToggleButton marketButton = new NavButton(MarketView.class, "Market");
|
||||||
ToggleButton buyButton = new NavButton(BuyOfferView.class, "Buy BTC");
|
ToggleButton buyButton = new NavButton(BuyOfferView.class, "Buy BTC");
|
||||||
ToggleButton sellButton = new NavButton(SellOfferView.class, "Sell BTC");
|
ToggleButton sellButton = new NavButton(SellOfferView.class, "Sell BTC");
|
||||||
|
|
|
@ -122,6 +122,7 @@ public class MainViewModel implements ViewModel {
|
||||||
private ChangeListener<Number> numConnectedPeersListener, btcNumPeersListener;
|
private ChangeListener<Number> numConnectedPeersListener, btcNumPeersListener;
|
||||||
private java.util.Timer numberofBtcPeersTimer;
|
private java.util.Timer numberofBtcPeersTimer;
|
||||||
private java.util.Timer numberofP2PNetworkPeersTimer;
|
private java.util.Timer numberofP2PNetworkPeersTimer;
|
||||||
|
private Timer startupTimeout;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -179,6 +180,17 @@ public class MainViewModel implements ViewModel {
|
||||||
if (newValue)
|
if (newValue)
|
||||||
onAllServicesInitialized();
|
onAllServicesInitialized();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
startupTimeout = FxTimer.runLater(Duration.ofMillis(60000), () -> {
|
||||||
|
log.warn("startupTimeout called");
|
||||||
|
MainView.blur();
|
||||||
|
new Popup().warning("The application could not startup after 60 seconds.\n" +
|
||||||
|
"There might be some network connection problems.\n\n" +
|
||||||
|
"Please restart and try again.")
|
||||||
|
.closeButtonText("Shut down")
|
||||||
|
.onClose(() -> BitsquareApp.shutDownHandler.run())
|
||||||
|
.show();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void shutDown() {
|
public void shutDown() {
|
||||||
|
@ -301,6 +313,8 @@ public class MainViewModel implements ViewModel {
|
||||||
private void onAllServicesInitialized() {
|
private void onAllServicesInitialized() {
|
||||||
Log.traceCall();
|
Log.traceCall();
|
||||||
|
|
||||||
|
startupTimeout.stop();
|
||||||
|
|
||||||
// disputeManager
|
// disputeManager
|
||||||
disputeManager.getDisputesAsObservableList().addListener((ListChangeListener<Dispute>) change -> {
|
disputeManager.getDisputesAsObservableList().addListener((ListChangeListener<Dispute>) change -> {
|
||||||
change.next();
|
change.next();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue