[gnome-control-center] network: Add firewall zone support for wifi



commit 7de70b9821b0c3506b38f4e5babb142f25f29430
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Mar 2 19:36:19 2013 -0500

    network: Add firewall zone support for wifi
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694577

 panels/network/connection-editor/ce-page-wifi.c |   10 ++++
 panels/network/connection-editor/wifi-page.ui   |   54 +++++++++++++++-------
 2 files changed, 47 insertions(+), 17 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page-wifi.c b/panels/network/connection-editor/ce-page-wifi.c
index cb90ef2..6a19832 100644
--- a/panels/network/connection-editor/ce-page-wifi.c
+++ b/panels/network/connection-editor/ce-page-wifi.c
@@ -30,6 +30,7 @@
 
 #include <net/if_arp.h>
 
+#include "firewall-helpers.h"
 #include "ce-page-wifi.h"
 
 G_DEFINE_TYPE (CEPageWifi, ce_page_wifi, CE_TYPE_PAGE)
@@ -124,6 +125,10 @@ connect_wifi_page (CEPageWifi *page)
 
         g_signal_connect (widget, "toggled",
                           G_CALLBACK (all_user_changed), page);
+
+        widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "combo_zone"));
+        firewall_ui_setup (sc, widget, CE_PAGE (page)->cancellable);
+        g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
 }
 
 static void
@@ -135,6 +140,7 @@ ui_to_setting (CEPageWifi *page)
         GByteArray *cloned_mac = NULL;
         GtkWidget *entry;
         const gchar *utf8_ssid;
+        NMSettingConnection *sc;
 
         entry = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "entry_ssid"));
         utf8_ssid = gtk_entry_get_text (GTK_ENTRY (entry));
@@ -151,6 +157,10 @@ ui_to_setting (CEPageWifi *page)
         entry = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "entry_cloned_mac"));
         cloned_mac = ce_page_entry_to_mac (GTK_ENTRY (entry), ARPHRD_ETHER, NULL);
 
+        sc = nm_connection_get_setting_connection (CE_PAGE (page)->connection);
+        entry = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "combo_zone"));
+        firewall_ui_to_setting (sc, entry);
+
         g_object_set (page->setting,
                       NM_SETTING_WIRELESS_SSID, ssid,
                       NM_SETTING_WIRELESS_BSSID, bssid,
diff --git a/panels/network/connection-editor/wifi-page.ui b/panels/network/connection-editor/wifi-page.ui
index 8e99d15..1b35f0c 100644
--- a/panels/network/connection-editor/wifi-page.ui
+++ b/panels/network/connection-editor/wifi-page.ui
@@ -113,11 +113,6 @@
         <property name="has_entry">True</property>
         <property name="entry_text_column">0</property>
         <property name="id_column">1</property>
-        <child internal-child="entry">
-          <object class="GtkEntry" id="comboboxtext-entry2">
-            <property name="can_focus">False</property>
-          </object>
-        </child>
       </object>
       <packing>
         <property name="left_attach">1</property>
@@ -133,11 +128,6 @@
         <property name="has_entry">True</property>
         <property name="entry_text_column">0</property>
         <property name="id_column">1</property>
-        <child internal-child="entry">
-          <object class="GtkEntry" id="comboboxtext-entry4">
-            <property name="can_focus">False</property>
-          </object>
-        </child>
       </object>
       <packing>
         <property name="left_attach">1</property>
@@ -147,30 +137,30 @@
       </packing>
     </child>
     <child>
-      <object class="GtkCheckButton" id="auto_connect_check">
-        <property name="label" translatable="yes">Connect _automatically</property>
+      <object class="GtkCheckButton" id="all_user_check">
+        <property name="label" translatable="yes">Make available to _other users</property>
         <property name="visible">True</property>
         <property name="can_focus">True</property>
         <property name="receives_default">False</property>
-        <property name="valign">end</property>
-        <property name="vexpand">True</property>
         <property name="use_underline">True</property>
         <property name="xalign">0</property>
         <property name="draw_indicator">True</property>
       </object>
       <packing>
         <property name="left_attach">0</property>
-        <property name="top_attach">4</property>
+        <property name="top_attach">6</property>
         <property name="width">2</property>
         <property name="height">1</property>
       </packing>
     </child>
     <child>
-      <object class="GtkCheckButton" id="all_user_check">
-        <property name="label" translatable="yes">Make available to _other users</property>
+      <object class="GtkCheckButton" id="auto_connect_check">
+        <property name="label" translatable="yes">Connect _automatically</property>
         <property name="visible">True</property>
         <property name="can_focus">True</property>
         <property name="receives_default">False</property>
+        <property name="valign">end</property>
+        <property name="vexpand">True</property>
         <property name="use_underline">True</property>
         <property name="xalign">0</property>
         <property name="draw_indicator">True</property>
@@ -182,5 +172,35 @@
         <property name="height">1</property>
       </packing>
     </child>
+    <child>
+      <object class="GtkLabel" id="heading_zone">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="xalign">1</property>
+        <property name="label" translatable="yes">Firewall _Zone</property>
+        <property name="use_underline">True</property>
+        <property name="mnemonic_widget">combo_zone</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">4</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkComboBoxText" id="combo_zone">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="entry_text_column">0</property>
+        <property name="id_column">1</property>
+      </object>
+      <packing>
+        <property name="left_attach">1</property>
+        <property name="top_attach">4</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
   </object>
 </interface>


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