mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-19 15:26:03 -04:00
add timeout at startup
This commit is contained in:
parent
623b07dfcc
commit
e36c35326a
@ -59,11 +59,11 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
||||
}
|
||||
|
||||
public static void blur() {
|
||||
transitions.blur(baseApplicationContainer);
|
||||
transitions.blur(MainView.base);
|
||||
}
|
||||
|
||||
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() {
|
||||
@ -87,6 +87,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
||||
private Label btcSplashInfo;
|
||||
private List<String> persistedFilesCorrupted;
|
||||
private static BorderPane baseApplicationContainer;
|
||||
private static StackPane base;
|
||||
private Popup p2PNetworkWarnMsgPopup, btcNetworkWarnMsgPopup;
|
||||
|
||||
@Inject
|
||||
@ -101,6 +102,8 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
||||
|
||||
@Override
|
||||
protected void initialize() {
|
||||
MainView.base = this.root;
|
||||
|
||||
ToggleButton marketButton = new NavButton(MarketView.class, "Market");
|
||||
ToggleButton buyButton = new NavButton(BuyOfferView.class, "Buy BTC");
|
||||
ToggleButton sellButton = new NavButton(SellOfferView.class, "Sell BTC");
|
||||
|
@ -122,6 +122,7 @@ public class MainViewModel implements ViewModel {
|
||||
private ChangeListener<Number> numConnectedPeersListener, btcNumPeersListener;
|
||||
private java.util.Timer numberofBtcPeersTimer;
|
||||
private java.util.Timer numberofP2PNetworkPeersTimer;
|
||||
private Timer startupTimeout;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -179,6 +180,17 @@ public class MainViewModel implements ViewModel {
|
||||
if (newValue)
|
||||
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() {
|
||||
@ -301,6 +313,8 @@ public class MainViewModel implements ViewModel {
|
||||
private void onAllServicesInitialized() {
|
||||
Log.traceCall();
|
||||
|
||||
startupTimeout.stop();
|
||||
|
||||
// disputeManager
|
||||
disputeManager.getDisputesAsObservableList().addListener((ListChangeListener<Dispute>) change -> {
|
||||
change.next();
|
||||
|
Loading…
x
Reference in New Issue
Block a user