change text when losing internet connection

This commit is contained in:
Manfred Karrer 2016-01-23 14:18:27 +01:00
parent 5a1fa6ea4b
commit 17fa8a424a

View file

@ -266,7 +266,8 @@ public class MainViewModel implements ViewModel {
numberofBtcPeersTimer.cancel(); numberofBtcPeersTimer.cancel();
numberofBtcPeersTimer = UserThread.runAfter(() -> { numberofBtcPeersTimer = UserThread.runAfter(() -> {
if (walletService.numPeersProperty().get() == 0) if (walletService.numPeersProperty().get() == 0)
walletServiceErrorMsg.set("You lost the connection to all bitcoin peers."); walletServiceErrorMsg.set("You lost the connection to all bitcoin network peers.\n" +
"Maybe you lost your internet connection or your computer was in hibernate/sleep mode.");
else else
walletServiceErrorMsg.set(null); walletServiceErrorMsg.set(null);
}, 2); }, 2);
@ -393,7 +394,7 @@ public class MainViewModel implements ViewModel {
numberofP2PNetworkPeersTimer = UserThread.runAfter(() -> { numberofP2PNetworkPeersTimer = UserThread.runAfter(() -> {
if (p2PService.getNumAuthenticatedPeers().get() == 0) { if (p2PService.getNumAuthenticatedPeers().get() == 0) {
p2PNetworkWarnMsg.set("You lost the connection to all P2P network peers.\n" + p2PNetworkWarnMsg.set("You lost the connection to all P2P network peers.\n" +
"Please check your internet connection or try to restart the application."); "Maybe you lost your internet connection or your computer was in hibernate/sleep mode.");
p2PNetworkLabelId.set("splash-error-state-msg"); p2PNetworkLabelId.set("splash-error-state-msg");
} else { } else {
p2PNetworkWarnMsg.set(null); p2PNetworkWarnMsg.set(null);
@ -405,16 +406,6 @@ public class MainViewModel implements ViewModel {
p2PNetworkLabelId.set("footer-pane"); p2PNetworkLabelId.set("footer-pane");
} }
if ((int) oldValue > 0 && (int) newValue == 0) {
p2PNetworkWarnMsg.set("You lost the connection to all P2P network peers.\n" +
"Please check your internet connection or try to restart the application.");
p2PNetworkLabelId.set("splash-error-state-msg");
} else if ((int) oldValue == 0 && (int) newValue > 0) {
p2PNetworkWarnMsg.set(null);
p2PNetworkLabelId.set("footer-pane");
}
updateP2pNetworkInfoWithPeersChanged((int) newValue); updateP2pNetworkInfoWithPeersChanged((int) newValue);
}; };
p2PService.getNumAuthenticatedPeers().addListener(numAuthenticatedPeersListener); p2PService.getNumAuthenticatedPeers().addListener(numAuthenticatedPeersListener);