Add option to enable/disable plugins
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 23 Apr 2009 15:06:29 +0000 (18:06 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 23 Apr 2009 15:06:29 +0000 (18:06 +0300)
This doesn't really do anything atm.

src/rygel/rygel-config-reader.vala
src/ui/rygel-plugin-pref-vbox.vala

index 81edd2b..4a4e240 100644 (file)
@@ -33,6 +33,7 @@ public class Rygel.ConfigReader {
     protected static const string IP_KEY = "host-ip";
     protected static const string PORT_KEY = "port";
     protected static const string XBOX_KEY = "enable-xbox";
+    protected static const string ENABLED_KEY = "enabled";
     protected static const string TITLE_KEY = "title";
     protected static const string UDN_KEY = "UDN";
 
@@ -54,6 +55,10 @@ public class Rygel.ConfigReader {
                                   0);
     }
 
+    public bool get_enabled (string section) {
+        return this.get_bool (section, ENABLED_KEY, true);
+    }
+
     public string get_title (string section) {
         return this.get_string (section, TITLE_KEY, section);
     }
index 1a307a5..b3c135e 100644 (file)
@@ -27,9 +27,15 @@ public class Rygel.PluginPrefVBox : PreferencesVBox {
                            string       section) {
         base (config_editor, section, section);
 
+        var enabled = config_editor.get_enabled (section);
         var title = config_editor.get_title (section);
         var udn = config_editor.get_udn (section);
 
+        this.add_boolean_pref (ConfigReader.ENABLED_KEY,
+                               "Enabled",
+                               enabled,
+                               "Enable/Disable this plugin");
+
         this.add_string_pref (ConfigReader.TITLE_KEY,
                               "Title",
                               title,