Proper quit sequence:

close MainWindow and quit the app instead of sys.exit()
This commit is contained in:
Dmitri Bogomolov 2018-11-14 12:16:11 +02:00
parent 6f6cb93565
commit 524c21243b
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -2280,6 +2280,7 @@ class MainWindow(Window):
QtCore.QEventLoop.AllEvents, 1000
)
shutdown.doCleanShutdown()
self.updateStatusBar(_translate(
"MainWindow", "Stopping notifications... %1%").arg(90))
self.tray.hide()
@ -2288,20 +2289,21 @@ class MainWindow(Window):
"MainWindow", "Shutdown imminent... %1%").arg(100))
logger.info("Shutdown complete")
super(MainWindow, self).close()
# return
sys.exit()
self.close()
# FIXME: rewrite loops with timer instead
if self.wait:
self.destroy()
app.quit()
# window close event
def closeEvent(self, event):
self.appIndicatorHide()
"""window close event"""
event.ignore()
trayonclose = BMConfigParser().safeGetBoolean(
'bitmessagesettings', 'trayonclose')
event.ignore()
if not trayonclose:
# quit the application
if trayonclose:
self.appIndicatorHide()
else:
# custom quit method
self.quit()
def on_action_InboxMessageForceHtml(self):
@ -3659,4 +3661,4 @@ def run():
if not BMConfigParser().getboolean('bitmessagesettings', 'startintray'):
myapp.show()
sys.exit(app.exec_())
app.exec_()