From cb0cedbc405ea7148fa30e47f0f8e38ff047daa3 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 16 Oct 2007 12:29:38 +0000 Subject: Do not use prgname for the bundle id because xulrunner is messing with it. Some activity launch fixes. --- diff --git a/bin/sugar-activity b/bin/sugar-activity index ed6c7df..2e10922 100755 --- a/bin/sugar-activity +++ b/bin/sugar-activity @@ -94,17 +94,6 @@ if len(args) == 0: bundle_path = os.environ['SUGAR_BUNDLE_PATH'] sys.path.append(bundle_path) -bundle = ActivityBundle(bundle_path) - -gettext.bindtextdomain(bundle.get_bundle_id(), - bundle.get_locale_path()) -gettext.textdomain(bundle.get_bundle_id()) - -gtk.icon_theme_get_default().append_search_path(bundle.get_icons_path()) - -_sugarbaseext.set_prgname(bundle.get_bundle_id()) -_sugarbaseext.set_application_name(bundle.get_name()) - splitted_module = args[0].rsplit('.', 1) module_name = splitted_module[0] class_name = splitted_module[1] @@ -112,10 +101,8 @@ class_name = splitted_module[1] module = __import__(module_name) for comp in module_name.split('.')[1:]: module = getattr(module, comp) - if hasattr(module, 'start'): - module.start() -constructor = getattr(module, class_name) +constructor = getattr(module, class_name) handle = activityhandle.ActivityHandle( activity_id=options.activity_id, object_id=options.object_id, uri=options.uri) @@ -123,9 +110,8 @@ handle = activityhandle.ActivityHandle( if options.single_process is True: bus = dbus.SessionBus() - bundle_id = bundle.get_bundle_id() - service_name = get_single_process_name(bundle_id) - service_path = get_single_process_path(bundle_id) + service_name = get_single_process_name(options.bundle_id) + service_path = get_single_process_path(options.bundle_id) bus_object = bus.get_object( 'org.freedesktop.DBus', '/org/freedesktop/DBus') @@ -144,6 +130,20 @@ if options.single_process is True: print 'Created %s in a single process.' % service_name sys.exit(0) +if hasattr(module, 'start'): + module.start() + +bundle = ActivityBundle(bundle_path) + +os.environ['SUGAR_BUNDLE_ID'] = bundle.get_bundle_id() +os.environ['SUGAR_BUNDLE_NAME'] = bundle.get_name() + +gettext.bindtextdomain(bundle.get_bundle_id(), + bundle.get_locale_path()) +gettext.textdomain(bundle.get_bundle_id()) + +gtk.icon_theme_get_default().append_search_path(bundle.get_icons_path()) + create_activity_instance(constructor, handle) gtk.main() diff --git a/lib/sugar/activity/activity.py b/lib/sugar/activity/activity.py index c581c15..d3cfe2a 100644 --- a/lib/sugar/activity/activity.py +++ b/lib/sugar/activity/activity.py @@ -362,7 +362,7 @@ class Activity(Window, gtk.Container): return self._activity_id def get_bundle_id(self): - return _sugarbaseext.get_prgname() + return os.environ['SUGAR_BUNDLE_ID'] def set_canvas(self, canvas): Window.set_canvas(self, canvas) @@ -624,7 +624,7 @@ class Activity(Window, gtk.Container): def get_bundle_name(): """Return the bundle name for the current process' bundle """ - return _sugarbaseext.get_application_name() + return os.environ['SUGAR_BUNDLE_NAME'] def get_bundle_path(): """Return the bundle path for the current process' bundle -- cgit v0.9.1