Fix a few bugs
This commit is contained in:
parent
f2b2b8c6ba
commit
a2489b49d4
@ -20,10 +20,8 @@ class BuddyIcon(MenuIcon):
|
|||||||
def _popup_action_cb(self, popup, action):
|
def _popup_action_cb(self, popup, action):
|
||||||
self.popdown()
|
self.popdown()
|
||||||
|
|
||||||
model = self._shell.get_model()
|
friends = self._shell.get_model().get_friends()
|
||||||
|
|
||||||
if action == BuddyMenu.ACTION_REMOVE_FRIEND:
|
if action == BuddyMenu.ACTION_REMOVE_FRIEND:
|
||||||
friends = model.get_friends()
|
|
||||||
friends.remove(self._friend)
|
friends.remove(self._friend)
|
||||||
|
|
||||||
buddy = self._friend.get_buddy()
|
buddy = self._friend.get_buddy()
|
||||||
@ -31,8 +29,7 @@ class BuddyIcon(MenuIcon):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if action == BuddyMenu.ACTION_INVITE:
|
if action == BuddyMenu.ACTION_INVITE:
|
||||||
activity = model.get_current_activity()
|
activity = self._shell.get_current_activity()
|
||||||
activity.invite(buddy)
|
activity.invite(buddy)
|
||||||
elif action == BuddyMenu.ACTION_MAKE_FRIEND:
|
elif action == BuddyMenu.ACTION_MAKE_FRIEND:
|
||||||
friends = model.get_friends()
|
|
||||||
friends.make_friend(buddy)
|
friends.make_friend(buddy)
|
||||||
|
@ -111,7 +111,7 @@ class Shell(gobject.GObject):
|
|||||||
def join_activity(self, bundle_id, activity_id):
|
def join_activity(self, bundle_id, activity_id):
|
||||||
pservice = PresenceService.get_instance()
|
pservice = PresenceService.get_instance()
|
||||||
|
|
||||||
activity = self._model.get_activity(activity_id)
|
activity = self._get_activity(activity_id)
|
||||||
if activity:
|
if activity:
|
||||||
activity.present()
|
activity.present()
|
||||||
else:
|
else:
|
||||||
|
@ -41,8 +41,10 @@ class MeshGroup(goocanvas.Group):
|
|||||||
self._activities = {}
|
self._activities = {}
|
||||||
|
|
||||||
self._pservice = PresenceService.get_instance()
|
self._pservice = PresenceService.get_instance()
|
||||||
self._pservice.connect("service-appeared", self._service_appeared_cb)
|
self._pservice.connect("service-appeared",
|
||||||
self._pservice.connect('activity-disappeared', self._activity_disappeared_cb)
|
self._service_appeared_cb)
|
||||||
|
self._pservice.connect('activity-disappeared',
|
||||||
|
self._activity_disappeared_cb)
|
||||||
|
|
||||||
for service in self._pservice.get_services():
|
for service in self._pservice.get_services():
|
||||||
self._check_service(service)
|
self._check_service(service)
|
||||||
|
Loading…
Reference in New Issue
Block a user