data,ui: Option to use 'any' network
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Fri, 18 Feb 2011 10:14:42 +0000 (12:14 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Fri, 18 Feb 2011 10:14:42 +0000 (12:14 +0200)
data/rygel-preferences.ui
src/ui/rygel-network-pref-section.vala

index e8d1519..7a2780d 100644 (file)
                           <object class="GtkComboBoxText" id="iface-entry">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <items>
+                              <item translatable="yes">Any</item>
+                            </items>
                           </object>
                           <packing>
                             <property name="expand">True</property>
index 062f1f0..4997f14 100644 (file)
@@ -25,6 +25,7 @@ using GUPnP;
 
 public class Rygel.NetworkPrefSection : PreferencesSection {
     const string IFACE_ENTRY = "iface-entry";
+    const string ANY_NETWORK = "Any";
 
     private ComboBoxText iface_entry;
 
@@ -56,7 +57,13 @@ public class Rygel.NetworkPrefSection : PreferencesSection {
     }
 
     public override void save () {
-        this.config.set_interface (this.iface_entry.get_active_text ());
+        var iface = this.iface_entry.get_active_text ();
+
+        if (iface == ANY_NETWORK) {
+            iface = "";
+        }
+
+        this.config.set_interface (iface);
     }
 
     public override void set_sensitivity (bool sensitivity) {