Move saving UI state

quit is more appropriate than close event, but it my resurrect the issue
with linux saving config data.
This commit is contained in:
mailchuck 2015-11-14 21:07:46 +01:00
parent 51232d3dd9
commit da18e4be26
Signed by untrusted user who does not match committer: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -2862,6 +2862,14 @@ class MyForm(settingsmixin.SMainWindow):
if reply is QtGui.QMessageBox.No: if reply is QtGui.QMessageBox.No:
return return
''' '''
# save state and geometry self and all widgets
self.saveSettings()
for attr, obj in self.ui.__dict__.iteritems():
if hasattr(obj, "__class__") and isinstance(obj, settingsmixin.SettingsMixin):
saveMethod = getattr(obj, "saveSettings", None)
if callable (saveMethod):
obj.saveSettings()
shared.doCleanShutdown() shared.doCleanShutdown()
self.tray.hide() self.tray.hide()
# unregister the messaging system # unregister the messaging system
@ -2891,13 +2899,6 @@ class MyForm(settingsmixin.SMainWindow):
# minimize the application # minimize the application
event.ignore() event.ignore()
else: else:
# save state and geometry self and all widgets
self.saveSettings()
for attr, obj in self.ui.__dict__.iteritems():
if hasattr(obj, "__class__") and isinstance(obj, settingsmixin.SettingsMixin):
saveMethod = getattr(obj, "saveSettings", None)
if callable (saveMethod):
obj.saveSettings()
# quit the application # quit the application
event.accept() event.accept()
self.quit() self.quit()