open up events to plugins - elpargo
This commit is contained in:
parent
90ac623215
commit
6705e87160
@ -848,7 +848,7 @@ class DelugeGTK:
|
|||||||
|
|
||||||
# Handle the events
|
# Handle the events
|
||||||
try:
|
try:
|
||||||
self.manager.handle_events()
|
events=self.manager.handle_events()
|
||||||
except core.SystemError, e:
|
except core.SystemError, e:
|
||||||
print "SystemError", e
|
print "SystemError", e
|
||||||
dialogs.show_popup_warning(self.window, _("You cannot move torrent to a different partition. Please fix your preferences"))
|
dialogs.show_popup_warning(self.window, _("You cannot move torrent to a different partition. Please fix your preferences"))
|
||||||
@ -863,7 +863,7 @@ class DelugeGTK:
|
|||||||
self.update_statusbar_and_tray()
|
self.update_statusbar_and_tray()
|
||||||
|
|
||||||
#Update any active plugins
|
#Update any active plugins
|
||||||
self.plugins.update_active_plugins()
|
self.plugins.update_active_plugins(events)
|
||||||
|
|
||||||
# Put the generated message into the statusbar
|
# Put the generated message into the statusbar
|
||||||
# This gives plugins a chance to write to the
|
# This gives plugins a chance to write to the
|
||||||
|
|||||||
@ -93,12 +93,15 @@ class PluginManager:
|
|||||||
def configure_plugin(self, name):
|
def configure_plugin(self, name):
|
||||||
self.enabled_plugins[name].configure()
|
self.enabled_plugins[name].configure()
|
||||||
|
|
||||||
def update_active_plugins(self):
|
def update_active_plugins(self,events):
|
||||||
for name in self.enabled_plugins.keys():
|
for name in self.enabled_plugins.keys():
|
||||||
plugin = self.enabled_plugins[name]
|
plugin = self.enabled_plugins[name]
|
||||||
if 'update' in dir(plugin):
|
if 'update' in dir(plugin):
|
||||||
plugin.update()
|
plugin.update()
|
||||||
|
#having two methods for not breaking compatibility
|
||||||
|
if 'notify' in dir(plugin):
|
||||||
|
plugin.notify(events)
|
||||||
|
|
||||||
def shutdown_all_plugins(self):
|
def shutdown_all_plugins(self):
|
||||||
for name in self.enabled_plugins.keys():
|
for name in self.enabled_plugins.keys():
|
||||||
self.disable_plugin(name)
|
self.disable_plugin(name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user