diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-08-31 09:37:42 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-08-31 09:37:42 (GMT) |
commit | 560a914997d1a728ca4f972dba3b3847b2077569 (patch) | |
tree | 8f59c65c645acd6e55033afc3a6c958077217d0e /shell/model/MeshModel.py | |
parent | fbf995e71dc5c3da917197f567cd5512a5052a9e (diff) |
Make Activity update the presence service activity
name and listen to the name changes in the mesh view.
Diffstat (limited to 'shell/model/MeshModel.py')
-rw-r--r-- | shell/model/MeshModel.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/shell/model/MeshModel.py b/shell/model/MeshModel.py index e326634..32e213a 100644 --- a/shell/model/MeshModel.py +++ b/shell/model/MeshModel.py @@ -26,24 +26,21 @@ from hardware import hardwaremanager from hardware import nmclient class ActivityModel: - def __init__(self, activity, activity_info): - self._activity = activity - self._activity_info = activity_info + def __init__(self, activity, bundle): + self.activity = activity + self.bundle = bundle def get_id(self): - return self._activity.props.id + return self.activity.props.id def get_icon_name(self): - return self._activity_info.icon + return self.bundle.icon def get_color(self): - return XoColor(self._activity.props.color) + return XoColor(self.activity.props.color) def get_service_name(self): - return self._activity_info.service_name - - def get_title(self): - return self._activity.props.name + return self.bundle.service_name class MeshModel(gobject.GObject): __gsignals__ = { @@ -203,12 +200,12 @@ class MeshModel(gobject.GObject): def _check_activity(self, presence_activity): registry = activity.get_registry() - activity_info = registry.get_activity(presence_activity.props.type) - if not activity_info: + bundle = registry.get_activity(presence_activity.props.type) + if not bundle: return if self.has_activity(presence_activity.props.id): return - self.add_activity(activity_info, presence_activity) + self.add_activity(bundle, presence_activity) def has_activity(self, activity_id): return self._activities.has_key(activity_id) @@ -219,8 +216,8 @@ class MeshModel(gobject.GObject): else: return None - def add_activity(self, activity_info, activity): - model = ActivityModel(activity, activity_info) + def add_activity(self, bundle, activity): + model = ActivityModel(activity, bundle) self._activities[model.get_id()] = model self.emit('activity-added', model) |