Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2007-05-31 09:30:16 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2007-05-31 09:30:16 (GMT)
commitfc53bf86676fd80a4be6fecf953364da4eb991ce (patch)
tree6f6c3e11d80c75677e550301d068b4cf86358c9f
parent9ea6b18027f9efe768f3b9472b34cabe1328e85c (diff)
Support icons inside the activity
-rw-r--r--sugar/activity/activityfactoryservice.py2
-rw-r--r--sugar/activity/bundle.py4
-rw-r--r--sugar/graphics/toolbutton.py8
3 files changed, 10 insertions, 4 deletions
diff --git a/sugar/activity/activityfactoryservice.py b/sugar/activity/activityfactoryservice.py
index 4f61423..ea0ff8c 100644
--- a/sugar/activity/activityfactoryservice.py
+++ b/sugar/activity/activityfactoryservice.py
@@ -152,6 +152,8 @@ def run(bundle_path):
bundle.get_locale_path())
gettext.textdomain(bundle.get_service_name())
+ gtk.icon_theme_get_default().append_search_path(bundle.get_icons_path())
+
os.environ['SUGAR_BUNDLE_PATH'] = bundle_path
os.environ['SUGAR_BUNDLE_SERVICE_NAME'] = bundle.get_service_name()
os.environ['SUGAR_BUNDLE_NAME'] = bundle.get_name()
diff --git a/sugar/activity/bundle.py b/sugar/activity/bundle.py
index 9410f24..df67601 100644
--- a/sugar/activity/bundle.py
+++ b/sugar/activity/bundle.py
@@ -139,6 +139,10 @@ class Bundle:
"""Get the locale path inside the activity bundle."""
return os.path.join(self._path, 'locale')
+ def get_icons_path(self):
+ """Get the icons path inside the activity bundle."""
+ return os.path.join(self._path, 'icons')
+
def get_path(self):
"""Get the activity bundle path."""
return self._path
diff --git a/sugar/graphics/toolbutton.py b/sugar/graphics/toolbutton.py
index 2f6e9bf..1967dd0 100644
--- a/sugar/graphics/toolbutton.py
+++ b/sugar/graphics/toolbutton.py
@@ -21,12 +21,12 @@ from sugar.graphics.icon import Icon
from sugar.graphics.palette import *
class ToolButton(gtk.ToolButton):
- def __init__(self, named_icon=None):
+ def __init__(self, icon_name=None):
gtk.ToolButton.__init__(self)
- self.set_named_icon(named_icon)
+ self.set_icon(icon_name)
- def set_named_icon(self, named_icon):
- icon = Icon(named_icon)
+ def set_icon(self, icon_name):
+ icon = Icon(icon_name)
self.set_icon_widget(icon)
icon.show()