Set icon search path.
authorHuang Peng <shawn.p.huang@gmail.com>
Thu, 19 Jun 2008 14:09:44 +0000 (22:09 +0800)
committerHuang Peng <shawn.p.huang@gmail.com>
Thu, 19 Jun 2008 14:09:44 +0000 (22:09 +0800)
panel/languagebar.py
panel/panel.py

index 527c505..6919421 100644 (file)
@@ -43,8 +43,6 @@ class LanguageBar (gtk.Toolbar):
        def __init__ (self):
                gtk.Toolbar.__init__ (self)
                self.set_property ("icon-size", ICON_SIZE)
-               icon_theme = gtk.icon_theme_get_default ()
-               icon_theme.prepend_search_path ("/home/phuang/sources/ibus/icons")
                self._create_ui ()
 
                self._properties = {}
index 9882394..2c74bd0 100644 (file)
@@ -23,6 +23,7 @@ import gtk
 import gtk.gdk as gdk
 import gobject
 import ibus
+from os import path
 from lang import LANGUAGES
 from ibus import interface
 from languagebar import LanguageBar
@@ -33,6 +34,13 @@ class Panel (ibus.Object):
                gobject.GObject.__init__ (self)
                self._proxy = proxy
                self._ibus = _ibus
+
+               # add icon search path
+               icon_theme = gtk.icon_theme_get_default ()
+               dir = path.dirname (__file__)
+               icondir = path.join (dir, "..", "icons")
+               icon_theme.prepend_search_path (icondir)
+
                self._language_bar = LanguageBar ()
                self._language_bar.connect ("property-activate",
                                                lambda widget, prop_name: self._proxy.PropertyActivate (prop_name))