network: Add firewall zone support for wired

https://bugzilla.gnome.org/show_bug.cgi?id=694577
This commit is contained in:
Matthias Clasen 2013-03-02 19:36:39 -05:00
parent 7de70b9821
commit e183775af7
2 changed files with 91 additions and 54 deletions

View file

@ -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

View file

@ -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>
@ -177,42 +171,6 @@
<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">4</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>
<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>
</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>
<child>
<object class="GtkLabel" id="label_mtu">
<property name="visible">True</property>
@ -241,18 +199,6 @@
<property name="height">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="filler">
<property name="visible">True</property>
@ -265,6 +211,87 @@
<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>
<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>
</object>
<packing>
<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>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<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">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>
<object class="GtkSizeGroup" id="sizegroup1">
<widgets>