Allow re-call of MyForm.quit() if user selected to wait at first

This commit is contained in:
Dmitri Bogomolov 2018-07-06 15:16:22 +03:00
parent 4383b49be8
commit ff04bf072e
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
1 changed files with 5 additions and 10 deletions

View File

@ -627,8 +627,8 @@ class MyForm(settingsmixin.SMainWindow):
self.replyFromTab = None
# so that quit won't loop
self.quitAccepted = False
self.wait = self.quitAccepted = False
self.init_file_menu()
self.init_inbox_popup_menu()
self.init_identities_popup_menu()
@ -2709,7 +2709,7 @@ class MyForm(settingsmixin.SMainWindow):
# Quit selected from menu or application indicator
def quit(self):
"""Quit the bitmessageqt application"""
if self.quitAccepted:
if self.quitAccepted and not self.wait:
return
self.show()
@ -2761,7 +2761,7 @@ class MyForm(settingsmixin.SMainWindow):
QtGui.QMessageBox.Cancel
)
if reply == QtGui.QMessageBox.Yes:
waitForSync = True
self.wait = waitForSync = True
elif reply == QtGui.QMessageBox.Cancel:
return
@ -2781,7 +2781,7 @@ class MyForm(settingsmixin.SMainWindow):
)
if reply == QtGui.QMessageBox.Yes:
waitForConnection = True
waitForSync = True
self.wait = waitForSync = True
elif reply == QtGui.QMessageBox.Cancel:
return
@ -2904,11 +2904,6 @@ class MyForm(settingsmixin.SMainWindow):
trayonclose = BMConfigParser().safeGetBoolean(
'bitmessagesettings', 'trayonclose')
# always ignore, it shuts down by itself
if self.quitAccepted:
event.accept()
return
event.ignore()
if not trayonclose:
# quit the application