Start implementing invites...
This commit is contained in:
@@ -18,9 +18,10 @@ class FriendsGroup(goocanvas.Group):
|
||||
WIDTH = 1200.0 * 1.9
|
||||
HEIGHT = 900.0 * 1.9
|
||||
|
||||
def __init__(self, friends, icon_layout):
|
||||
def __init__(self, shell, friends, icon_layout):
|
||||
goocanvas.Group.__init__(self)
|
||||
|
||||
self._shell = shell
|
||||
self._icon_layout = icon_layout
|
||||
self._friends = friends
|
||||
|
||||
@@ -43,8 +44,15 @@ class FriendsGroup(goocanvas.Group):
|
||||
color = self._theme.get_home_friends_color()
|
||||
self._friends_rect.set_property("fill-color", color)
|
||||
|
||||
def __friend_clicked_cb(self, icon):
|
||||
activity = self._shell.get_current_activity()
|
||||
buddy = icon.get_friend().get_buddy()
|
||||
if buddy != None:
|
||||
activity.invite(buddy)
|
||||
|
||||
def add_friend(self, friend):
|
||||
icon = FriendIcon(friend)
|
||||
icon.connect('clicked', self.__friend_clicked_cb)
|
||||
self.add_child(icon)
|
||||
self._icon_layout.add_icon(icon)
|
||||
|
||||
|
||||
@@ -48,7 +48,8 @@ class HomeWindow(gtk.Window):
|
||||
y2 = y1 + HomeGroup.HEIGHT
|
||||
icon_layout.set_bounds(x1, y1, x2, y2)
|
||||
|
||||
self._friends_group = FriendsGroup(owner.get_friends(), icon_layout)
|
||||
self._friends_group = FriendsGroup(self._shell, owner.get_friends(),
|
||||
icon_layout)
|
||||
self._friends_group.translate((self._width - FriendsGroup.WIDTH) / 2,
|
||||
(self._height - FriendsGroup.HEIGHT) / 2)
|
||||
root.add_child(self._friends_group)
|
||||
|
||||
Reference in New Issue
Block a user