diff options
author | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-10-06 14:31:52 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-10-06 14:31:52 (GMT) |
commit | d0cd8e27bdd3ef6745f2ec1ff02cc191ffbd2af8 (patch) | |
tree | e673f7e5add5102aa68d1fa4524b26495257c738 /bin | |
parent | b36db6599ed59412ce77c8ed4fb1dea782877a62 (diff) |
Fix sugar-ui-check. Load activities from system path.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/.gitignore | 1 | ||||
-rw-r--r-- | bin/sugar-shell-service.in | 32 | ||||
-rw-r--r-- | bin/sugar-ui-check | 12 |
3 files changed, 11 insertions, 34 deletions
diff --git a/bin/.gitignore b/bin/.gitignore index b86c1c9..9e78b64 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,2 +1 @@ -sugar sugar-shell-service diff --git a/bin/sugar-shell-service.in b/bin/sugar-shell-service.in deleted file mode 100644 index 49c2764..0000000 --- a/bin/sugar-shell-service.in +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2008, Red Hat, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -import sys -from os import environ - -if not environ.has_key('SUGAR_ACTIVITIES'): - environ['SUGAR_ACTIVITIES'] = '@prefix@/share/sugar/activities:' \ - '@prefix@/lib64/sugar/activities:' \ - '@prefix@/lib/sugar/activities' - -sys.path.insert(0, '@prefix@/share/sugar/service') - -from main import main - -main() - - diff --git a/bin/sugar-ui-check b/bin/sugar-ui-check index d9230e4..482c952 100644 --- a/bin/sugar-ui-check +++ b/bin/sugar-ui-check @@ -21,6 +21,7 @@ import sys import subprocess import time +import dbus import gobject import gtk import wnck @@ -28,6 +29,7 @@ import wnck from sugar import wm from jarabe.model.shell import get_sugar_window_type +from sugar.bundle.activitybundle import ActivityBundle from jarabe import config checks_queue = [] @@ -98,7 +100,15 @@ class ActivityCheck(Check): def launch_activity(self): from sugar.activity import activityfactory - activityfactory.create(self.name) + bus = dbus.SessionBus() + proxy = bus.get_object('org.laptop.Shell', '/org/laptop/Shell') + iface = dbus.Interface(proxy, 'org.laptop.Shell') + path = iface.GetBundlePath(self.name) + + if path: + activityfactory.create(ActivityBundle(path)) + else: + logging.error('Cannot find activity %s.' % self.name) def _window_opened_cb(self, screen, window): if wm.get_bundle_id(window) == self.name and \ |