summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtul Anand <atulhjp@gmail.com>2016-08-16 05:58:06 +0530
committerThomas Haller <thaller@redhat.com>2016-12-16 14:52:41 +0100
commite5140343d769c48ff2516b18251881cb06e49601 (patch)
tree3cbe3f93cb84a87b133301609fd5c6a61120f00a
parentf04ed47fad12747bf2a3398556a17f6f08c3a337 (diff)
downloadnetwork-manager-applet-e5140343d769c48ff2516b18251881cb06e49601.tar.gz
nm-connection-editor: Fixes for including Proxy page
A new GUI page Proxy has been added which appears next to IP Settings when configuring a connection in nm-connection-editor. Proxy settings can be kept in same queue with IP settings wherever the later appears. Easy note: Proxy setting depends on them.
-rw-r--r--src/connection-editor/Makefile.am3
-rw-r--r--src/connection-editor/connection-helpers.c12
-rw-r--r--src/connection-editor/connection-helpers.h1
-rw-r--r--src/connection-editor/nm-connection-editor.c4
-rw-r--r--src/connection-editor/nm-connection-list.c2
5 files changed, 22 insertions, 0 deletions
diff --git a/src/connection-editor/Makefile.am b/src/connection-editor/Makefile.am
index 69b012f1..091c1dc3 100644
--- a/src/connection-editor/Makefile.am
+++ b/src/connection-editor/Makefile.am
@@ -52,6 +52,8 @@ nm_connection_editor_SOURCES = \
page-bluetooth.c \
page-ppp.h \
page-ppp.c \
+ page-proxy.h \
+ page-proxy.c \
page-vpn.h \
page-vpn.c \
page-master.h \
@@ -106,6 +108,7 @@ ui_DATA = \
ce-page-team-port.ui \
ce-page-bridge.ui \
ce-page-bridge-port.ui \
+ ce-page-proxy.ui \
ce-page-ip4.ui \
ce-ip4-routes.ui \
ce-page-ip6.ui \
diff --git a/src/connection-editor/connection-helpers.c b/src/connection-editor/connection-helpers.c
index be9dd22f..a4a37d4a 100644
--- a/src/connection-editor/connection-helpers.c
+++ b/src/connection-editor/connection-helpers.c
@@ -789,6 +789,18 @@ delete_connection (GtkWindow *parent_window,
}
gboolean
+connection_supports_proxy (NMConnection *connection)
+{
+ NMSettingConnection *s_con;
+
+ g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
+
+ /* Same Stuff as IP4 */
+ s_con = nm_connection_get_setting_connection (connection);
+ return (nm_setting_connection_get_slave_type (s_con) == NULL);
+}
+
+gboolean
connection_supports_ip4 (NMConnection *connection)
{
NMSettingConnection *s_con;
diff --git a/src/connection-editor/connection-helpers.h b/src/connection-editor/connection-helpers.h
index 08fe5834..17de5699 100644
--- a/src/connection-editor/connection-helpers.h
+++ b/src/connection-editor/connection-helpers.h
@@ -83,6 +83,7 @@ void delete_connection (GtkWindow *parent_window,
DeleteConnectionResultFunc result_func,
gpointer user_data);
+gboolean connection_supports_proxy (NMConnection *connection);
gboolean connection_supports_ip4 (NMConnection *connection);
gboolean connection_supports_ip6 (NMConnection *connection);
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index 9d23390b..ea7d3992 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -38,6 +38,7 @@
#include "page-8021x-security.h"
#include "page-wifi.h"
#include "page-wifi-security.h"
+#include "page-proxy.h"
#include "page-ip4.h"
#include "page-ip6.h"
#include "page-ip-tunnel.h"
@@ -812,6 +813,9 @@ nm_connection_editor_set_connection (NMConnectionEditor *editor,
goto out;
}
+ if ( nm_connection_get_setting_proxy (editor->connection)
+ && !add_page (editor, ce_page_proxy_new, editor->connection, error))
+ goto out;
if ( nm_connection_get_setting_ip4_config (editor->connection)
&& !add_page (editor, ce_page_ip4_new, editor->connection, error))
goto out;
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index 37c7eb5a..525b68ba 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -278,6 +278,8 @@ really_add_connection (FUNC_TAG_NEW_CONNECTION_RESULT_IMPL,
return;
}
+ if (connection_supports_proxy (connection) && !nm_connection_get_setting_proxy (connection))
+ nm_connection_add_setting (connection, nm_setting_proxy_new ());
if (connection_supports_ip4 (connection) && !nm_connection_get_setting_ip4_config (connection))
nm_connection_add_setting (connection, nm_setting_ip4_config_new ());
if (connection_supports_ip6 (connection) && !nm_connection_get_setting_ip6_config (connection))