From ee02657f622bfcfdb334337f542ea21926b2a1a5 Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Wed, 27 Aug 2003 18:50:43 +0000 Subject: [PATCH] Work around peditor bug that resets the port when we start up for the Tue Aug 26 15:00:34 2003 Jonathan Blandford * gnome-network-preferences.c (setup_dialog): Work around peditor bug that resets the port when we start up for the first time, #120111 --- capplets/network/ChangeLog | 6 ++++++ capplets/network/gnome-network-preferences.c | 14 ++++++++++++++ capplets/network/gnome-network-preferences.glade | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/capplets/network/ChangeLog b/capplets/network/ChangeLog index c2be026c4..b59380e78 100644 --- a/capplets/network/ChangeLog +++ b/capplets/network/ChangeLog @@ -1,3 +1,9 @@ +Tue Aug 26 15:00:34 2003 Jonathan Blandford + + * gnome-network-preferences.c (setup_dialog): Work around peditor + bug that resets the port when we start up for the first time, + #120111 + 2003-07-18 Dennis Cranston * gnome-network-capplet.png: New file. diff --git a/capplets/network/gnome-network-preferences.c b/capplets/network/gnome-network-preferences.c index f30d10058..95d28eb3d 100644 --- a/capplets/network/gnome-network-preferences.c +++ b/capplets/network/gnome-network-preferences.c @@ -208,10 +208,16 @@ setup_dialog (GladeXML *dialog) GConfPropertyEditor *peditor; GSList *mode_group; GType mode_type = 0; + GConfClient *client; + gint port_value; mode_type = g_enum_register_static ("NetworkPreferencesProxyType", proxytype_values); + /* There's a bug in peditors that cause them to not initialize the entry + * correctly. */ + client = gconf_client_get_default (); + /* Hackety hack */ gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (WID ("none_radiobutton"))->child), TRUE); gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (WID ("manual_radiobutton"))->child), TRUE); @@ -226,6 +232,8 @@ setup_dialog (GladeXML *dialog) TRUE, NULL)); /* Http */ + port_value = gconf_client_get_int (client, HTTP_PROXY_PORT_KEY, NULL); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (WID ("http_port_spinbutton")), (gdouble) port_value); peditor = GCONF_PROPERTY_EDITOR (gconf_peditor_new_string ( NULL, HTTP_PROXY_HOST_KEY, WID ("http_host_entry"), "conv-from-widget-cb", extract_proxy_host, @@ -239,6 +247,8 @@ setup_dialog (GladeXML *dialog) WID ("network_dialog")); /* Secure */ + port_value = gconf_client_get_int (client, SECURE_PROXY_PORT_KEY, NULL); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (WID ("secure_port_spinbutton")), (gdouble) port_value); peditor = GCONF_PROPERTY_EDITOR (gconf_peditor_new_string ( NULL, SECURE_PROXY_HOST_KEY, WID ("secure_host_entry"), "conv-from-widget-cb", extract_proxy_host, @@ -248,6 +258,8 @@ setup_dialog (GladeXML *dialog) NULL)); /* Ftp */ + port_value = gconf_client_get_int (client, FTP_PROXY_PORT_KEY, NULL); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (WID ("ftp_port_spinbutton")), (gdouble) port_value); peditor = GCONF_PROPERTY_EDITOR (gconf_peditor_new_string ( NULL, FTP_PROXY_HOST_KEY, WID ("ftp_host_entry"), "conv-from-widget-cb", extract_proxy_host, @@ -257,6 +269,8 @@ setup_dialog (GladeXML *dialog) NULL)); /* Socks */ + port_value = gconf_client_get_int (client, SOCKS_PROXY_PORT_KEY, NULL); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (WID ("socks_port_spinbutton")), (gdouble) port_value); peditor = GCONF_PROPERTY_EDITOR (gconf_peditor_new_string ( NULL, SOCKS_PROXY_HOST_KEY, WID ("socks_host_entry"), "conv-from-widget-cb", extract_proxy_host, diff --git a/capplets/network/gnome-network-preferences.glade b/capplets/network/gnome-network-preferences.glade index 1eea49c86..912c26279 100644 --- a/capplets/network/gnome-network-preferences.glade +++ b/capplets/network/gnome-network-preferences.glade @@ -862,7 +862,7 @@ True True True - True + False 0 True