From e9e9515a20100a6594ec7281e6f9c5cdff2abbdb Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Wed, 2 Feb 2005 01:21:16 +0000 Subject: [PATCH] Bug 259076. Use gconf system prefs for proxy-type and other proxy settings. r=darin,sr=roc, patch by Ganesh (Novell) git-svn-id: svn://10.0.0.236/trunk@168684 18797224-902f-48f8-a5cc-f745e15eee43 --- .../system-pref/src/gconf/gconf_pref_list.inc | 11 +++++++-- .../src/gconf/nsSystemPrefService.cpp | 23 ++++++++++++++++++- .../pref/system-pref/src/nsSystemPref.cpp | 7 ++++++ 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/mozilla/extensions/pref/system-pref/src/gconf/gconf_pref_list.inc b/mozilla/extensions/pref/system-pref/src/gconf/gconf_pref_list.inc index b51aef9300c..25b07430f53 100644 --- a/mozilla/extensions/pref/system-pref/src/gconf/gconf_pref_list.inc +++ b/mozilla/extensions/pref/system-pref/src/gconf/gconf_pref_list.inc @@ -7,6 +7,13 @@ {"network.proxy.http", "/system/http_proxy/host"}, {"network.proxy.http_port", "/system/http_proxy/port"}, - {"network.proxy.ftp", "/system/ftp_proxy/host"}, - {"network.proxy.ftp_port", "/system/ftp_proxy/port"}, + {"network.proxy.ftp", "/system/proxy/ftp_host"}, + {"network.proxy.ftp_port", "/system/proxy/ftp_port"}, + {"network.proxy.ssl", "/system/proxy/secure_host"}, + {"network.proxy.ssl_port", "/system/proxy/secure_port"}, + {"network.proxy.socks", "/system/proxy/socks_host"}, + {"network.proxy.socks_port", "/system/proxy/socks_port"}, + {"network.proxy.no_proxies_on", "/system/proxy/ignore_hosts"}, + {"network.proxy.autoconfig_url", "/system/proxy/autoconfig_url"}, + {"network.proxy.type", "/system/proxy/mode"}, {"config.use_system_prefs.accessibility", "/desktop/gnome/interface/accessibility"}, diff --git a/mozilla/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp b/mozilla/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp index ba50e8b3df1..120bb79db47 100644 --- a/mozilla/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp +++ b/mozilla/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp @@ -702,7 +702,28 @@ nsresult GConfProxy::GetIntPref(const char *aMozKey, PRInt32 *retval) { NS_ENSURE_TRUE(mInitialized, NS_ERROR_FAILURE); - *retval = GConfClientGetInt(mGConfClient, MozKey2GConfKey(aMozKey), NULL); + if (strcmp (aMozKey, "network.proxy.type") == 0) { + gchar *str; + + str = GConfClientGetString(mGConfClient, + MozKey2GConfKey (aMozKey), NULL); + + if (str) { + if (strcmp (str, "manual") == 0) + *retval = 1; + else if (strcmp (str, "auto") == 0) + *retval = 2; + else + *retval = 0; + + g_free (str); + } else + *retval = 0; + } else { + *retval = GConfClientGetInt(mGConfClient, + MozKey2GConfKey(aMozKey), NULL); + } + return NS_OK; } diff --git a/mozilla/extensions/pref/system-pref/src/nsSystemPref.cpp b/mozilla/extensions/pref/system-pref/src/nsSystemPref.cpp index 69445d385da..240c37ea7cc 100644 --- a/mozilla/extensions/pref/system-pref/src/nsSystemPref.cpp +++ b/mozilla/extensions/pref/system-pref/src/nsSystemPref.cpp @@ -73,6 +73,13 @@ static const char *sSysPrefList[] = { "network.proxy.http_port", "network.proxy.ftp", "network.proxy.ftp_port", + "network.proxy.ssl", + "network.proxy.ssl_port", + "network.proxy.socks", + "network.proxy.socks_port", + "network.proxy.no_proxies_on", + "network.proxy.autoconfig_url", + "network.proxy.type", "config.use_system_prefs.accessibility", };