save plugin state on plugin enable/disable, instead of on shutdown. remembers active plugins in case of a crash
This commit is contained in:
parent
e4ab021d20
commit
0c5c099097
|
@ -4,6 +4,7 @@ Deluge 0.5.7 (xx November 2007)
|
|||
list or wrong type
|
||||
* Local discovery of peers
|
||||
* Add torrent in paused state option
|
||||
* Fix bug where loaded plugins were forgotten if Deluge crashed
|
||||
* Fix ratio bugs (hopefully for the last time)
|
||||
* Scheduler plugin revamp by Ben Klein
|
||||
* Fix ETA from going backwards
|
||||
|
|
|
@ -1662,9 +1662,6 @@ want to remove all seeding torrents?")):
|
|||
self.save_column_widths()
|
||||
self.save_window_settings()
|
||||
self.save_tabs_order()
|
||||
enabled_plugins = ':'.join(self.plugins.get_enabled_plugins())
|
||||
self.config.set('enabled_plugins', enabled_plugins)
|
||||
self.config.save()
|
||||
self.plugins.shutdown_all_plugins()
|
||||
#for the sake of windows, hide tray_icon
|
||||
self.tray_icon.set_visible(False)
|
||||
|
|
|
@ -74,6 +74,9 @@ class PluginManager:
|
|||
def enable_plugin(self, name):
|
||||
plugin = self.available_plugins[name]
|
||||
self.enabled_plugins[name] = plugin.enable(self.core, self.interface)
|
||||
enabled_plugins = ':'.join(self.get_enabled_plugins())
|
||||
self.interface.config.set('enabled_plugins', enabled_plugins)
|
||||
self.interface.config.save()
|
||||
|
||||
def get_enabled_plugins(self):
|
||||
return self.enabled_plugins.keys()
|
||||
|
@ -83,7 +86,10 @@ class PluginManager:
|
|||
if 'unload' in dir(plugin):
|
||||
plugin.unload()
|
||||
del self.enabled_plugins[name]
|
||||
|
||||
enabled_plugins = ':'.join(self.get_enabled_plugins())
|
||||
self.interface.config.set('enabled_plugins', enabled_plugins)
|
||||
self.interface.config.save()
|
||||
|
||||
def configurable_plugin(self, name):
|
||||
if name in self.enabled_plugins:
|
||||
return 'configure' in dir(self.enabled_plugins[name])
|
||||
|
|
Loading…
Reference in New Issue