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

don't load unactivatable plugins

parent 3fe07c9a
No related branches found
No related tags found
No related merge requests found
......@@ -114,10 +114,13 @@ class PluginsWindow(object):
desc_textbuffer = self.plugin_description_textview.get_buffer()
from plugins.plugins_i18n import _
desc_textbuffer.set_text(_(plugin.description))
txt = plugin.description
if plugin.available_text:
txt += '\n\n' + _('Warning: %s') % plugin.available_text
desc_textbuffer.set_text(txt)
self.plugin_description_textview.set_property('sensitive', True)
self.uninstall_plugin_button.set_property('sensitive',
gajim.PLUGINS_DIRS[1] in plugin.__path__)
gajim.PLUGINS_DIRS[1] in plugin.__path__)
if plugin.config_dialog is None:
self.configure_plugin_button.set_property('sensitive', False)
else:
......@@ -145,7 +148,7 @@ class PluginsWindow(object):
for plugin in pm.plugins:
self.installed_plugins_model.append([plugin, plugin.name,
plugin.active, plugin.activatable])
plugin.active and plugin.activatable, plugin.activatable])
@log_calls('PluginsWindow')
def installed_plugins_toggled_cb(self, cell, path):
......
......@@ -155,6 +155,7 @@ class GajimPlugin(object):
:type: `plugins.plugin.GajimPluginConfig`
'''
self.activatable = True
self.available_text = ''
self.load_config()
self.config_dialog = GajimPluginConfigDialog(self)
self.init()
......
......@@ -292,7 +292,7 @@ class PluginManager(object):
:param plugin: plugin to be activated
:type plugin: class object of `GajimPlugin` subclass
'''
if not plugin.active:
if not plugin.active and plugin.activatable:
self._add_gui_extension_points_handlers_from_plugin(plugin)
self._handle_all_gui_extension_points_with_plugin(plugin)
......@@ -374,7 +374,8 @@ class PluginManager(object):
def _activate_all_plugins_from_global_config(self):
for plugin in self.plugins:
if self._plugin_is_active_in_global_config(plugin):
if self._plugin_is_active_in_global_config(plugin) and \
plugin.activatable:
try:
self.activate_plugin(plugin)
except GajimPluginActivateException:
......
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