From 996a48f298edfa997c8bad5d29763d3777785afd Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Sat, 7 Jul 2018 15:27:56 +0300 Subject: [PATCH] Confirmation for network switch --- src/bitmessageqt/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 5e4c18fd..aab1dd72 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -2684,6 +2684,19 @@ class MyForm(settingsmixin.SMainWindow): def network_switch(self): dontconnect_option = not BMConfigParser().safeGetBoolean( 'bitmessagesettings', 'dontconnect') + reply = QtGui.QMessageBox.question( + self, _translate("MainWindow", "Disconnecting") + if dontconnect_option else _translate("MainWindow", "Connecting"), + _translate( + "MainWindow", + "Bitmessage will now drop all connectins. Are you sure?" + ) if dontconnect_option else _translate( + "MainWindow", + "Bitmessage will now start connecting to network. Are you sure?" + ), QtGui.QMessageBox.Yes | QtGui.QMessageBox.Cancel, + QtGui.QMessageBox.Cancel) + if reply != QtGui.QMessageBox.Yes: + return BMConfigParser().set( 'bitmessagesettings', 'dontconnect', str(dontconnect_option)) BMConfigParser().save()