# HG changeset patch # User Dirk Olmes # Date 1293163581 -3600 # Node ID a1066e5a8f88df707326c30c369fbc92f4c800e1 # Parent 2eddb44920d1c779b4b4a558fc01dd99841ffe9c save pending changes when quitting the app diff -r 2eddb44920d1 -r a1066e5a8f88 MainWindow.py --- a/MainWindow.py Fri Dec 24 04:36:06 2010 +0100 +++ b/MainWindow.py Fri Dec 24 05:06:21 2010 +0100 @@ -7,17 +7,18 @@ from FeedSettings import FeedSettings from Preferences import Preferences from PreferencesDialog import PreferencesDialog -from PyQt4 import QtGui from PyQt4.QtCore import QUrl +from PyQt4.QtGui import QMainWindow +from PyQt4.QtGui import QWidget from Ui_MainWindow import Ui_MainWindow import FeedList import subprocess STATUS_MESSAGE_DISPLAY_MILLIS = 20000 -class MainWindow(QtGui.QMainWindow): +class MainWindow(QMainWindow): def __init__(self, session=None): - QtGui.QWidget.__init__(self, None) + QWidget.__init__(self, None) self.session = session self.preferences = Preferences(session) self.ui = Ui_MainWindow() @@ -127,3 +128,7 @@ def _updateStatusBar(self, message): self.ui.statusbar.showMessage(message, STATUS_MESSAGE_DISPLAY_MILLIS) + def close(self): + # save all uncommitted state, just in case + self.session.commit() + QMainWindow.close(self)