Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2013-02-03 20:56:50 (GMT)
committer Walter Bender <walter.bender@gmail.com>2013-02-03 20:56:50 (GMT)
commitd106625268e756880a5cccc05ac2c27b8e061e90 (patch)
tree3e9789167c229f7489d5d4eba46053e9aa27835b
parent3f1a0013ab3f3a00701090827f6d4d642f5d117d (diff)
add extension/web/*/icons to icontheme
-rw-r--r--src/jarabe/web/online_account.py6
-rw-r--r--src/jarabe/web/online_accounts_manager.py9
2 files changed, 9 insertions, 6 deletions
diff --git a/src/jarabe/web/online_account.py b/src/jarabe/web/online_account.py
index 560c252..b908538 100644
--- a/src/jarabe/web/online_account.py
+++ b/src/jarabe/web/online_account.py
@@ -21,7 +21,6 @@
#THE SOFTWARE.
from gi.repository import GObject
-from gi.repository import Gtk
from sugar3.graphics.menuitem import MenuItem
from sugar3.graphics.toolbutton import ToolButton
@@ -39,11 +38,6 @@ class OnlineAccount(GObject.GObject):
def get_refresh_button(self):
raise Exception("Not defined")
- def _add_icon_path(self, icon_path):
- icon_theme = Gtk.IconTheme.get_default()
- if os.path.exists(icon_path) and not icon_path in icon_theme:
- icon_theme.append_search_path(icon_path)
-
class OnlineShareMenu(MenuItem):
pass
diff --git a/src/jarabe/web/online_accounts_manager.py b/src/jarabe/web/online_accounts_manager.py
index 7cabadf..bd518d2 100644
--- a/src/jarabe/web/online_accounts_manager.py
+++ b/src/jarabe/web/online_accounts_manager.py
@@ -20,6 +20,7 @@
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#THE SOFTWARE.
+from gi.repository import Gtk
from gi.repository import GObject
import logging
import os
@@ -32,6 +33,8 @@ class OnlineAccountsManager(GObject.GObject):
def all_accounts(cls):
accounts = []
+ icon_theme = Gtk.IconTheme.get_default()
+
web_path = os.path.join(config.ext_path, 'web')
for d in os.listdir(web_path):
dir_path = os.path.join(web_path, d)
@@ -47,6 +50,12 @@ class OnlineAccountsManager(GObject.GObject):
accounts.append(mod.get_account())
except Exception:
logging.exception('Exception while loading extension:')
+ elif f == 'icons':
+ icon_path = os.path.join(dir_path, f)
+ if os.path.isdir(icon_path) and \
+ icon_path not in icon_theme:
+ icon_theme.append_search_path(icon_path)
+
return accounts
@classmethod