[network-manager-applet/th/proxy-bgo621767] fixup! nm-c-e/proxy: Support proxy handling similar to nmcli.
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/th/proxy-bgo621767] fixup! nm-c-e/proxy: Support proxy handling similar to nmcli.
- Date: Tue, 6 Dec 2016 21:36:26 +0000 (UTC)
commit fc7ad7da518636835b429b3a7f34e6f197c0adce
Author: Thomas Haller <thaller redhat com>
Date: Tue Dec 6 22:35:54 2016 +0100
fixup! nm-c-e/proxy: Support proxy handling similar to nmcli.
src/connection-editor/page-proxy.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/connection-editor/page-proxy.c b/src/connection-editor/page-proxy.c
index 0772fea..3d88e72 100644
--- a/src/connection-editor/page-proxy.c
+++ b/src/connection-editor/page-proxy.c
@@ -77,6 +77,12 @@ proxy_private_init (CEPageProxy *self)
}
static void
+stuff_changed (GtkWidget *w, gpointer user_data)
+{
+ ce_page_changed (CE_PAGE (user_data));
+}
+
+static void
method_changed (GtkComboBox *combo, gpointer user_data)
{
CEPageProxy *self = user_data;
@@ -126,7 +132,7 @@ import_button_clicked_cb (GtkWidget *widget, CEPageProxy *self)
g_file_get_contents (filename, &script, &len, NULL);
buffer = gtk_text_view_get_buffer (priv->pac_script_window);
- gtk_text_buffer_set_text (buffer, script ? script : "", -1);
+ gtk_text_buffer_set_text (buffer, script ?: "", -1);
g_free (filename);
g_free (script);
@@ -158,13 +164,18 @@ populate_ui (CEPageProxy *self)
/* Pac Script */
tmp = nm_setting_proxy_get_pac_script (setting);
buffer = gtk_text_view_get_buffer (priv->pac_script_window);
- gtk_text_buffer_set_text (buffer, tmp ? tmp : "", -1);
+ gtk_text_buffer_set_text (buffer, tmp ?: "", -1);
break;
case NM_SETTING_PROXY_METHOD_NONE:
gtk_combo_box_set_active (priv->method, PROXY_METHOD_NONE);
/* Nothing to Show */
}
+ g_signal_connect (priv->method, "changed", G_CALLBACK (stuff_changed), self);
+ g_signal_connect (priv->browser_only, "changed", G_CALLBACK (stuff_changed), self);
+ g_signal_connect (priv->pac_url, "changed", G_CALLBACK (stuff_changed), self);
+ g_signal_connect (gtk_text_view_get_buffer (priv->pac_script_window), "changed", G_CALLBACK
(stuff_changed), self);
+
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->browser_only),
nm_setting_proxy_get_browser_only (setting));
}
@@ -270,7 +281,7 @@ ui_to_setting (CEPageProxy *self)
NM_SETTING_PROXY_METHOD, NM_SETTING_PROXY_METHOD_AUTO,
NM_SETTING_PROXY_BROWSER_ONLY, browser_only,
NM_SETTING_PROXY_PAC_URL, pac_url,
- NM_SETTING_PROXY_PAC_SCRIPT, script,
+ NM_SETTING_PROXY_PAC_SCRIPT, nm_str_not_empty (script),
NULL);
g_free (script);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]