From 01bc3ff223d1db4a8d9c06a1e180bf62608f6696 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Mon, 11 Apr 2016 11:15:58 +0200 Subject: [PATCH] Distinguish timeout warning at startup (btc, p2p) --- .../io/bitsquare/gui/main/MainViewModel.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/gui/src/main/java/io/bitsquare/gui/main/MainViewModel.java b/gui/src/main/java/io/bitsquare/gui/main/MainViewModel.java index 82fc9eb612..b08f92fa13 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/MainViewModel.java +++ b/gui/src/main/java/io/bitsquare/gui/main/MainViewModel.java @@ -199,7 +199,7 @@ public class MainViewModel implements ViewModel { public void initializeAllServices() { Log.traceCall(); - UserThread.runAfter(() -> tacWindow.showIfNeeded(), 2); + UserThread.runAfter(tacWindow::showIfNeeded, 2); BooleanProperty walletInitialized = initBitcoinWallet(); BooleanProperty p2pNetWorkReady = initP2PNetwork(); @@ -214,9 +214,22 @@ public class MainViewModel implements ViewModel { startupTimeout = UserThread.runAfter(() -> { log.warn("startupTimeout called"); MainView.blur(); - new Popup().warning("The application could not startup after 3 minutes.\n" + - "There might be some network connection problems or a unstable Tor path.\n\n" + - "Please restart and try again.") + String details; + if (!walletInitialized.get()) { + details = "You still did not get connected to the bitcoin network.\n" + + "If you use Tor for Bitcoin it might be that you got an unstable Tor path.\n" + + "You could wait longer or try to restart."; + } else if (!p2pNetWorkReady.get()) { + details = "You still did not get connected to the P2P network.\n" + + "That can happen sometimes when you got an unstable Tor path.\n" + + "You could wait longer or try to restart."; + } else { + log.error("Startup timeout with unknown problem."); + details = "There is an unknown problem at startup.\n" + + "Please restart and if the problem continues file a bug report."; + } + new Popup().warning("The application could not startup after 3 minutes.\n\n" + + details) .actionButtonText("Shut down and start again") .onAction(BitsquareApp.shutDownHandler::run) .show();