Distinguish timeout warning at startup (btc, p2p)

This commit is contained in:
Manfred Karrer 2016-04-11 11:15:58 +02:00
parent 4cb2ce91df
commit 01bc3ff223

View file

@ -199,7 +199,7 @@ public class MainViewModel implements ViewModel {
public void initializeAllServices() { public void initializeAllServices() {
Log.traceCall(); Log.traceCall();
UserThread.runAfter(() -> tacWindow.showIfNeeded(), 2); UserThread.runAfter(tacWindow::showIfNeeded, 2);
BooleanProperty walletInitialized = initBitcoinWallet(); BooleanProperty walletInitialized = initBitcoinWallet();
BooleanProperty p2pNetWorkReady = initP2PNetwork(); BooleanProperty p2pNetWorkReady = initP2PNetwork();
@ -214,9 +214,22 @@ public class MainViewModel implements ViewModel {
startupTimeout = UserThread.runAfter(() -> { startupTimeout = UserThread.runAfter(() -> {
log.warn("startupTimeout called"); log.warn("startupTimeout called");
MainView.blur(); MainView.blur();
new Popup().warning("The application could not startup after 3 minutes.\n" + String details;
"There might be some network connection problems or a unstable Tor path.\n\n" + if (!walletInitialized.get()) {
"Please restart and try again.") 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") .actionButtonText("Shut down and start again")
.onAction(BitsquareApp.shutDownHandler::run) .onAction(BitsquareApp.shutDownHandler::run)
.show(); .show();