ui: PreferencesSection provide API to set sensitivity
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 17 Feb 2011 16:30:02 +0000 (18:30 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 17 Feb 2011 23:47:15 +0000 (01:47 +0200)
src/ui/rygel-media-export-pref-section.vala
src/ui/rygel-network-pref-section.vala
src/ui/rygel-preferences-section.vala

index 0df55a4..b6531db 100644 (file)
@@ -102,6 +102,12 @@ public class Rygel.MediaExportPrefSection : PreferencesSection {
         this.config.set_string_list (this.name, URIS_KEY, uri_list);
     }
 
+    public override void set_sensitivity (bool sensitivity) {
+        foreach (var widget in this.widgets) {
+            widget.sensitive = sensitivity;
+        }
+    }
+
     private void on_add_button_clicked (Button button) {
         if (this.dialog.run () == ResponseType.OK) {
             TreeIter iter;
index 94ad487..062f1f0 100644 (file)
@@ -59,6 +59,10 @@ public class Rygel.NetworkPrefSection : PreferencesSection {
         this.config.set_interface (this.iface_entry.get_active_text ());
     }
 
+    public override void set_sensitivity (bool sensitivity) {
+        iface_entry.sensitive = sensitivity;
+    }
+
     private void on_context_available (GUPnP.ContextManager manager,
                                        GUPnP.Context        context) {
         TreeIter iter;
index e42214a..4b92195 100644 (file)
@@ -34,4 +34,5 @@ public abstract class Rygel.PreferencesSection : GLib.Object {
     }
 
     public abstract void save ();
+    public abstract void set_sensitivity (bool sensitivity);
 }