diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2012-04-30 02:43:18 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2012-04-30 02:43:18 +0400 |
commit | 3fe07c9a1428af39841afd46f428a6884cbffb97 (patch) | |
tree | cc821ef083b14c6f4053255873616ffbf220d392 | |
parent | 08fabfe02e0283cbc7c9bc129b3ee3d59ce7667b (diff) |
ability for plugins to be activatable. True by default, but plugin can be non-activatable is a dep is missing for example.
-rw-r--r-- | src/plugins/gui.py | 13 | ||||
-rw-r--r-- | src/plugins/plugin.py | 1 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/gui.py b/src/plugins/gui.py index 8263ad74c..9ff3259b5 100644 --- a/src/plugins/gui.py +++ b/src/plugins/gui.py @@ -60,7 +60,7 @@ class PluginsWindow(object): self.plugin_name_label.set_attributes(attr_list) 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_rules_hint(True) @@ -69,9 +69,8 @@ class PluginsWindow(object): self.installed_plugins_treeview.append_column(col) renderer = gtk.CellRendererToggle() - renderer.set_property('activatable', True) 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) # connect signal for selection change @@ -146,7 +145,7 @@ class PluginsWindow(object): for plugin in pm.plugins: self.installed_plugins_model.append([plugin, plugin.name, - plugin.active]) + plugin.active, plugin.activatable]) @log_calls('PluginsWindow') def installed_plugins_toggled_cb(self, cell, path): @@ -230,7 +229,8 @@ class PluginsWindow(object): model.remove(model.get_iter((row, 0))) 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.select_iter(iter_) @@ -252,7 +252,8 @@ class PluginsWindow(object): show_warn_dialog() return 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.select_iter(iter_) diff --git a/src/plugins/plugin.py b/src/plugins/plugin.py index 8c5856c07..728280bd4 100644 --- a/src/plugins/plugin.py +++ b/src/plugins/plugin.py @@ -154,6 +154,7 @@ class GajimPlugin(object): :type: `plugins.plugin.GajimPluginConfig` ''' + self.activatable = True self.load_config() self.config_dialog = GajimPluginConfigDialog(self) self.init() |