|
|
|
@ -17,15 +17,30 @@
|
|
|
|
|
import hippo
|
|
|
|
|
|
|
|
|
|
from sugar.graphics.canvasicon import CanvasIcon
|
|
|
|
|
from sugar.graphics import color
|
|
|
|
|
from sugar.presence import PresenceService
|
|
|
|
|
from view.BuddyIcon import BuddyIcon
|
|
|
|
|
from model.BuddyModel import BuddyModel
|
|
|
|
|
|
|
|
|
|
class FriendIcon(BuddyIcon):
|
|
|
|
|
def __init__(self, shell, popup_context, buddy):
|
|
|
|
|
BuddyIcon.__init__(self, shell, popup_context, buddy)
|
|
|
|
|
self._popup_context = popup_context
|
|
|
|
|
|
|
|
|
|
def get_popup_context(self):
|
|
|
|
|
return self._popup_context
|
|
|
|
|
|
|
|
|
|
def prelight(self, enter):
|
|
|
|
|
if enter:
|
|
|
|
|
self.props.background_color = color.BLACK.get_int()
|
|
|
|
|
else:
|
|
|
|
|
self.props.background_color = color.TOOLBAR_BACKGROUND.get_int()
|
|
|
|
|
|
|
|
|
|
class FriendsBox(hippo.CanvasBox):
|
|
|
|
|
def __init__(self, shell, menu_shell):
|
|
|
|
|
def __init__(self, shell, popup_context):
|
|
|
|
|
hippo.CanvasBox.__init__(self)
|
|
|
|
|
self._shell = shell
|
|
|
|
|
self._menu_shell = menu_shell
|
|
|
|
|
self._popup_context = popup_context
|
|
|
|
|
self._activity_ps = None
|
|
|
|
|
self._joined_hid = -1
|
|
|
|
|
self._left_hid = -1
|
|
|
|
@ -48,7 +63,7 @@ class FriendsBox(hippo.CanvasBox):
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
model = BuddyModel(buddy=buddy)
|
|
|
|
|
icon = BuddyIcon(self._shell, self._menu_shell, model)
|
|
|
|
|
icon = FriendIcon(self._shell, self._popup_context, model)
|
|
|
|
|
self.append(icon)
|
|
|
|
|
|
|
|
|
|
self._buddies[buddy.get_name()] = icon
|
|
|
|
|