[rygel/config] Add option to enable/disable plugins



commit 772b91ce2c6f8ccb6ebf51eb0f6c7ca0c483cfcc
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Apr 23 18:06:29 2009 +0300

    Add option to enable/disable plugins
    
    This doesn't really do anything atm.
---
 src/rygel/rygel-config-reader.vala |    5 +++++
 src/ui/rygel-plugin-pref-vbox.vala |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/rygel/rygel-config-reader.vala b/src/rygel/rygel-config-reader.vala
index 81edd2b..4a4e240 100644
--- a/src/rygel/rygel-config-reader.vala
+++ b/src/rygel/rygel-config-reader.vala
@@ -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);
     }
diff --git a/src/ui/rygel-plugin-pref-vbox.vala b/src/ui/rygel-plugin-pref-vbox.vala
index 1a307a5..b3c135e 100644
--- a/src/ui/rygel-plugin-pref-vbox.vala
+++ b/src/ui/rygel-plugin-pref-vbox.vala
@@ -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,



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