diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-10-01 18:04:06 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-10-01 18:04:06 (GMT) |
commit | a4a2b33dacc6fb8eb1ab77c13fabb231e3845f98 (patch) | |
tree | 16abd52f960aae7154567001bced827af26f4849 | |
parent | 3d46fd8c99aeea34fce971f14129432ea52e8e12 (diff) |
Do no use random color if metadata color is not valid #1435
-rw-r--r-- | src/sugar/graphics/xocolor.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sugar/graphics/xocolor.py b/src/sugar/graphics/xocolor.py index 00238d9..fd329cb 100644 --- a/src/sugar/graphics/xocolor.py +++ b/src/sugar/graphics/xocolor.py @@ -22,6 +22,8 @@ STABLE. import random import logging +import gconf + colors = [ ['#B20008', '#FF2B34'], \ ['#FF2B34', '#B20008'], \ @@ -229,9 +231,11 @@ class XoColor: if color_string == None: randomize = True elif not is_valid(color_string): - logging.error('Color string is not valid: %s, will generate a ' - 'random color pair.', color_string) - randomize = True + logging.debug('Color string is not valid: %s, ' + 'fallback to default', color_string) + client = gconf.client_get_default() + color_string = client.get_string('/desktop/sugar/user/color') + randomize = False else: randomize = False |