From 9d4284d6248e6b5ffb3ecf0fe27ac76ab17c200d Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Mon, 1 Jun 2015 14:20:29 +0200 Subject: [PATCH] Store the state of the main window when closing and restore it. --- relational_gui/guihandler.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/relational_gui/guihandler.py b/relational_gui/guihandler.py index d4b01a7..7e1b70f 100644 --- a/relational_gui/guihandler.py +++ b/relational_gui/guihandler.py @@ -276,13 +276,19 @@ class relForm(QtWidgets.QMainWindow): event.accept() def save_settings(self): - # self.settings.setValue("width",) - pass + print('save') + self.settings.setValue('maingui/geometry', self.saveGeometry()) + self.settings.setValue('maingui/windowState', self.saveState()) def restore_settings(self): # self.settings.value('session_name','default').toString() self.setMultiline(self.settings.value('multiline','false')=='true') self.ui.txtMultiQuery.setPlainText(self.settings.value('multiline/query','')) + try: + self.restoreGeometry(self.settings.value('maingui/geometry')) + self.restoreState(self.settings.value('maingui/windowState')) + except: + pass def showSurvey(self): if self.Survey == None: