Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/activity
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2007-06-29 20:11:28 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2007-06-29 20:11:28 (GMT)
commit1d4112a8825480169517b09305271646fca69286 (patch)
treea9a7bb8eac28b352fd03afd9d0dd1b8554b1a82a /sugar/activity
parenta609da166bf203eca430c7c3d35bd55d2acf33bf (diff)
Set glib program name and application name.
Better way of importing ltihooks. Several cleanups.
Diffstat (limited to 'sugar/activity')
-rw-r--r--sugar/activity/activity.py5
-rw-r--r--sugar/activity/activityfactory.py5
-rw-r--r--sugar/activity/activityfactoryservice.py6
3 files changed, 9 insertions, 7 deletions
diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py
index a45c844..7f6ad9b 100644
--- a/sugar/activity/activity.py
+++ b/sugar/activity/activity.py
@@ -39,6 +39,7 @@ from sugar.graphics.toolbutton import ToolButton
from sugar.datastore import datastore
from sugar import wm
from sugar import profile
+from sugar import _sugarext
class ActivityToolbar(gtk.Toolbar):
def __init__(self, activity):
@@ -272,7 +273,7 @@ class Activity(Window, gtk.Container):
return self._activity_id
def get_service_name(self):
- return os.environ['SUGAR_BUNDLE_SERVICE_NAME']
+ return _sugarext.get_prgname()
def set_canvas(self, canvas):
Window.set_canvas(self, canvas)
@@ -416,7 +417,7 @@ class Activity(Window, gtk.Container):
def get_bundle_name():
"""Return the bundle name for the current process' bundle
"""
- return os.environ['SUGAR_BUNDLE_NAME']
+ return _sugarext.get_application_name()
def get_bundle_path():
"""Return the bundle path for the current process' bundle
diff --git a/sugar/activity/activityfactory.py b/sugar/activity/activityfactory.py
index f3e8bbe..d1480b2 100644
--- a/sugar/activity/activityfactory.py
+++ b/sugar/activity/activityfactory.py
@@ -129,9 +129,8 @@ class ActivityCreationHandler(gobject.GObject):
logging.debug("Couldn't create activity %s (%s): %s" %
(self._activity_handle.activity_id, self._service_name, err))
self._shell.NotifyLaunchFailure(
- service_name, self.get_activity_id(),
- reply_handler=self._no_reply_handler,
- error_handler=self._notify_launch_failure_error_handler)
+ self.get_activity_id(), reply_handler=self._no_reply_handler,
+ error_handler=self._notify_launch_failure_error_handler)
def create(service_name, activity_handle=None):
"""Create a new activity from its name."""
diff --git a/sugar/activity/activityfactoryservice.py b/sugar/activity/activityfactoryservice.py
index bc7c4e7..8b1397f 100644
--- a/sugar/activity/activityfactoryservice.py
+++ b/sugar/activity/activityfactoryservice.py
@@ -29,6 +29,7 @@ import dbus.glib
from sugar.activity.bundle import Bundle
from sugar.activity import activityhandle
from sugar import logger
+from sugar import _sugarext
# Work around for dbus mutex locking issue
gobject.threads_init()
@@ -155,8 +156,9 @@ def run(bundle_path):
gtk.icon_theme_get_default().append_search_path(bundle.get_icons_path())
os.environ['SUGAR_BUNDLE_PATH'] = bundle_path
- os.environ['SUGAR_BUNDLE_SERVICE_NAME'] = bundle.get_service_name()
- os.environ['SUGAR_BUNDLE_NAME'] = bundle.get_name()
+
+ _sugarext.set_prgname(bundle.get_service_name())
+ _sugarext.set_application_name(bundle.get_name())
factory = ActivityFactoryService(bundle.get_service_name(),
bundle.get_class())