Cleanup shell model/view separation

This commit is contained in:
Marco Pesenti Gritti
2006-09-18 11:48:33 +02:00
parent 274dfbbf6a
commit 1f3187e0b5
6 changed files with 59 additions and 63 deletions
+2 -3
View File
@@ -21,8 +21,7 @@ class RightPanel(CanvasBox):
self._pservice.connect('activity-appeared',
self.__activity_appeared_cb)
shell.get_model().connect('activity-changed',
self.__activity_changed_cb)
shell.connect('activity-changed', self.__activity_changed_cb)
def add(self, buddy):
icon = BuddyIcon(self._shell, BuddyInfo(buddy))
@@ -42,7 +41,7 @@ class RightPanel(CanvasBox):
self._buddies = {}
def __activity_appeared_cb(self, pservice, activity_ps):
activity = self._shell.get_model().get_current_activity()
activity = self._shell.get_current_activity()
if activity and activity_ps.get_id() == activity.get_id():
self._set_activity_ps(activity_ps)
+3 -5
View File
@@ -37,8 +37,7 @@ class ActivityIcon(MenuIcon):
def _action_cb(self, menu, action):
if action == ActivityMenu.ACTION_SHARE:
shell_model = self._shell.get_model()
activity = shell_model.get_current_activity()
activity = shell.get_current_activity()
if activity != None:
activity.share()
@@ -77,9 +76,8 @@ class TopPanel(goocanvas.Group):
self._box = box
shell_model = shell.get_model()
shell_model.connect('activity-changed', self._activity_changed_cb)
self._set_current_activity(shell_model.get_current_activity())
shell.connect('activity-changed', self._activity_changed_cb)
self._set_current_activity(shell.get_current_activity())
def _set_current_activity(self, activity):
if self._activity_icon: