~bryce/gtg/notebook

« back to all changes in this revision

Viewing changes to GTG/core/plugins/api.py

  • Committer: Luca Invernizzi
  • Date: 2010-02-16 01:39:41 UTC
  • Revision ID: invernizzi.l@gmail.com-20100216013941-js59iwnp4dfci8kl
Plugin menu is back (only if  a plugin requests its services)

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
        """
133
133
        widget = self.__builder.get_object('menu_plugin')
134
134
        if widget:
 
135
            widget.show_all()
135
136
            widget.get_submenu().append(item)
136
137
        item.show()
137
138
         
146
147
        try:
147
148
            wi = self.__builder.get_object('menu_plugin')
148
149
            if wi:
149
 
                wi.get_submenu().remove(item)
 
150
                menu = wi.get_submenu()
 
151
                menu.remove(item)
 
152
                if len(menu.get_children()) == 0:
 
153
                    wi.hide()
150
154
            return True
151
155
        except Exception, e:
152
156
            print "Error removing menu item: %s" % e