[kupfer] settings: Add a signal for plugin enabled/disabled



commit 28b3dcd3f843218b8ddfbac0ae5a3d749bb3a2b6
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Thu Feb 4 00:41:31 2010 +0100

    settings: Add a signal for plugin enabled/disabled

 kupfer/core/settings.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/core/settings.py b/kupfer/core/settings.py
index 1d8ba68..e65c6e6 100644
--- a/kupfer/core/settings.py
+++ b/kupfer/core/settings.py
@@ -200,8 +200,10 @@ class SettingsController (gobject.GObject, pretty.OutputMixin):
 
 	def set_plugin_enabled(self, plugin_id, enabled):
 		"""Convenience: set if @plugin_id is enabled"""
-		return self.set_plugin_config(plugin_id, "kupfer_enabled", enabled,
+		ret = self.set_plugin_config(plugin_id, "kupfer_enabled", enabled,
 				value_type=strbool)
+		self.emit("plugin-enabled-changed", plugin_id, enabled)
+		return ret
 
 	def get_plugin_is_toplevel(self, plugin_id):
 		"""Convenience: if @plugin_id items are included in toplevel"""
@@ -287,6 +289,11 @@ gobject.signal_new("value-changed", SettingsController, gobject.SIGNAL_RUN_LAST,
 	gobject.TYPE_BOOLEAN, (gobject.TYPE_STRING, gobject.TYPE_STRING,
 		gobject.TYPE_PYOBJECT))
 
+# Plugin ID, Value
+gobject.signal_new("plugin-enabled-changed", SettingsController,
+		gobject.SIGNAL_RUN_LAST, gobject.TYPE_BOOLEAN,
+		(gobject.TYPE_STRING, gobject.TYPE_INT))
+
 _settings_controller = None
 def GetSettingsController():
 	global _settings_controller



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]