don't load unactivatable plugins
This commit is contained in:
		
							parent
							
								
									3fe07c9a14
								
							
						
					
					
						commit
						971e0502c0
					
				
					 3 changed files with 10 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -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:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue