Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2008-07-09 09:57:56 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2008-07-09 11:43:49 (GMT)
commit92ef9d298a8ca0d67a4799c0ee652b63657c83ae (patch)
tree992297052374a5837ca13ae1ba04a12d0f232771 /src
parent176ed18699e35f3bc2745f1ec0862de515068d75 (diff)
#7430 Preserve the favorites layout across reboots
Diffstat (limited to 'src')
-rw-r--r--src/sugar/profile.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sugar/profile.py b/src/sugar/profile.py
index 00527af..87ce992 100644
--- a/src/sugar/profile.py
+++ b/src/sugar/profile.py
@@ -30,6 +30,10 @@ DEFAULT_TIMEZONE = 'UTC'
DEFAULT_HOT_CORNERS_DELAY = 0.0
DEFAULT_WARM_EDGES_DELAY = 1000.0
+RING_LAYOUT = 'ring-layout'
+RANDOM_LAYOUT = 'random-layout'
+DEFAULT_FAVORITES_LAYOUT = RANDOM_LAYOUT
+
_profile = None
def _set_key(cp, section, key, value):
@@ -73,6 +77,7 @@ class Profile(object):
self.warm_edges_delay = DEFAULT_WARM_EDGES_DELAY
self.automatic_pm = False
self.extreme_pm = False
+ self.favorites_layout = DEFAULT_FAVORITES_LAYOUT
self._pubkey = None
self._privkey_hash = None
@@ -116,6 +121,8 @@ class Profile(object):
_set_key(cp, 'Power', 'ExtremePM', self.extreme_pm)
+ _set_key(cp, 'Shell', 'FavoritesLayout', self.favorites_layout)
+
f = open(self._config_path, 'w')
cp.write(f)
f.close()
@@ -154,6 +161,8 @@ class Profile(object):
state = cp.get('Power', 'ExtremePM')
if state.lower() == "true":
self.extreme_pm = True
+ if cp.has_option('Shell', 'FavoritesLayout'):
+ self.favorites_layout = cp.get('Shell', 'FavoritesLayout')
del cp