comparison PreferencesDialog.py @ 120:e830fa1cc7a2 backend

re-enabled PreferencesDialog
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sun, 21 Aug 2011 04:04:37 +0200
parents c17a224bc251
children e8bb107a74e1
comparison
equal deleted inserted replaced
119:04a730f9d07d 120:e830fa1cc7a2
1 1
2 from Preferences import Preferences
3 from PyQt4 import QtGui 2 from PyQt4 import QtGui
4 from Ui_Preferences import Ui_Preferences 3 from Ui_Preferences import Ui_Preferences
5 4
6 class PreferencesDialog(QtGui.QDialog): 5 class PreferencesDialog(QtGui.QDialog):
7 def __init__(self, session=None): 6 def __init__(self, backend=None):
8 QtGui.QWidget.__init__(self, None) 7 QtGui.QWidget.__init__(self, None)
9 self.session = session 8 self.backend = backend
10 self.preferences = Preferences(session) 9 self.preferences = backend.preferences()
11 self.ui = Ui_Preferences() 10 self.ui = Ui_Preferences()
12 self.ui.setupUi(self) 11 self.ui.setupUi(self)
13 self.fillUi() 12 self.fillUi()
14 13
15 def fillUi(self): 14 def fillUi(self):
75 text = str(text) 74 text = str(text)
76 self.preferences.setDaysToKeepFeedEntries(text) 75 self.preferences.setDaysToKeepFeedEntries(text)
77 76
78 def accept(self): 77 def accept(self):
79 self.storeProxySettings() 78 self.storeProxySettings()
80 self.session.commit() 79 self.preferences.commit();
81 QtGui.QDialog.accept(self) 80 QtGui.QDialog.accept(self)
82 81
83 def reject(self): 82 def reject(self):
84 self.session.rollback() 83 self.preferences.rollback()
85 QtGui.QDialog.reject(self) 84 QtGui.QDialog.reject(self)
86 85