http://bugzilla.gnome.org/show_bug.cgi?id=85929 validate. This is not the
2002-07-10 Jody Goldberg <jody@gnome.org> http://bugzilla.gnome.org/show_bug.cgi?id=85929 * gnome-network-preferences.c (extract_proxy_host) : validate. This is not the prettiest way to do this, but it is effective.
This commit is contained in:
parent
19558b6f24
commit
fa081bdc60
4 changed files with 268 additions and 241 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2002-07-10 Jody Goldberg <jody@gnome.org>
|
||||||
|
|
||||||
|
http://bugzilla.gnome.org/show_bug.cgi?id=85929
|
||||||
|
* gnome-network-preferences.c (extract_proxy_host) : validate.
|
||||||
|
This is not the prettiest way to do this, but it is effective.
|
||||||
|
|
||||||
2002-06-17 Jody Goldberg <jody@gnome.org>
|
2002-06-17 Jody Goldberg <jody@gnome.org>
|
||||||
|
|
||||||
* Release 2.0.0
|
* Release 2.0.0
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <libgnome/libgnome.h>
|
#include <libgnome/libgnome.h>
|
||||||
#include <gconf/gconf-client.h>
|
#include <gconf/gconf-client.h>
|
||||||
#include <glade/glade.h>
|
#include <glade/glade.h>
|
||||||
|
#include <libgnomevfs/gnome-vfs-uri.h>
|
||||||
|
|
||||||
#include "capplet-util.h"
|
#include "capplet-util.h"
|
||||||
#include "gconf-property-editor.h"
|
#include "gconf-property-editor.h"
|
||||||
|
@ -50,6 +51,29 @@ cb_dialog_response (GtkDialog *dialog, gint response_id)
|
||||||
gtk_main_quit ();
|
gtk_main_quit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GConfValue *
|
||||||
|
extract_proxy_host (GConfPropertyEditor *peditor, const GConfValue *orig)
|
||||||
|
{
|
||||||
|
char const *entered_text = gconf_value_get_string (orig);
|
||||||
|
GConfValue *res = NULL;
|
||||||
|
|
||||||
|
if (entered_text != NULL) {
|
||||||
|
GnomeVFSURI *uri = gnome_vfs_uri_new (entered_text);
|
||||||
|
if (uri != NULL) {
|
||||||
|
char const *host = gnome_vfs_uri_get_host_name (uri);
|
||||||
|
if (host != NULL) {
|
||||||
|
res = gconf_value_new (GCONF_VALUE_STRING);
|
||||||
|
gconf_value_set_string (res, host);
|
||||||
|
}
|
||||||
|
gnome_vfs_uri_unref (uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res != NULL)
|
||||||
|
return res;
|
||||||
|
return gconf_value_copy (orig);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setup_dialog (GladeXML *dialog)
|
setup_dialog (GladeXML *dialog)
|
||||||
{
|
{
|
||||||
|
@ -60,7 +84,9 @@ setup_dialog (GladeXML *dialog)
|
||||||
gconf_peditor_widget_set_guard (peditor, WID ("host_port_table"));
|
gconf_peditor_widget_set_guard (peditor, WID ("host_port_table"));
|
||||||
|
|
||||||
peditor = GCONF_PROPERTY_EDITOR (gconf_peditor_new_string (
|
peditor = GCONF_PROPERTY_EDITOR (gconf_peditor_new_string (
|
||||||
NULL, PROXY_HOST_KEY, WID ("host_entry"), NULL));
|
NULL, PROXY_HOST_KEY, WID ("host_entry"),
|
||||||
|
"conv-from-widget-cb", extract_proxy_host,
|
||||||
|
NULL));
|
||||||
|
|
||||||
peditor = GCONF_PROPERTY_EDITOR (gconf_peditor_new_integer (
|
peditor = GCONF_PROPERTY_EDITOR (gconf_peditor_new_integer (
|
||||||
NULL, PROXY_PORT_KEY, WID ("port_entry"), NULL));
|
NULL, PROXY_PORT_KEY, WID ("port_entry"), NULL));
|
||||||
|
@ -84,6 +110,7 @@ main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
GladeXML *dialog;
|
GladeXML *dialog;
|
||||||
GConfClient *client;
|
GConfClient *client;
|
||||||
|
GtkWidget *widget;
|
||||||
|
|
||||||
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
||||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||||
|
@ -101,8 +128,9 @@ main (int argc, char **argv)
|
||||||
"network_dialog", NULL);
|
"network_dialog", NULL);
|
||||||
|
|
||||||
setup_dialog (dialog);
|
setup_dialog (dialog);
|
||||||
|
widget = WID ("network_dialog");
|
||||||
gtk_widget_show_all (WID ("network_dialog"));
|
capplet_set_icon (widget, "gnome-globe.png");
|
||||||
|
gtk_widget_show_all (widget);
|
||||||
gtk_main ();
|
gtk_main ();
|
||||||
|
|
||||||
g_object_unref (client);
|
g_object_unref (client);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
_Name=Network
|
_Name=Network Proxy
|
||||||
_Comment=Network Preferences
|
_Comment=Network Proxy Preferences
|
||||||
Exec=gnome-network-preferences
|
Exec=gnome-network-preferences
|
||||||
Icon=gnome-globe.png
|
Icon=gnome-globe.png
|
||||||
Terminal=0
|
Terminal=0
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<glade-interface>
|
<glade-interface>
|
||||||
|
|
||||||
<widget class="GtkDialog" id="network_dialog">
|
<widget class="GtkDialog" id="network_dialog">
|
||||||
<property name="title" translatable="yes">Network Preferences</property>
|
<property name="title" translatable="yes">Network Proxy Preferences</property>
|
||||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||||
<property name="modal">False</property>
|
<property name="modal">False</property>
|
||||||
|
@ -45,6 +45,7 @@
|
||||||
<widget class="GtkButton" id="button3">
|
<widget class="GtkButton" id="button3">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_default">True</property>
|
<property name="can_default">True</property>
|
||||||
|
<property name="has_default">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="label">gtk-close</property>
|
<property name="label">gtk-close</property>
|
||||||
<property name="use_stock">True</property>
|
<property name="use_stock">True</property>
|
||||||
|
@ -61,14 +62,6 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkFrame" id="frame3">
|
|
||||||
<property name="border_width">4</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes">HTTP Proxy Settings</property>
|
|
||||||
<property name="label_xalign">0</property>
|
|
||||||
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
|
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkVBox" id="vbox12">
|
<widget class="GtkVBox" id="vbox12">
|
||||||
<property name="border_width">8</property>
|
<property name="border_width">8</property>
|
||||||
|
@ -116,6 +109,7 @@
|
||||||
<property name="yalign">0.5</property>
|
<property name="yalign">0.5</property>
|
||||||
<property name="xpad">0</property>
|
<property name="xpad">0</property>
|
||||||
<property name="ypad">0</property>
|
<property name="ypad">0</property>
|
||||||
|
<property name="mnemonic_widget">host_entry</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
|
@ -157,10 +151,11 @@
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
<property name="wrap">False</property>
|
<property name="wrap">False</property>
|
||||||
<property name="selectable">False</property>
|
<property name="selectable">False</property>
|
||||||
<property name="xalign">0.5</property>
|
<property name="xalign">0</property>
|
||||||
<property name="yalign">0.5</property>
|
<property name="yalign">0.5</property>
|
||||||
<property name="xpad">0</property>
|
<property name="xpad">0</property>
|
||||||
<property name="ypad">0</property>
|
<property name="ypad">0</property>
|
||||||
|
<property name="mnemonic_widget">port_entry</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
|
@ -204,7 +199,7 @@
|
||||||
<widget class="GtkCheckButton" id="proxy_auth_toggle">
|
<widget class="GtkCheckButton" id="proxy_auth_toggle">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="label" translatable="yes">Pro_xy requires a username and password</property>
|
<property name="label" translatable="yes">Pro_xy requires username and password</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||||
<property name="active">False</property>
|
<property name="active">False</property>
|
||||||
|
@ -326,8 +321,6 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
<packing>
|
||||||
<property name="padding">0</property>
|
<property name="padding">0</property>
|
||||||
<property name="expand">True</property>
|
<property name="expand">True</property>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue