annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
40
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
1
43
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 42
diff changeset
2 from Preferences import Preferences
40
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
3 from PyQt4 import QtGui
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
4 from Ui_Preferences import Ui_Preferences
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
5
42
0c0d1760b737 Rename Preferences to PreferencesDialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 41
diff changeset
6 class PreferencesDialog(QtGui.QDialog):
40
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
7 def __init__(self, session=None):
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
8 QtGui.QWidget.__init__(self, None)
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
9 self.session = session
43
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 42
diff changeset
10 self.preferences = Preferences(session)
40
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
11 self.ui = Ui_Preferences()
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
12 self.ui.setupUi(self)
42
0c0d1760b737 Rename Preferences to PreferencesDialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 41
diff changeset
13 self.fillUi()
0c0d1760b737 Rename Preferences to PreferencesDialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 41
diff changeset
14
0c0d1760b737 Rename Preferences to PreferencesDialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 41
diff changeset
15 def fillUi(self):
43
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 42
diff changeset
16 maximized = self.preferences.startMaximized()
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 42
diff changeset
17 self.ui.startMaximized.setChecked(maximized)
40
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
18
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
19 def startMaximizedChanged(self, change):
c858aab71e5b add preferences dialog
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
20 print("start maximized: " + str(change))
41
9fa1e33b67da use Qt resources for window icons
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 40
diff changeset
21
9fa1e33b67da use Qt resources for window icons
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 40
diff changeset
22 def accept(self):
9fa1e33b67da use Qt resources for window icons
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 40
diff changeset
23 # TODO save the session
9fa1e33b67da use Qt resources for window icons
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 40
diff changeset
24 QtGui.QDialog.accept(self)
9fa1e33b67da use Qt resources for window icons
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 40
diff changeset
25
9fa1e33b67da use Qt resources for window icons
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 40
diff changeset
26 def reject(self):
9fa1e33b67da use Qt resources for window icons
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 40
diff changeset
27 # TODO revert the session
9fa1e33b67da use Qt resources for window icons
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 40
diff changeset
28 QtGui.QDialog.reject(self)
9fa1e33b67da use Qt resources for window icons
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 40
diff changeset
29
9fa1e33b67da use Qt resources for window icons
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 40
diff changeset
30