Do not use prgname for the bundle id because xulrunner

is messing with it. Some activity launch fixes.
This commit is contained in:
Marco Pesenti Gritti 2007-10-16 14:29:38 +02:00
parent e425c1d886
commit cb0cedbc40
2 changed files with 19 additions and 19 deletions

View File

@ -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()

View File

@ -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