33
ROW_ENABLED, # True if the module is currently enabled
34
ROW_TEXT, # Name and description of the module
35
ROW_ICON, # An icon indicating whether the module is configurable
36
ROW_UNLOADABLE, # True if the module can be disabled
37
ROW_INSTANCE, # Instance of the module, if any
38
ROW_MODINFO # Information exported by a module
33
ROW_ENABLED, # True if the module is currently enabled
34
ROW_TEXT, # Name and description of the module
35
ROW_ICON, # An icon indicating whether the module is configurable
36
ROW_UNLOADABLE, # True if the module can be disabled
37
ROW_INSTANCE, # Instance of the module, if any
38
ROW_MODINFO # Information exported by a module
109
110
# List of modules
110
111
toggleRdr = Gtk.CellRendererToggle()
112
('', [(toggleRdr, GObject.TYPE_BOOLEAN)], ROW_ENABLED, False, True),
113
('', [(Gtk.CellRendererText(), GObject.TYPE_STRING)], ROW_TEXT, True, True),
114
('', [(Gtk.CellRendererPixbuf(), GdkPixbuf.Pixbuf)], ROW_ICON, False, True),
115
(None, [(None, GObject.TYPE_BOOLEAN)], ROW_UNLOADABLE, False, False),
116
(None, [(None, GObject.TYPE_PYOBJECT)], ROW_INSTANCE, False, False),
117
(None, [(None, GObject.TYPE_PYOBJECT)], ROW_MODINFO, False, False))
113
('', [(toggleRdr, GObject.TYPE_BOOLEAN)], ROW_ENABLED, False, True),
114
('', [(Gtk.CellRendererText(), GObject.TYPE_STRING)], ROW_TEXT, True, True),
115
('', [(Gtk.CellRendererPixbuf(), GdkPixbuf.Pixbuf)], ROW_ICON, False, True),
116
(None, [(None, GObject.TYPE_BOOLEAN)], ROW_UNLOADABLE, False, False),
117
(None, [(None, GObject.TYPE_PYOBJECT)], ROW_INSTANCE, False, False),
118
(None, [(None, GObject.TYPE_PYOBJECT)], ROW_MODINFO, False, False))
119
120
self.list = PreferencesListView(columns)
120
121
self.list.set_headers_visible(False)
144
145
""" Fill the list of modules """
146
147
for (name, data) in modules.getModules():
147
instance = data[modules.MOD_INSTANCE]
148
mandatory = data[modules.MOD_INFO][modules.MODINFO_MANDATORY]
148
instance = data[modules.MOD_INSTANCE]
149
mandatory = data[modules.MOD_INFO][modules.MODINFO_MANDATORY]
149
150
configurable = data[modules.MOD_INFO][modules.MODINFO_CONFIGURABLE]
151
152
if configurable or not mandatory:
153
154
icon = icons.prefsBtnIcon()
156
text = '<b>%s</b>\n<small>%s</small>' % (tools.htmlEscape(_(name)), tools.htmlEscape(data[modules.MOD_INFO][modules.MODINFO_DESC]))
157
text = '<b>%s</b>\n<small>%s</small>' % (
158
tools.htmlEscape(_(name)),
159
tools.htmlEscape(data[modules.MOD_INFO][modules.MODINFO_DESC]))
157
160
rows.append((instance is not None, text, icon, not mandatory, instance, data[modules.MOD_INFO]))
159
162
rows.sort(key=lambda row: row[ROW_TEXT])