Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/model/MeshModel.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-12-20 12:58:29 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-12-20 12:58:29 (GMT)
commite023d1c3451b8e32c5607f774f3187fd21cb9d7d (patch)
treee6e3cbbb623b37deb35412fe57962f31dae2a39f /shell/model/MeshModel.py
parent99cce220cde2710f9ba58847f4e49eede99f89e2 (diff)
Get back mesh view to work. It got broken when refactoring bundles.
Diffstat (limited to 'shell/model/MeshModel.py')
-rw-r--r--shell/model/MeshModel.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/shell/model/MeshModel.py b/shell/model/MeshModel.py
index 5ab36e9..a261156 100644
--- a/shell/model/MeshModel.py
+++ b/shell/model/MeshModel.py
@@ -24,12 +24,13 @@ class ActivityModel:
def __init__(self, activity, bundle, service):
self._service = service
self._activity = activity
+ self._bundle = bundle
def get_id(self):
return self._activity.get_id()
def get_icon_name(self):
- return bundle.get_icon()
+ return self._bundle.get_icon()
def get_color(self):
return IconColor(self._activity.get_color())
@@ -121,12 +122,14 @@ class MeshModel(gobject.GObject):
self._check_service(service)
def _check_service(self, service):
- if self._bundle_registry.get_bundle(service.get_type()) != None:
+ service_type = service.get_type()
+ bundle = self._bundle_registry.find_by_default_type(service_type)
+ if bundle != None:
activity_id = service.get_activity_id()
if not self.has_activity(activity_id):
activity = self._pservice.get_activity(activity_id)
if activity != None:
- self.add_activity(activity, service)
+ self.add_activity(bundle, activity, service)
def has_activity(self, activity_id):
return self._activities.has_key(activity_id)
@@ -137,8 +140,7 @@ class MeshModel(gobject.GObject):
else:
return None
- def add_activity(self, activity, service):
- bundle = self._bundle_registry.get_bundle(service.get_type())
+ def add_activity(self, bundle, activity, service):
model = ActivityModel(activity, bundle, service)
self._activities[model.get_id()] = model
self.emit('activity-added', model)