view PreferencesDialog.py @ 60:d063e4814357

When clicking an entry, it's marked as read
author Dirk Olmes <dirk@xanthippe.ping.de>
date Fri, 23 Jul 2010 17:41:05 +0200
parents 03358c113170
children db35ab7753f0
line wrap: on
line source


from Preferences import Preferences
from PyQt4 import QtGui
from Ui_Preferences import Ui_Preferences

class PreferencesDialog(QtGui.QDialog):
    def __init__(self, session=None):
        QtGui.QWidget.__init__(self, None)
        self.session = session
        self.preferences = Preferences(session)
        self.ui = Ui_Preferences()
        self.ui.setupUi(self)
        self.fillUi()
        
    def fillUi(self):
        maximized = self.preferences.startMaximized()
        self.ui.startMaximized.setChecked(maximized)

    def startMaximizedChanged(self, change):
        if change:
            self.preferences.setStartMaximized(True)
        else:
            self.preferences.setStartMaximized(False)

    def accept(self):
        self.session.commit()
        QtGui.QDialog.accept(self)
        
    def reject(self):
        self.session.rollback()
        QtGui.QDialog.reject(self)