Merge branch 'master' of git+ssh://marco@dev.laptop.org/git/sugar
Conflicts: NEWS
This commit is contained in:
commit
d577566151
2
NEWS
2
NEWS
@ -1,4 +1,6 @@
|
|||||||
* #4687 Use the right free function, fix a crash. (sjoerd)
|
* #4687 Use the right free function, fix a crash. (sjoerd)
|
||||||
|
* #4724 Display meshbox invite palette menu with colored
|
||||||
|
activity icon (erikos)
|
||||||
* Always checkin to the DS from a new file. (tomeu)
|
* Always checkin to the DS from a new file. (tomeu)
|
||||||
|
|
||||||
Snapshot c682a5e241
|
Snapshot c682a5e241
|
||||||
|
@ -19,7 +19,7 @@ import gtk
|
|||||||
from sugar.graphics.icon import Icon
|
from sugar.graphics.icon import Icon
|
||||||
|
|
||||||
class MenuItem(gtk.ImageMenuItem):
|
class MenuItem(gtk.ImageMenuItem):
|
||||||
def __init__(self, text_label, icon_name=None):
|
def __init__(self, text_label=None, icon_name=None):
|
||||||
gtk.ImageMenuItem.__init__(self, text_label)
|
gtk.ImageMenuItem.__init__(self, text_label)
|
||||||
if icon_name:
|
if icon_name:
|
||||||
icon = Icon(icon_name=icon_name, icon_size=gtk.ICON_SIZE_MENU)
|
icon = Icon(icon_name=icon_name, icon_size=gtk.ICON_SIZE_MENU)
|
||||||
|
@ -22,6 +22,7 @@ import hippo
|
|||||||
|
|
||||||
from sugar.graphics.palette import Palette
|
from sugar.graphics.palette import Palette
|
||||||
from sugar.graphics.menuitem import MenuItem
|
from sugar.graphics.menuitem import MenuItem
|
||||||
|
from sugar.graphics.icon import Icon
|
||||||
from sugar.presence import presenceservice
|
from sugar.presence import presenceservice
|
||||||
|
|
||||||
class BuddyMenu(Palette):
|
class BuddyMenu(Palette):
|
||||||
@ -89,20 +90,33 @@ class BuddyMenu(Palette):
|
|||||||
self.menu.append(menu_item)
|
self.menu.append(menu_item)
|
||||||
menu_item.show()
|
menu_item.show()
|
||||||
|
|
||||||
self._invite_menu = MenuItem(_('Invite'))
|
self._invite_menu = MenuItem('')
|
||||||
self._invite_menu.connect('activate', self._invite_friend_cb)
|
self._invite_menu.connect('activate', self._invite_friend_cb)
|
||||||
self.menu.append(self._invite_menu)
|
self.menu.append(self._invite_menu)
|
||||||
self._invite_menu.show()
|
|
||||||
|
|
||||||
home_model = shell_model.get_home()
|
home_model = shell_model.get_home()
|
||||||
home_model.connect('active-activity-changed',
|
home_model.connect('active-activity-changed',
|
||||||
self._cur_activity_changed_cb)
|
self._cur_activity_changed_cb)
|
||||||
|
activity = home_model.get_active_activity()
|
||||||
def _cur_activity_changed_cb(self, home_model, activity_model):
|
self._update_invite_menu(activity)
|
||||||
if activity_model is not None:
|
|
||||||
self._invite_menu.show()
|
def _update_invite_menu(self, activity):
|
||||||
else:
|
if activity is None:
|
||||||
self._invite_menu.hide()
|
self._invite_menu.hide()
|
||||||
|
else:
|
||||||
|
title = activity.get_title()
|
||||||
|
label = self._invite_menu.get_children()[0]
|
||||||
|
label.set_text(_('Invite to %s') % title)
|
||||||
|
|
||||||
|
icon = Icon(file=activity.get_icon_path())
|
||||||
|
icon.props.xo_color = activity.get_icon_color()
|
||||||
|
self._invite_menu.set_image(icon)
|
||||||
|
icon.show()
|
||||||
|
|
||||||
|
self._invite_menu.show()
|
||||||
|
|
||||||
|
def _cur_activity_changed_cb(self, home_model, activity_model):
|
||||||
|
self._update_invite_menu(activity_model)
|
||||||
|
|
||||||
def _buddy_icon_changed_cb(self, buddy):
|
def _buddy_icon_changed_cb(self, buddy):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user