#4624 NORM Update.: MeshBox invite menuitem not working correctly

Zarro Boogs per Child bugtracker at laptop.org
Sat Nov 3 18:58:38 EDT 2007


#4624: MeshBox invite menuitem not working correctly
---------------------+------------------------------------------------------
  Reporter:  erikos  |       Owner:  marco             
      Type:  defect  |      Status:  new               
  Priority:  normal  |   Milestone:  Update.2          
 Component:  sugar   |     Version:                    
Resolution:          |    Keywords:  Update.1?, review+
  Verified:  0       |  
---------------------+------------------------------------------------------
Changes (by marco):

  * keywords:  Update.1?, review? => Update.1?, review+


Comment:

 {{{
 self._invite_menu = MenuItem('')
 }}}

 Please change sugar.graphics.MenuItem to default to None for the label so
 that we can just do MenuItem() here.

 {{{
 self._set_invite_menu(home_model)
 }}}

 Rename the method to _update_invite_menu

 {{{
 +    def _set_invite_menu(self, home_model):
 +        home_activity = home_model.get_active_activity()
 +        if home_activity is None:
 +                return
 }}}

 We should hide the menu if there is no active activity.

 {{{
 +        title = home_activity.get_title()
 +        self._invite_menu.children()[0].set_text(_('Invite to %s')%title)
 }}}

 Man that sucks, but it seem like the only way (bad gtk!). Please assign
 self._invite_menu.children()[0] to a label variable, that will make it
 less confusing. Also it should be ") % title)" (sorry! :))

 {{{
      def _cur_activity_changed_cb(self, home_model, activity_model):
          if activity_model is not None:
 -            self._invite_menu.show()
 +            self._set_invite_menu(home_model)
          else:
              self._invite_menu.hide()
 }}}

 If you make _update_invite_menu hide the menu when necessary, it looks
 like you could just make _cur_activity_changed_cb call that method.

 review+ with these changes.

-- 
Ticket URL: <http://dev.laptop.org/ticket/4624#comment:3>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list