3
from gettext import gettext as _
5
from gourmet.plugin import ToolPlugin
7
class ConverterPlugin (ToolPlugin):
8
menu_items = '''<placeholder name="StandaloneTool">
9
<menuitem action="UnitConverter"/>
12
def setup_action_groups (self):
13
self.action_group = gtk.ActionGroup('ConverterPluginActionGroup')
14
self.action_group.add_actions([
15
('UnitConverter',None,_('_Unit Converter'),
16
None,_('Calculate unit conversions'),self.show_unit_converter)
19
self.action_groups.append(self.action_group)
21
def show_unit_converter (self, *args):
23
umodel = self.pluggable.umodel
24
except AttributeError:
26
umodel = self.pluggable.rg.umodel
29
convertGui.ConvGui(unitModel=umodel)
31
plugins = [ConverterPlugin]