Confirmation for network switch

This commit is contained in:
Dmitri Bogomolov 2018-07-07 15:27:56 +03:00
parent 09e7cc42ad
commit 996a48f298
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -2684,6 +2684,19 @@ class MyForm(settingsmixin.SMainWindow):
def network_switch(self): def network_switch(self):
dontconnect_option = not BMConfigParser().safeGetBoolean( dontconnect_option = not BMConfigParser().safeGetBoolean(
'bitmessagesettings', 'dontconnect') '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( BMConfigParser().set(
'bitmessagesettings', 'dontconnect', str(dontconnect_option)) 'bitmessagesettings', 'dontconnect', str(dontconnect_option))
BMConfigParser().save() BMConfigParser().save()