[gnome-control-center] network: Add firewall zone support for wired
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Add firewall zone support for wired
- Date: Tue, 5 Mar 2013 02:46:03 +0000 (UTC)
commit e183775af7509000b4bafce7c00d90378eed9dc0
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Mar 2 19:36:39 2013 -0500
network: Add firewall zone support for wired
https://bugzilla.gnome.org/show_bug.cgi?id=694577
.../network/connection-editor/ce-page-ethernet.c | 10 ++
panels/network/connection-editor/ethernet-page.ui | 107 ++++++++++++-------
2 files changed, 77 insertions(+), 40 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page-ethernet.c
b/panels/network/connection-editor/ce-page-ethernet.c
index 9d8a90a..b4ebe17 100644
--- a/panels/network/connection-editor/ce-page-ethernet.c
+++ b/panels/network/connection-editor/ce-page-ethernet.c
@@ -29,6 +29,7 @@
#include <net/if_arp.h>
+#include "firewall-helpers.h"
#include "ce-page-ethernet.h"
G_DEFINE_TYPE (CEPageEthernet, ce_page_ethernet, CE_TYPE_PAGE)
@@ -111,6 +112,11 @@ connect_ethernet_page (CEPageEthernet *page)
nm_setting_connection_get_num_permissions (sc) == 0);
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
@@ -139,6 +145,10 @@ ui_to_setting (CEPageEthernet *page)
g_object_set (page->setting_connection,
NM_SETTING_CONNECTION_ID, gtk_entry_get_text (page->name),
NULL);
+
+ entry = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "combo_zone"));
+ firewall_ui_to_setting (page->setting_connection, entry);
+
}
static gboolean
diff --git a/panels/network/connection-editor/ethernet-page.ui
b/panels/network/connection-editor/ethernet-page.ui
index 0ed0824..faed57d 100644
--- a/panels/network/connection-editor/ethernet-page.ui
+++ b/panels/network/connection-editor/ethernet-page.ui
@@ -115,12 +115,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-entry">
- <property name="can_focus">False</property>
- <property name="invisible_char">●</property>
- </object>
- </child>
</object>
<packing>
<property name="left_attach">1</property>
@@ -178,66 +172,78 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="auto_connect_check">
- <property name="label" translatable="yes">Connect _automatically</property>
+ <object class="GtkLabel" id="label_mtu">
<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>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">bytes</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
- <property name="width">2</property>
+ <property name="left_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</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="GtkSpinButton" id="spin_mtu">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
+ <property name="invisible_char">●</property>
+ <property name="invisible_char_set">True</property>
+ <property name="adjustment">adjustment1</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">5</property>
- <property name="width">2</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="label_mtu">
+ <object class="GtkLabel" id="filler">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">bytes</property>
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="spin_mtu">
+ <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="invisible_char">●</property>
- <property name="invisible_char_set">True</property>
- <property name="adjustment">adjustment1</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">6</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <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>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ <property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
@@ -254,13 +260,34 @@
<placeholder/>
</child>
<child>
- <object class="GtkLabel" id="filler">
+ <placeholder/>
+ </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">2</property>
- <property name="top_attach">0</property>
+ <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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]