From 44d694387231059bb1c5a313b3da1abd0543095b Mon Sep 17 00:00:00 2001
From: Aleksey Lim <alsroot@member.fsf.org>
Date: Wed, 30 Sep 2009 15:47:11 +0000
Subject: Do no use random color if metadata color is not valid #1435
---
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
|
b
|
STABLE. |
22 | 22 | import random |
23 | 23 | import logging |
24 | 24 | |
| 25 | import gconf |
| 26 | |
25 | 27 | colors = [ |
26 | 28 | ['#B20008', '#FF2B34'], \ |
27 | 29 | ['#FF2B34', '#B20008'], \ |
… |
… |
class XoColor: |
229 | 231 | if color_string == None: |
230 | 232 | randomize = True |
231 | 233 | elif not is_valid(color_string): |
232 | | logging.error('Color string is not valid: %s, will generate a ' |
233 | | 'random color pair.', color_string) |
234 | | randomize = True |
| 234 | logging.debug('Color string is not valid: %s, ' |
| 235 | 'fallback to default', color_string) |
| 236 | client = gconf.client_get_default() |
| 237 | color_string = client.get_string('/desktop/sugar/user/color') |
| 238 | randomize = False |
235 | 239 | else: |
236 | 240 | randomize = False |
237 | 241 | |