From 141072c9e99ec4517bb40eaeecb39e42cbdc24b5 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 14 May 2007 17:56:06 +0000 Subject: Set a default title for the activity --- diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py index 2156594..6f81125 100644 --- a/sugar/activity/activity.py +++ b/sugar/activity/activity.py @@ -195,7 +195,7 @@ class Activity(Window, gtk.Container): elif create_jobject: logging.debug('Creating a jobject.') self.jobject = datastore.create() - self.jobject['title'] = '' + self.jobject['title'] = '%s %s' % (get_bundle_name(), 'Activity') self.jobject['activity'] = self.get_service_name() self.jobject['date'] = str(time.time()) self.jobject['icon'] = '' @@ -312,6 +312,11 @@ class Activity(Window, gtk.Container): act_toolbar.share.connect('clicked', self._handle_share_cb) act_toolbar.close.connect('clicked', self._handle_close_cb) +def get_bundle_name(): + """Return the bundle name for the current process' bundle + """ + return os.environ['SUGAR_BUNDLE_NAME'] + def get_bundle_path(): """Return the bundle path for the current process' bundle """ diff --git a/sugar/activity/activityfactoryservice.py b/sugar/activity/activityfactoryservice.py index ee98f51..21e7d5b 100644 --- a/sugar/activity/activityfactoryservice.py +++ b/sugar/activity/activityfactoryservice.py @@ -152,6 +152,7 @@ def run(bundle_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() factory = ActivityFactoryService(bundle.get_service_name(), bundle.get_class()) -- cgit v0.9.1