changeset 90:a1066e5a8f88

save pending changes when quitting the app
author Dirk Olmes <dirk@xanthippe.ping.de>
date Fri, 24 Dec 2010 05:06:21 +0100
parents 2eddb44920d1
children e5d5fc34ff2e
files MainWindow.py
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)