Rename activity service_name to bundle_id

This commit is contained in:
Marco Pesenti Gritti
2007-10-09 13:15:06 +02:00
parent 57961d17bc
commit 6073a396b3
16 changed files with 62 additions and 50 deletions
+3 -3
View File
@@ -299,7 +299,7 @@ class Activity(Window, gtk.Container):
self._jobject.metadata['title'] = _('%s Activity') % get_bundle_name()
self.set_title(self._jobject.metadata['title'])
self._jobject.metadata['title_set_by_user'] = '0'
self._jobject.metadata['activity'] = self.get_service_name()
self._jobject.metadata['activity'] = self.get_bundle_id()
self._jobject.metadata['activity_id'] = self.get_id()
self._jobject.metadata['keep'] = '0'
self._jobject.metadata['preview'] = ''
@@ -362,7 +362,7 @@ class Activity(Window, gtk.Container):
def get_id(self):
return self._activity_id
def get_service_name(self):
def get_bundle_id(self):
return _sugarext.get_prgname()
def set_canvas(self, canvas):
@@ -594,7 +594,7 @@ class Activity(Window, gtk.Container):
self._pservice.share_activity(self, private=private)
def _realize_cb(self, window):
wm.set_bundle_id(window.window, self.get_service_name())
wm.set_bundle_id(window.window, self.get_bundle_id())
wm.set_activity_id(window.window, self._activity_id)
def _delete_event_cb(self, window, event):
+3 -1
View File
@@ -158,6 +158,7 @@ class ActivityCreationHandler(gobject.GObject):
env['PATH'] = bin_path + ':' + env['PATH']
command = activity.command
command += ' -b %s' % activity.bundle_id
if self._handle.activity_id is not None:
command += ' -a %s' % self._handle.activity_id
if self._handle.object_id is not None:
@@ -165,7 +166,8 @@ class ActivityCreationHandler(gobject.GObject):
if self._handle.uri is not None:
command += ' -u %s' % self._handle.uri
process = subprocess.Popen(command, env=env, shell=True)
process = subprocess.Popen(command, env=env, shell=True,
cwd=activity.path)
else:
system_bus = dbus.SystemBus()
factory = system_bus.get_object(_RAINBOW_SERVICE_NAME,
+4 -4
View File
@@ -107,9 +107,9 @@ def _delete_backups(arg, dirname, names):
if name.endswith('~') or name.endswith('pyc'):
os.remove(os.path.join(dirname, name))
def _get_service_name():
def _get_bundle_id():
bundle = ActivityBundle(_get_source_path())
return bundle.get_service_name()
return bundle.get_bundle_id()
def cmd_help():
print 'Usage: \n\
@@ -162,7 +162,7 @@ def _get_l10n_list(manifest):
l10n_list = []
for lang in _get_po_list(manifest).keys():
filename = _get_service_name() + '.mo'
filename = _get_bundle_id() + '.mo'
l10n_list.append(os.path.join('locale', lang, 'LC_MESSAGES', filename))
l10n_list.append(os.path.join('locale', lang, 'activity.linfo'))
@@ -256,7 +256,7 @@ def cmd_genl10n(bundle_name, manifest):
if not os.path.isdir(mo_path):
os.makedirs(mo_path)
mo_file = os.path.join(mo_path, "%s.mo" % _get_service_name())
mo_file = os.path.join(mo_path, "%s.mo" % _get_bundle_id())
args = ["msgfmt", "--output-file=%s" % mo_file, file_name]
retcode = subprocess.call(args)
if retcode:
+3 -3
View File
@@ -29,15 +29,15 @@ def _activity_info_from_dict(info_dict):
if not info_dict:
return None
return ActivityInfo(info_dict['name'], info_dict['icon'],
info_dict['service_name'], info_dict['path'],
info_dict['bundle_id'], info_dict['path'],
info_dict['show_launcher'], info_dict['command'])
class ActivityInfo(object):
def __init__(self, name, icon, service_name,
def __init__(self, name, icon, bundle_id,
path, show_launcher, command):
self.name = name
self.icon = icon
self.service_name = service_name
self.bundle_id = bundle_id
self.path = path
self.command = command
self.show_launcher = show_launcher