Skip to content
Snippets Groups Projects
Commit f454e89b authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

ability for plugins to be activatable. True by default, but plugin can be...

ability for plugins to be activatable. True by default, but plugin can be non-activatable is a dep is missing for example.
parent b7593583
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ class PluginsWindow(object): ...@@ -60,7 +60,7 @@ class PluginsWindow(object):
self.plugin_name_label.set_attributes(attr_list) self.plugin_name_label.set_attributes(attr_list)
self.installed_plugins_model = gtk.ListStore(gobject.TYPE_PYOBJECT, self.installed_plugins_model = gtk.ListStore(gobject.TYPE_PYOBJECT,
gobject.TYPE_STRING, gobject.TYPE_BOOLEAN) gobject.TYPE_STRING, gobject.TYPE_BOOLEAN, gobject.TYPE_BOOLEAN)
self.installed_plugins_treeview.set_model(self.installed_plugins_model) self.installed_plugins_treeview.set_model(self.installed_plugins_model)
self.installed_plugins_treeview.set_rules_hint(True) self.installed_plugins_treeview.set_rules_hint(True)
...@@ -69,9 +69,8 @@ class PluginsWindow(object): ...@@ -69,9 +69,8 @@ class PluginsWindow(object):
self.installed_plugins_treeview.append_column(col) self.installed_plugins_treeview.append_column(col)
renderer = gtk.CellRendererToggle() renderer = gtk.CellRendererToggle()
renderer.set_property('activatable', True)
renderer.connect('toggled', self.installed_plugins_toggled_cb) renderer.connect('toggled', self.installed_plugins_toggled_cb)
col = gtk.TreeViewColumn(_('Active'), renderer, active=2) col = gtk.TreeViewColumn(_('Active'), renderer, active=2, activatable=3)
self.installed_plugins_treeview.append_column(col) self.installed_plugins_treeview.append_column(col)
# connect signal for selection change # connect signal for selection change
...@@ -146,7 +145,7 @@ class PluginsWindow(object): ...@@ -146,7 +145,7 @@ class PluginsWindow(object):
for plugin in pm.plugins: for plugin in pm.plugins:
self.installed_plugins_model.append([plugin, plugin.name, self.installed_plugins_model.append([plugin, plugin.name,
plugin.active]) plugin.active, plugin.activatable])
@log_calls('PluginsWindow') @log_calls('PluginsWindow')
def installed_plugins_toggled_cb(self, cell, path): def installed_plugins_toggled_cb(self, cell, path):
...@@ -230,7 +229,8 @@ class PluginsWindow(object): ...@@ -230,7 +229,8 @@ class PluginsWindow(object):
model.remove(model.get_iter((row, 0))) model.remove(model.get_iter((row, 0)))
break break
iter_ = model.append([plugin, plugin.name, False]) iter_ = model.append([plugin, plugin.name, False,
plugin.activatable])
sel = self.installed_plugins_treeview.get_selection() sel = self.installed_plugins_treeview.get_selection()
sel.select_iter(iter_) sel.select_iter(iter_)
...@@ -252,7 +252,8 @@ class PluginsWindow(object): ...@@ -252,7 +252,8 @@ class PluginsWindow(object):
show_warn_dialog() show_warn_dialog()
return return
model = self.installed_plugins_model model = self.installed_plugins_model
iter_ = model.append([plugin, plugin.name, False]) iter_ = model.append([plugin, plugin.name, False,
plugin.activatable])
sel = self.installed_plugins_treeview.get_selection() sel = self.installed_plugins_treeview.get_selection()
sel.select_iter(iter_) sel.select_iter(iter_)
......
...@@ -154,6 +154,7 @@ class GajimPlugin(object): ...@@ -154,6 +154,7 @@ class GajimPlugin(object):
:type: `plugins.plugin.GajimPluginConfig` :type: `plugins.plugin.GajimPluginConfig`
''' '''
self.activatable = True
self.load_config() self.load_config()
self.config_dialog = GajimPluginConfigDialog(self) self.config_dialog = GajimPluginConfigDialog(self)
self.init() self.init()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment