Fix #1009 enabling a plugin twice in the gtkui

Prevent plugins from being enabled more than once in pluginmanagerbase
This commit is contained in:
Andrew Resch 2009-09-05 19:32:01 +00:00
parent d1c6e551a9
commit b849a4b451
2 changed files with 4 additions and 1 deletions

View File

@ -122,6 +122,10 @@ class PluginManagerBase:
log.warning("Cannot enable non-existant plugin %s", plugin_name) log.warning("Cannot enable non-existant plugin %s", plugin_name)
return return
if plugin_name in self.plugins:
log.warning("Cannot enable already enabled plugin %s", plugin_name)
return
plugin_name = plugin_name.replace(" ", "-") plugin_name = plugin_name.replace(" ", "-")
egg = self.pkg_env[plugin_name][0] egg = self.pkg_env[plugin_name][0]
egg.activate() egg.activate()

View File

@ -882,7 +882,6 @@ class Preferences(component.Component):
self.plugin_liststore.set_value(row, 1, not value) self.plugin_liststore.set_value(row, 1, not value)
if not value: if not value:
client.core.enable_plugin(name) client.core.enable_plugin(name)
component.get("PluginManager").enable_plugin(name)
else: else:
client.core.disable_plugin(name) client.core.disable_plugin(name)
component.get("PluginManager").disable_plugin(name) component.get("PluginManager").disable_plugin(name)