view PreferencesDialog.py @ 43:12ed8b5fa08c

first system preference: configure app to stat maximized.
author Dirk Olmes <dirk@xanthippe.ping.de>
date Fri, 14 May 2010 08:31:46 +0200
parents 0c0d1760b737
children be990ac6e478
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):
        print("start maximized: " + str(change))

    def accept(self):
        # TODO save the session
        QtGui.QDialog.accept(self)
        
    def reject(self):
        # TODO revert the session
        QtGui.QDialog.reject(self)