annotate Preferences.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
children be990ac6e478
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
1
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
2 from Preference import Preference
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
3 import util
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
4
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
5 START_MAXIMIZED = "START_MAXIMIZED"
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
6
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
7 class Preferences(object):
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
8 def __init__(self, session):
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
9 self.session = session
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
10
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
11 def startMaximized(self):
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
12 value = Preference.valueForKey(START_MAXIMIZED, self.session)
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
13 if value is not None:
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
14 return util.str2bool(value)
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
15 else:
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
16 return False