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

View File

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