From a4a2b33dacc6fb8eb1ab77c13fabb231e3845f98 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Thu, 01 Oct 2009 18:04:06 +0000 Subject: Do no use random color if metadata color is not valid #1435 --- 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 -- cgit v0.9.1