More refactoring. Start implementing friends.

This commit is contained in:
Marco Pesenti Gritti
2006-08-30 11:46:14 +02:00
parent 028d22cdd7
commit 6865148c90
6 changed files with 33 additions and 8 deletions
+2 -2
View File
@@ -18,11 +18,11 @@ class FriendsGroup(goocanvas.Group):
WIDTH = 1200.0 * 1.9
HEIGHT = 900.0 * 1.9
def __init__(self, icon_layout):
def __init__(self, friends, icon_layout):
goocanvas.Group.__init__(self)
self._friend_to_child = {}
self._icon_layout = icon_layout
self._friends = friends
self._theme = Theme.get_instance()
self._theme.connect("theme-changed", self.__theme_changed_cb)
+3 -3
View File
@@ -28,7 +28,7 @@ class HomeWindow(gtk.Window):
self.realize()
self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DESKTOP)
def set_presence_service(self, pservice):
def set_owner(self, owner):
root = self._view.get_model().get_root_item()
icon_layout = IconLayout(MeshGroup.WIDTH, MeshGroup.HEIGHT)
@@ -38,7 +38,7 @@ class HomeWindow(gtk.Window):
y2 = y1 + FriendsGroup.HEIGHT
icon_layout.set_bounds(x1, y1, x2, y2)
self._mesh_group = MeshGroup(self._shell, icon_layout, pservice)
self._mesh_group = MeshGroup(self._shell, owner, icon_layout)
root.add_child(self._mesh_group)
icon_layout = IconLayout(FriendsGroup.WIDTH, FriendsGroup.HEIGHT)
@@ -48,7 +48,7 @@ class HomeWindow(gtk.Window):
y2 = y1 + HomeGroup.HEIGHT
icon_layout.set_bounds(x1, y1, x2, y2)
self._friends_group = FriendsGroup(icon_layout)
self._friends_group = FriendsGroup(owner, icon_layout)
self._friends_group.translate((self._width - FriendsGroup.WIDTH) / 2,
(self._height - FriendsGroup.HEIGHT) / 2)
root.add_child(self._friends_group)
+2 -1
View File
@@ -34,7 +34,7 @@ class MeshGroup(goocanvas.Group):
WIDTH = 1200.0 * 3.5
HEIGHT = 900.0 * 3.5
def __init__(self, shell, icon_layout, pservice):
def __init__(self, shell, owner, icon_layout):
goocanvas.Group.__init__(self)
self._shell = shell
self._icon_layout = icon_layout
@@ -48,6 +48,7 @@ class MeshGroup(goocanvas.Group):
fill_color=color)
self.add_child(self._mesh_rect)
pservice = PresenceService.get_instance()
pservice.connect("service-appeared", self.__service_appeared_cb)
for service in pservice.get_services():