ui: All widgets must be disabled if sharing is
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 17 Feb 2011 21:03:15 +0000 (23:03 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 17 Feb 2011 23:47:15 +0000 (01:47 +0200)
src/ui/rygel-preferences-dialog.vala

index e5cf50c..11cc589 100644 (file)
@@ -56,6 +56,10 @@ public class Rygel.PreferencesDialog : GLib.Object {
         this.sections.add (new NetworkPrefSection (this.builder, this.config));
         this.sections.add (new MediaExportPrefSection (this.builder,
                                                        this.config));
+
+        // All sections must be disabled if sharing is disabled
+        this.on_upnp_check_button_toggled (this.upnp_check);
+        this.upnp_check.toggled.connect (this.on_upnp_check_button_toggled);
     }
 
     public void run () {
@@ -88,4 +92,10 @@ public class Rygel.PreferencesDialog : GLib.Object {
 
         return 0;
     }
+
+    private void on_upnp_check_button_toggled (ToggleButton upnp_check) {
+        foreach (var section in this.sections) {
+            section.set_sensitivity (upnp_check.active);
+        }
+    }
 }