Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/view/home
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-01 10:55:10 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-01 10:55:10 (GMT)
commit4aee850af7b3de3dab24aa6cf72a855162e4fddd (patch)
tree8363ae249a4ddebe8d1ddd3e0362d496705139db /shell/view/home
parentaa5d6af260ce93495fd7bb9d19a094106c331e98 (diff)
Replace Menu for Palette.
Diffstat (limited to 'shell/view/home')
-rw-r--r--shell/view/home/FriendView.py4
-rw-r--r--shell/view/home/FriendsBox.py5
-rw-r--r--shell/view/home/HomeBox.py7
-rw-r--r--shell/view/home/HomeWindow.py5
-rw-r--r--shell/view/home/MeshBox.py11
5 files changed, 13 insertions, 19 deletions
diff --git a/shell/view/home/FriendView.py b/shell/view/home/FriendView.py
index 6530957..a899a63 100644
--- a/shell/view/home/FriendView.py
+++ b/shell/view/home/FriendView.py
@@ -25,13 +25,13 @@ from model import bundleregistry
from view.BuddyIcon import BuddyIcon
class FriendView(hippo.CanvasBox):
- def __init__(self, shell, menu_shell, buddy, **kwargs):
+ def __init__(self, shell, buddy, **kwargs):
hippo.CanvasBox.__init__(self, **kwargs)
self._pservice = presenceservice.get_instance()
self._buddy = buddy
- self._buddy_icon = BuddyIcon(shell, menu_shell, buddy)
+ self._buddy_icon = BuddyIcon(shell, buddy)
self._buddy_icon.props.scale = units.LARGE_ICON_SCALE
self.append(self._buddy_icon)
diff --git a/shell/view/home/FriendsBox.py b/shell/view/home/FriendsBox.py
index 80dfd4b..2ce2e3b 100644
--- a/shell/view/home/FriendsBox.py
+++ b/shell/view/home/FriendsBox.py
@@ -26,11 +26,10 @@ from view.home.FriendView import FriendView
class FriendsBox(SpreadBox):
__gtype_name__ = 'SugarFriendsBox'
- def __init__(self, shell, menu_shell):
+ def __init__(self, shell):
SpreadBox.__init__(self, background_color=0xe2e2e2ff)
self._shell = shell
- self._menu_shell = menu_shell
self._friends = {}
self._my_icon = MyIcon(units.LARGE_ICON_SCALE)
@@ -45,7 +44,7 @@ class FriendsBox(SpreadBox):
friends.connect('friend-removed', self._friend_removed_cb)
def add_friend(self, buddy_info):
- icon = FriendView(self._shell, self._menu_shell, buddy_info)
+ icon = FriendView(self._shell, buddy_info)
self.add_item(icon)
self._friends[buddy_info.get_key()] = icon
diff --git a/shell/view/home/HomeBox.py b/shell/view/home/HomeBox.py
index a42ef74..a885445 100644
--- a/shell/view/home/HomeBox.py
+++ b/shell/view/home/HomeBox.py
@@ -124,20 +124,17 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem):
def release(self):
pass
-# TODO: Most or all of it should move to CanvasIcon.
class HomeMyIcon(MyIcon):
- _POPUP_PALETTE_DELAY = 100
def __init__(self, shell, scale):
MyIcon.__init__(self, scale)
self._shell = shell
- self._palette = Palette(profile.get_nick_name())
- self._palette.props.invoker = CanvasInvoker(self)
+ self.set_tooltip(profile.get_nick_name())
shutdown_menu_item = gtk.MenuItem(_('Shutdown'))
shutdown_menu_item.connect('activate', self._shutdown_activate_cb)
- self._palette.append_menu_item(shutdown_menu_item)
+ self.get_palette().append_menu_item(shutdown_menu_item)
shutdown_menu_item.show()
def _shutdown_activate_cb(self, menuitem):
diff --git a/shell/view/home/HomeWindow.py b/shell/view/home/HomeWindow.py
index e1c341d..d8322c6 100644
--- a/shell/view/home/HomeWindow.py
+++ b/shell/view/home/HomeWindow.py
@@ -18,7 +18,6 @@ import gtk
import hippo
import cairo
-from sugar.graphics.menushell import MenuShell
from sugar.graphics import units
import sugar
@@ -54,8 +53,8 @@ class HomeWindow(gtk.Window):
self.connect('focus-out-event', self._focus_out_cb)
self._home_box = HomeBox(shell)
- self._friends_box = FriendsBox(shell, MenuShell(self))
- self._mesh_box = MeshBox(shell, MenuShell(self))
+ self._friends_box = FriendsBox(shell)
+ self._mesh_box = MeshBox(shell)
self._transition_box = TransitionBox()
self._canvas.set_root(self._home_box)
diff --git a/shell/view/home/MeshBox.py b/shell/view/home/MeshBox.py
index 0d2b106..46cb024 100644
--- a/shell/view/home/MeshBox.py
+++ b/shell/view/home/MeshBox.py
@@ -163,7 +163,7 @@ class MeshDeviceView(PulsingIcon):
]
class ActivityView(SnowflakeBox):
- def __init__(self, shell, menu_shell, model):
+ def __init__(self, shell, model):
SnowflakeBox.__init__(self)
self._shell = shell
@@ -197,11 +197,10 @@ class ActivityView(SnowflakeBox):
self._shell.join_activity(bundle_id, self._model.get_id())
class MeshBox(SpreadBox):
- def __init__(self, shell, menu_shell):
+ def __init__(self, shell):
SpreadBox.__init__(self, background_color=0xe2e2e2ff)
self._shell = shell
- self._menu_shell = menu_shell
self._model = shell.get_model().get_mesh()
self._buddies = {}
self._activities = {}
@@ -281,7 +280,7 @@ class MeshBox(SpreadBox):
self._mesh = None
def _add_alone_buddy(self, buddy_model):
- icon = BuddyIcon(self._shell, self._menu_shell, buddy_model)
+ icon = BuddyIcon(self._shell, buddy_model)
if buddy_model.is_owner():
self.set_center_item(icon)
else:
@@ -313,11 +312,11 @@ class MeshBox(SpreadBox):
else:
activity = self._activities[activity_model.get_id()]
- icon = BuddyIcon(self._shell, self._menu_shell, buddy_model)
+ icon = BuddyIcon(self._shell, buddy_model)
activity.add_buddy_icon(buddy_model.get_key(), icon)
def _add_activity(self, activity_model):
- icon = ActivityView(self._shell, self._menu_shell, activity_model)
+ icon = ActivityView(self._shell, activity_model)
self.add_item(icon)
self._activities[activity_model.get_id()] = icon