Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2008-07-08 23:45:32 (GMT)
committer Chris Ball <cjb@laptop.org>2008-07-08 23:45:32 (GMT)
commit176ed18699e35f3bc2745f1ec0862de515068d75 (patch)
tree97b420a3339d53d71355c38bc6580412f27646de /src
parent1937512d95d225655576ac4a47ac3fb0a1d6bca6 (diff)
#7434 Add Power control panel section profile code.
Diffstat (limited to 'src')
-rw-r--r--src/sugar/profile.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sugar/profile.py b/src/sugar/profile.py
index dc9e1d4..00527af 100644
--- a/src/sugar/profile.py
+++ b/src/sugar/profile.py
@@ -71,6 +71,8 @@ class Profile(object):
self.sound_volume = DEFAULT_VOLUME
self.hot_corners_delay = DEFAULT_HOT_CORNERS_DELAY
self.warm_edges_delay = DEFAULT_WARM_EDGES_DELAY
+ self.automatic_pm = False
+ self.extreme_pm = False
self._pubkey = None
self._privkey_hash = None
@@ -110,6 +112,10 @@ class Profile(object):
_set_key(cp, 'Sound', 'Volume', self.sound_volume)
+ _set_key(cp, 'Power', 'AutomaticPM', self.automatic_pm)
+
+ _set_key(cp, 'Power', 'ExtremePM', self.extreme_pm)
+
f = open(self._config_path, 'w')
cp.write(f)
f.close()
@@ -140,6 +146,14 @@ class Profile(object):
self.backup1 = cp.get('Server', 'Backup1')
if cp.has_option('Sound', 'Volume'):
self.sound_volume = float(cp.get('Sound', 'Volume'))
+ if cp.has_option('Power', 'AutomaticPM'):
+ state = cp.get('Power', 'AutomaticPM')
+ if state.lower() == "true":
+ self.automatic_pm = True
+ if cp.has_option('Power', 'ExtremePM'):
+ state = cp.get('Power', 'ExtremePM')
+ if state.lower() == "true":
+ self.extreme_pm = True
del cp