Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/memorizetoolbar.py
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2009-06-10 21:20:46 (GMT)
committer Simon Schampijer <simon@schampijer.de>2009-06-10 21:20:46 (GMT)
commit4590f28a206bee298efa523f0c2f90f8d3f97040 (patch)
tree9eac0459dd14d953e06344ae9e092e108ca11ba5 /memorizetoolbar.py
parent6da68b08c94f321a755140c59e30c823ada72f67 (diff)
Games without color information
For example a downloaded game won't have color information
Diffstat (limited to 'memorizetoolbar.py')
-rw-r--r--memorizetoolbar.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/memorizetoolbar.py b/memorizetoolbar.py
index 058a397..b525b95 100644
--- a/memorizetoolbar.py
+++ b/memorizetoolbar.py
@@ -22,6 +22,8 @@ from gettext import gettext as _
from sugar.graphics.toolbutton import ToolButton
from sugar.graphics.toolcombobox import ToolComboBox
from sugar.graphics.objectchooser import ObjectChooser
+from sugar import profile
+
import logging
from gobject import SIGNAL_RUN_FIRST, TYPE_PYOBJECT
@@ -129,7 +131,10 @@ class MemorizeToolbar(gtk.Toolbar):
if jobject and jobject.file_path:
title = jobject.metadata['title']
- color = jobject.metadata['icon-color']
+ if jobject.metadata.has_key('icon-color'):
+ color = jobject.metadata['icon-color']
+ else:
+ color = profile.get_color().to_string()
self.emit('game_changed', jobject.file_path, 4, 'file', title, color)
if self.jobject != None: