Set a default title for the activity

This commit is contained in:
Marco Pesenti Gritti 2007-05-14 19:56:06 +02:00
parent 8ccb393b55
commit 141072c9e9
2 changed files with 7 additions and 1 deletions

View File

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

View File

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