[gnome-control-center] network: Bind HTTP host entry to the 'host' setting in GSettings
- From: Rodrigo Moya <rodrigo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Bind HTTP host entry to the 'host' setting in GSettings
- Date: Mon, 19 Sep 2011 14:05:30 +0000 (UTC)
commit c008829c5e1f7550997d9faa25dbe48359857865
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Mon Sep 19 16:04:06 2011 +0200
network: Bind HTTP host entry to the 'host' setting in GSettings
panels/network/cc-network-panel.c | 32 +++++++-------------------------
1 files changed, 7 insertions(+), 25 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 4841edf..6698d86 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -3204,20 +3204,6 @@ stop_hotspot (GtkButton *button, CcNetworkPanel *panel)
gtk_window_present (GTK_WINDOW (dialog));
}
-static GVariant *
-bind_settings_enabled_cb (const GValue *value,
- const GVariantType *expected_type,
- gpointer user_data)
-{
- const gchar *str;
- GSettings *settings = G_SETTINGS (user_data);
-
- /* only set to enabled if there is a host in the combobox */
- str = g_value_get_string (value);
- g_settings_set_string (settings, "host", str);
- return g_variant_new_boolean (str != NULL && str[0] != '\0');
-}
-
static void
cc_network_panel_init (CcNetworkPanel *panel)
{
@@ -3277,17 +3263,13 @@ cc_network_panel_init (CcNetworkPanel *panel)
widget, "text",
G_SETTINGS_BIND_DEFAULT);
- /* bind the proxy values */
+ /* bind the HTTP proxy values */
settings_tmp = g_settings_get_child (panel->priv->proxy_settings, "http");
widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder,
"entry_proxy_http"));
- g_settings_bind_with_mapping (settings_tmp, "enabled",
- widget, "text",
- G_SETTINGS_BIND_SET,
- NULL,
- bind_settings_enabled_cb,
- settings_tmp,
- NULL);
+ g_settings_bind (settings_tmp, "host",
+ widget, "text",
+ G_SETTINGS_BIND_DEFAULT);
adjustment = GTK_ADJUSTMENT (gtk_builder_get_object (panel->priv->builder,
"adjustment_proxy_port_http"));
g_settings_bind (settings_tmp, "port",
@@ -3295,7 +3277,7 @@ cc_network_panel_init (CcNetworkPanel *panel)
G_SETTINGS_BIND_DEFAULT);
g_object_unref (settings_tmp);
- /* bind the proxy values */
+ /* bind the HTTPS proxy values */
settings_tmp = g_settings_get_child (panel->priv->proxy_settings, "https");
widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder,
"entry_proxy_https"));
@@ -3309,7 +3291,7 @@ cc_network_panel_init (CcNetworkPanel *panel)
G_SETTINGS_BIND_DEFAULT);
g_object_unref (settings_tmp);
- /* bind the proxy values */
+ /* bind the FTP proxy values */
settings_tmp = g_settings_get_child (panel->priv->proxy_settings, "ftp");
widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder,
"entry_proxy_ftp"));
@@ -3323,7 +3305,7 @@ cc_network_panel_init (CcNetworkPanel *panel)
G_SETTINGS_BIND_DEFAULT);
g_object_unref (settings_tmp);
- /* bind the proxy values */
+ /* bind the SOCKS proxy values */
settings_tmp = g_settings_get_child (panel->priv->proxy_settings, "socks");
widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder,
"entry_proxy_socks"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]