[gnome-control-center] network: Move firewall zone to security
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Move firewall zone to security
- Date: Sat, 23 May 2015 15:58:37 +0000 (UTC)
commit 2093f6c7eac69215e1ceb096da67d47375660c72
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Mar 5 15:31:59 2015 -0500
network: Move firewall zone to security
This is where people expect it (whether that is correct or not).
https://bugzilla.gnome.org/show_bug.cgi?id=745702
.../network/connection-editor/ce-page-security.c | 14 ++++++++
.../network/connection-editor/ce-page-security.h | 2 +
panels/network/connection-editor/ce-page-wifi.c | 8 -----
panels/network/connection-editor/security-page.ui | 32 ++++++++++++++++++++
panels/network/connection-editor/wifi-page.ui | 30 ------------------
5 files changed, 48 insertions(+), 38 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page-security.c
b/panels/network/connection-editor/ce-page-security.c
index 9b187bf..6375b8a 100644
--- a/panels/network/connection-editor/ce-page-security.c
+++ b/panels/network/connection-editor/ce-page-security.c
@@ -29,6 +29,7 @@
#include "wireless-security.h"
#include "ce-page-security.h"
+#include "firewall-helpers.h"
G_DEFINE_TYPE (CEPageSecurity, ce_page_security, CE_TYPE_PAGE)
@@ -148,6 +149,7 @@ security_combo_changed (GtkComboBox *combo,
gtk_container_remove (GTK_CONTAINER (parent), sec_widget);
gtk_size_group_add_widget (page->group, page->security_heading);
+ gtk_size_group_add_widget (page->group, page->firewall_heading);
wireless_security_add_to_size_group (sec, page->group);
gtk_container_add (GTK_CONTAINER (vbox), sec_widget);
@@ -204,6 +206,7 @@ finish_setup (CEPageSecurity *page)
NMConnection *connection = CE_PAGE (page)->connection;
NMSettingWireless *sw;
NMSettingWirelessSecurity *sws;
+ NMSettingConnection *sc;
gboolean is_adhoc = FALSE;
GtkListStore *sec_model;
GtkTreeIter iter;
@@ -354,6 +357,13 @@ finish_setup (CEPageSecurity *page)
page->security_combo = combo;
+ page->firewall_heading = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder,
"heading_zone"));
+ page->firewall_combo = GTK_COMBO_BOX (gtk_builder_get_object (CE_PAGE (page)->builder,
"combo_zone"));
+
+ sc = nm_connection_get_setting_connection (CE_PAGE (page)->connection);
+ firewall_ui_setup (sc, page->firewall_combo, CE_PAGE (page)->cancellable);
+ g_signal_connect_swapped (page->firewall_combo, "changed", G_CALLBACK (ce_page_changed), page);
+
security_combo_changed (combo, page);
g_signal_connect (combo, "changed",
G_CALLBACK (security_combo_changed), page);
@@ -365,6 +375,7 @@ validate (CEPage *page,
GError **error)
{
NMSettingWireless *sw;
+ NMSettingConnection *sc;
WirelessSecurity *sec;
gboolean valid = FALSE;
const char *mode;
@@ -409,6 +420,9 @@ validate (CEPage *page,
valid = TRUE;
}
+ sc = nm_connection_get_setting_connection (connection);
+ firewall_ui_to_setting (sc, CE_PAGE_SECURITY (page)->firewall_combo);
+
return valid;
}
diff --git a/panels/network/connection-editor/ce-page-security.h
b/panels/network/connection-editor/ce-page-security.h
index ab19bb7..d76b6b4 100644
--- a/panels/network/connection-editor/ce-page-security.h
+++ b/panels/network/connection-editor/ce-page-security.h
@@ -45,6 +45,8 @@ struct _CEPageSecurity
GtkComboBox *security_combo;
GtkWidget *security_heading;
+ GtkComboBox *firewall_combo;
+ GtkWidget *firewall_heading;
GtkSizeGroup *group;
gboolean adhoc;
};
diff --git a/panels/network/connection-editor/ce-page-wifi.c b/panels/network/connection-editor/ce-page-wifi.c
index ddd8d91..b6df7f2 100644
--- a/panels/network/connection-editor/ce-page-wifi.c
+++ b/panels/network/connection-editor/ce-page-wifi.c
@@ -30,7 +30,6 @@
#include <net/if_arp.h>
-#include "firewall-helpers.h"
#include "ce-page-wifi.h"
#include "ui-helpers.h"
@@ -130,8 +129,6 @@ connect_wifi_page (CEPageWifi *page)
g_signal_connect_swapped (widget, "toggled", G_CALLBACK (ce_page_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
@@ -143,7 +140,6 @@ 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));
@@ -160,10 +156,6 @@ 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/security-page.ui
b/panels/network/connection-editor/security-page.ui
index 0c3dd92..d5c1720 100644
--- a/panels/network/connection-editor/security-page.ui
+++ b/panels/network/connection-editor/security-page.ui
@@ -63,6 +63,38 @@
<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">2</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="hexpand">True</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">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+
</object>
</child>
<child type="tab">
diff --git a/panels/network/connection-editor/wifi-page.ui b/panels/network/connection-editor/wifi-page.ui
index 3986015..576e96d 100644
--- a/panels/network/connection-editor/wifi-page.ui
+++ b/panels/network/connection-editor/wifi-page.ui
@@ -172,35 +172,5 @@
<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]