Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 98755 Details for
Bug 228739
[Proxy] add UI support to see what the automatically detected proxy settings are
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Revised patch to have all changes in one place
228739.txt (text/plain), 22.04 KB, created by
Francis Upton IV
on 2008-05-06 03:04:38 EDT
(
hide
)
Description:
Revised patch to have all changes in one place
Filename:
MIME Type:
Creator:
Francis Upton IV
Created:
2008-05-06 03:04:38 EDT
Size:
22.04 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.net >Index: src/org/eclipse/ui/internal/net/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/messages.properties,v >retrieving revision 1.5 >diff -u -r1.5 messages.properties >--- src/org/eclipse/ui/internal/net/messages.properties 14 Apr 2008 13:37:59 -0000 1.5 >+++ src/org/eclipse/ui/internal/net/messages.properties 6 May 2008 07:01:30 -0000 >@@ -10,6 +10,7 @@ > # yyyymmdd bug Email and other contact information > # -------- -------- ----------------------------------------------------------- > # 20070201 154100 pmoogk@ca.ibm.com - Peter Moogk, Port internet code from WTP to Eclipse base. >+# 20080424 228739 francisu@ieee.org - Francis Upton (Oakland Software) > ############################################################################### > > # >@@ -45,8 +46,16 @@ > ProxyPreferencePage_42=Invalid port > ProxyPreferencePage_43=The port must be an integer > ProxyPreferencePage_44=System proxy configuration (if available) >-ProxyPreferencePage_45=Specifies that system proxy settings are used to access the Internet. If such settings can't be retrieved, no proxy should be used. >-UserValidationDialog_0=Password Required >+ProxyPreferencePage_45=Specifies that system proxy settings are used to access the Internet. If these settings can't be retrieved, no proxy is used. >+ProxyPreferencePage_showSystemConfig_button=Show >+ProxyPreferencePage_showSystemConfig_tooltip=Shows the current values of the system proxy configuration. >+ProxyPreferencePage_showConfigDialogTitle=These values were determined from your system configuration: >+ProxyPreferencePage_showConfigDialog_None=No system proxy configuration information was found. >+ProxyPreferencePage_showConfigDialog_Protocol=Protocol >+ProxyPreferencePage_showConfigDialog_SourceValue=Source/Value >+ProxyPreferencePage_showConfigDialog_NoSourceSpecified=<no source specified> >+ProxyPreferencePage_showConfigDialog_User=User: >+ProxyPreferencePage_showConfigDialog_Password=Password: > UserValidationDialog_1=Connect to: {0} > UserValidationDialog_2=&Password: > UserValidationDialog_3=&User name: >Index: src/org/eclipse/ui/internal/net/NetUIMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NetUIMessages.java,v >retrieving revision 1.5 >diff -u -r1.5 NetUIMessages.java >--- src/org/eclipse/ui/internal/net/NetUIMessages.java 14 Apr 2008 13:37:59 -0000 1.5 >+++ src/org/eclipse/ui/internal/net/NetUIMessages.java 6 May 2008 07:01:30 -0000 >@@ -10,6 +10,7 @@ > * yyyymmdd bug Email and other contact information > * -------- -------- ----------------------------------------------------------- > * 20070201 154100 pmoogk@ca.ibm.com - Peter Moogk, Port internet code from WTP to Eclipse base. >+ * 20080424 228739 francisu@ieee.org - Francis Upton (Oakland Software) > *******************************************************************************/ > package org.eclipse.ui.internal.net; > >@@ -76,11 +77,29 @@ > public static String ProxyPreferencePage_8; > > public static String ProxyPreferencePage_9; >- >+ > public static String ProxyPreferencePage_44; >- >+ > public static String ProxyPreferencePage_45; > >+ public static String ProxyPreferencePage_showSystemConfig_button; >+ >+ public static String ProxyPreferencePage_showSystemConfig_tooltip; >+ >+ public static String ProxyPreferencePage_showConfigDialogTitle; >+ >+ public static String ProxyPreferencePage_showConfigDialog_None; >+ >+ public static String ProxyPreferencePage_showConfigDialog_Protocol; >+ >+ public static String ProxyPreferencePage_showConfigDialog_SourceValue; >+ >+ public static String ProxyPreferencePage_showConfigDialog_NoSourceSpecified; >+ >+ public static String ProxyPreferencePage_showConfigDialog_User; >+ >+ public static String ProxyPreferencePage_showConfigDialog_Password; >+ > public static String TITLE_PREFERENCE_HOSTS_DIALOG; > > public static String LABEL_PREFERENCE_HOSTS_DIALOG; >Index: src/org/eclipse/ui/internal/net/ProxyPreferencePage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyPreferencePage.java,v >retrieving revision 1.11 >diff -u -r1.11 ProxyPreferencePage.java >--- src/org/eclipse/ui/internal/net/ProxyPreferencePage.java 14 Apr 2008 13:37:59 -0000 1.11 >+++ src/org/eclipse/ui/internal/net/ProxyPreferencePage.java 6 May 2008 07:01:30 -0000 >@@ -15,13 +15,18 @@ > * 20070402 180622 brockj@tpg.com.au - Brock Janiczak, Inconsistent enablement states in network preference page > * 20070416 177897 ymnk@jcraft.com - Atsuhiko Yamanaka, Improve UI of Proxy Preferences Page > * 20070801 197977 holger.oehm@sap.com - Holger Oehm, [Proxy] non-proxy hosts not correctly updated >+ * 20080424 228739 francisu@ieee.org - Francis Upton (Oakland Software), dialog for system prop values > *******************************************************************************/ > package org.eclipse.ui.internal.net; > >+import org.eclipse.core.internal.net.ProxyData; >+import org.eclipse.core.internal.net.ProxyManager; > import org.eclipse.core.net.proxy.IProxyData; > import org.eclipse.core.net.proxy.IProxyService; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.dialogs.ErrorDialog; >+import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.jface.preference.PreferencePage; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.ModifyEvent; >@@ -34,6 +39,7 @@ > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Shell; > import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.IWorkbench; > import org.eclipse.ui.IWorkbenchPreferencePage; >@@ -46,9 +52,11 @@ > = "org.eclipse.ui.net.proxy_preference_page_context"; //$NON-NLS-1$ > > Entry[] entryList; >+ Button systemProxyConfigurationButton; > Button directConnectionToButton; > Button manualProxyConfigurationButton; > Button useSameProxyButton; >+ Button showSystemProxyConfigButton; > private Label nonHostLabel; > private NonProxyHostsComposite nonHostComposite; > Button enableProxyAuth; >@@ -57,7 +65,6 @@ > Text userid; > Text password; > private IProxyService proxyService; >- Button systemProxyConfigurationButton; > > public ProxyPreferencePage() { > super(NetUIMessages.ProxyPreferencePage_2); >@@ -84,30 +91,59 @@ > entryList[i] = new Entry(pd); > } > >- Composite composite = new Composite(parent, SWT.NONE); >+ final Composite composite = new Composite(parent, SWT.NONE); > GridLayout layout = new GridLayout(); > layout.numColumns = 1; > layout.marginRight = 5; > layout.marginTop = 5; > layout.marginWidth = 0; > composite.setLayout(layout); >- GridData data = new GridData(GridData.FILL_BOTH); >- composite.setLayoutData(data); >+ composite.setLayoutData(new GridData(GridData.FILL_BOTH)); > >- systemProxyConfigurationButton = new Button(composite, SWT.RADIO); >- systemProxyConfigurationButton.setLayoutData(new GridData()); >- systemProxyConfigurationButton.setText(NetUIMessages.ProxyPreferencePage_44); >+ Composite sysComposite = new Composite(composite, SWT.NONE); >+ layout = new GridLayout(); >+ layout.numColumns = 2; >+ layout.marginTop = 0; >+ layout.marginBottom = 0; >+ layout.marginWidth = 0; >+ sysComposite.setLayout(layout); >+ sysComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); >+ >+ systemProxyConfigurationButton = new Button(sysComposite, SWT.RADIO); >+ systemProxyConfigurationButton.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_BEGINNING, >+ GridData.VERTICAL_ALIGN_BEGINNING, true, false)); >+ systemProxyConfigurationButton >+ .setText(NetUIMessages.ProxyPreferencePage_44); > systemProxyConfigurationButton > .setToolTipText(NetUIMessages.ProxyPreferencePage_45); >- systemProxyConfigurationButton.addSelectionListener(new SelectionAdapter() { >- public void widgetSelected(SelectionEvent e) { >- if (systemProxyConfigurationButton.getSelection()) >- enableControls(false); >- } >- }); >+ systemProxyConfigurationButton >+ .addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ if (systemProxyConfigurationButton.getSelection()) >+ enableControls(false); >+ } >+ }); > >- directConnectionToButton = new Button(composite, SWT.RADIO); >- directConnectionToButton.setLayoutData(new GridData()); >+ showSystemProxyConfigButton = new Button(sysComposite, SWT.PUSH); >+ showSystemProxyConfigButton.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_END, >+ GridData.VERTICAL_ALIGN_BEGINNING, false, false)); >+ showSystemProxyConfigButton >+ .setText(NetUIMessages.ProxyPreferencePage_showSystemConfig_button); >+ showSystemProxyConfigButton >+ .setToolTipText(NetUIMessages.ProxyPreferencePage_showSystemConfig_tooltip); >+ showSystemProxyConfigButton >+ .addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ showSystemProxyInfo(composite.getShell()); >+ } >+ }); >+ >+ directConnectionToButton = new Button(sysComposite, SWT.RADIO); >+ directConnectionToButton.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_BEGINNING, >+ GridData.VERTICAL_ALIGN_BEGINNING, true, false, 2, 1)); > directConnectionToButton.setText(NetUIMessages.ProxyPreferencePage_3); > directConnectionToButton > .setToolTipText(NetUIMessages.ProxyPreferencePage_1); >@@ -118,17 +154,21 @@ > } > }); > >- manualProxyConfigurationButton = new Button(composite, SWT.RADIO); >+ manualProxyConfigurationButton = new Button(sysComposite, SWT.RADIO); >+ manualProxyConfigurationButton.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_BEGINNING, >+ GridData.VERTICAL_ALIGN_BEGINNING, true, false, 2, 1)); > manualProxyConfigurationButton > .setText(NetUIMessages.ProxyPreferencePage_4); > manualProxyConfigurationButton > .setToolTipText(NetUIMessages.ProxyPreferencePage_0); >- manualProxyConfigurationButton.addSelectionListener(new SelectionAdapter() { >- public void widgetSelected(SelectionEvent e) { >- if (manualProxyConfigurationButton.getSelection()) >- enableControls(true); >- } >- }); >+ manualProxyConfigurationButton >+ .addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ if (manualProxyConfigurationButton.getSelection()) >+ enableControls(true); >+ } >+ }); > > final Composite manualProxyConfigurationComposite = new Composite( > composite, SWT.NONE); >@@ -231,6 +271,108 @@ > return composite; > } > >+ protected void showSystemProxyInfo(Shell shell) { >+ final ProxyData[] pds = ((ProxyManager) ProxyManager.getProxyManager()).getSystemProxyData(); >+ >+ Dialog dialog = new Dialog(shell) { >+ protected boolean isResizable() { >+ return true; >+ } >+ >+ protected Control createDialogArea(Composite parent) { >+ Composite c = (Composite) super.createDialogArea(parent); >+ >+ GridLayout layout = new GridLayout(); >+ layout.numColumns = 2; >+ layout.marginTop = 5; >+ layout.marginBottom = 5; >+ layout.marginWidth = 10; >+ c.setLayout(layout); >+ c.setLayoutData(new GridData(GridData.FILL_BOTH)); >+ >+ Label l; >+ >+ if (pds.length == 0) { >+ l = new Label(c, SWT.NONE); >+ l >+ .setText(NetUIMessages.ProxyPreferencePage_showConfigDialog_None); >+ l.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_BEGINNING, >+ GridData.VERTICAL_ALIGN_BEGINNING, false, false, 2, >+ 1)); >+ return c; >+ } >+ >+ l = new Label(c, SWT.NONE); >+ l.setText(NetUIMessages.ProxyPreferencePage_showConfigDialogTitle); >+ l.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_BEGINNING, >+ GridData.VERTICAL_ALIGN_BEGINNING, false, false, 2, 1)); >+ >+ l = new Label(c, SWT.NONE); >+ l = new Label(c, SWT.NONE); >+ >+ l = new Label(c, SWT.NONE); >+ l >+ .setText(NetUIMessages.ProxyPreferencePage_showConfigDialog_Protocol); >+ l = new Label(c, SWT.NONE); >+ l >+ .setText(NetUIMessages.ProxyPreferencePage_showConfigDialog_SourceValue); >+ >+ for (int i = 0; i < pds.length; i++) { >+ l = new Label(c, SWT.NONE); >+ l.setText(pds[i].getType()); >+ String source = pds[i].getSource(); >+ if (source == null) >+ source = NetUIMessages.ProxyPreferencePage_showConfigDialog_NoSourceSpecified; >+ l = new Label(c, SWT.NONE); >+ l.setText(source); >+ >+ l = new Label(c, SWT.NONE); >+ l.setText(""); //$NON-NLS-1$ >+ l = new Label(c, SWT.NONE); >+ l.setText(buildLabelString(pds[i])); >+ } >+ return c; >+ } >+ >+ protected String buildLabelString(ProxyData pd) { >+ StringBuffer sb = new StringBuffer(); >+ sb.append(pd.getHost()); >+ if (pd.getPort() != 0) { >+ sb.append(":"); //$NON-NLS-1$ >+ sb.append(pd.getPort()); >+ } >+ if (pd.getUserId() != null) { >+ sb.append(" "); //$NON-NLS-1$ >+ sb.append(NetUIMessages.ProxyPreferencePage_showConfigDialog_User); >+ sb.append(" "); //$NON-NLS-1$ >+ sb.append(pd.getUserId()); >+ if (pd.getPassword() != null) { >+ sb.append(" "); //$NON-NLS-1$ >+ sb.append(NetUIMessages.ProxyPreferencePage_showConfigDialog_Password); >+ sb.append(" "); //$NON-NLS-1$ >+ sb.append(pd.getPassword()); >+ } >+ } >+ return sb.toString(); >+ } >+ >+ protected void configureShell(Shell shell) { >+ super.configureShell(shell); >+ shell.setText("System Proxy Configuration"); //$NON-NLS-1$ >+ } >+ >+ protected void createButtonsForButtonBar(Composite parent) { >+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, >+ true); >+ } >+ >+ }; >+ >+ dialog.open(); >+ } >+ > protected void performApply() { > if (proxyService == null) > return; >#P org.eclipse.core.net >Index: src/org/eclipse/core/internal/net/ProxyData.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyData.java,v >retrieving revision 1.4 >diff -u -r1.4 ProxyData.java >--- src/org/eclipse/core/internal/net/ProxyData.java 15 Apr 2008 09:59:37 -0000 1.4 >+++ src/org/eclipse/core/internal/net/ProxyData.java 6 May 2008 07:01:31 -0000 >@@ -7,6 +7,8 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Oakland Software Incorporated (Francis Upton) francisu@ieee.org >+ * Bug 228739 - add UI support to show actual system config > *******************************************************************************/ > package org.eclipse.core.internal.net; > >@@ -15,6 +17,7 @@ > public class ProxyData implements IProxyData { > > private String type; >+ private String source; > private String host; > private int port; > private String user; >@@ -48,6 +51,10 @@ > return type; > } > >+ public String getSource() { >+ return source; >+ } >+ > public String getUserId() { > return user; > } >@@ -71,11 +78,16 @@ > requiresAuthentication = userid != null; > } > >+ public void setSource(String source) { >+ this.source = source; >+ } >+ > public boolean isRequiresAuthentication() { > return requiresAuthentication; > } > > public void disable() { >+ source = null; > host = null; > port = -1; > user = null; >@@ -85,6 +97,8 @@ > > public String toString() { > StringBuffer stringBuffer = new StringBuffer(); >+ stringBuffer.append("source: "); //$NON-NLS-1$ >+ stringBuffer.append(type); > stringBuffer.append("type: "); //$NON-NLS-1$ > stringBuffer.append(type); > stringBuffer.append(" host: "); //$NON-NLS-1$ >Index: src/org/eclipse/core/internal/net/AbstractProxyProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.net/src/org/eclipse/core/internal/net/AbstractProxyProvider.java,v >retrieving revision 1.2 >diff -u -r1.2 AbstractProxyProvider.java >--- src/org/eclipse/core/internal/net/AbstractProxyProvider.java 14 Apr 2008 13:18:16 -0000 1.2 >+++ src/org/eclipse/core/internal/net/AbstractProxyProvider.java 6 May 2008 07:01:31 -0000 >@@ -42,9 +42,9 @@ > return getProxyData(uri); > } > >- protected abstract IProxyData[] getProxyData(URI uri); >+ public abstract IProxyData[] getProxyData(URI uri); > >- protected String[] getNonProxiedHosts() { >+ public String[] getNonProxiedHosts() { > return new String[] {}; > } > } >Index: src/org/eclipse/core/internal/net/WindowsProxyProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.net/src/org/eclipse/core/internal/net/WindowsProxyProvider.java,v >retrieving revision 1.2 >diff -u -r1.2 WindowsProxyProvider.java >--- src/org/eclipse/core/internal/net/WindowsProxyProvider.java 14 Apr 2008 13:18:16 -0000 1.2 >+++ src/org/eclipse/core/internal/net/WindowsProxyProvider.java 6 May 2008 07:01:32 -0000 >@@ -27,8 +27,12 @@ > winHttpProxyProvider = new WinHttpProxyProvider(); > } > >- protected IProxyData[] getProxyData(URI uri) { >- return winHttpProxyProvider.getProxyData(uri); >+ public IProxyData[] getProxyData(URI uri) { >+ IProxyData[] pd = winHttpProxyProvider.getProxyData(uri); >+ // TODO - the provider might want to set a better source >+ for (int i = 0; i < pd.length; i++) >+ ((ProxyData) pd[i]).setSource("Windows"); //$NON-NLS-1$ >+ return pd; > } > > } >Index: src/org/eclipse/core/internal/net/ProxyManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java,v >retrieving revision 1.14 >diff -u -r1.14 ProxyManager.java >--- src/org/eclipse/core/internal/net/ProxyManager.java 18 Apr 2008 10:04:49 -0000 1.14 >+++ src/org/eclipse/core/internal/net/ProxyManager.java 6 May 2008 07:01:32 -0000 >@@ -7,6 +7,8 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Oakland Software Incorporated (Francis Upton) francisu@ieee.org >+ * Bug 228739 - add UI support to show actual system config > *******************************************************************************/ > package org.eclipse.core.internal.net; > >@@ -175,6 +177,28 @@ > doSetProxyData(proxies); > } > >+ // Used for the UI to see how we got the current system proxy config >+ public ProxyData[] getSystemProxyData() { >+ if (nativeProxyProvider == null) >+ return new ProxyData[] {}; >+ List pdList = new ArrayList(); >+ >+ try { >+ for (int i = 0; i < proxies.length; i++) { >+ ProxyType type = proxies[i]; >+ // All we care about is the protocol, the rest of the URI does not matter >+ IProxyData[] nativeResult = nativeProxyProvider.getProxyData(new URI(type >+ .getName() >+ + "://dummyhost")); //$NON-NLS-1$ >+ for (int nr = 0;nr < nativeResult.length; nr++) >+ pdList.add(nativeResult[nr]); >+ } >+ } catch (URISyntaxException e) { >+ Activator.logError("Unexpected exception", e); //$NON-NLS-1$ >+ } >+ return (ProxyData[]) pdList.toArray(new ProxyData[]{}); >+ } >+ > private void doSetProxyData(IProxyData[] proxyDatas) { > IProxyData[] oldData = getProxyData(); > String[] hosts = getNonProxiedHosts(); >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.net/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 18 Apr 2008 10:04:49 -0000 1.9 >+++ META-INF/MANIFEST.MF 6 May 2008 07:01:31 -0000 >@@ -12,7 +12,8 @@ > org.eclipse.osgi;bundle-version="3.4.0", > org.eclipse.equinox.registry;bundle-version="3.4.0" > Bundle-ActivationPolicy: lazy >-Export-Package: org.eclipse.core.internal.net;x-internal:=true, >+Export-Package: org.eclipse.core.internal.net;x-friends:="org.eclipse.ui.net", >+ org.eclipse.core.internal.net.proxy.unix, > org.eclipse.core.net.proxy > Bundle-RequiredExecutionEnvironment: J2SE-1.4, > CDC-1.0/Foundation-1.0, >Index: src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java,v >retrieving revision 1.3 >diff -u -r1.3 UnixProxyProvider.java >--- src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java 25 Apr 2008 14:08:02 -0000 1.3 >+++ src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java 6 May 2008 07:01:32 -0000 >@@ -25,10 +25,12 @@ > > public static boolean DEBUG = false; > >- private static boolean isGnomeLibLoaded = false; >- > public UnixProxyProvider() { >- // Nothing to initialize >+ // We have to load this on the main (UI) thread otherwise >+ // gconf seems to have problems causing hangs and various >+ // other bad behavior, please don't move this to be initialized >+ // on another thread. >+ loadGnomeLib(); > } > > /* >@@ -58,7 +60,6 @@ > } > > try { >- loadGnomeLib(); > npHosts = getGConfNonProxyHosts(); > if (npHosts != null && npHosts.length > 0) { > if (DEBUG) { >@@ -98,6 +99,7 @@ > pd = new ProxyData(protocol); > pd.setHost(uri.getHost()); > pd.setPort(uri.getPort()); >+ pd.setSource("Environment: " + envName); //$NON-NLS-1$ > String userInfo = uri.getUserInfo(); > if (userInfo != null) { > String user = null; >@@ -124,8 +126,8 @@ > > try { > // Then ask Gnome >- loadGnomeLib(); > pd = getGConfProxyInfo(protocol); >+ pd.setSource("Gnome"); //$NON-NLS-1$ > if (DEBUG) > System.out.println("Gnome proxy data: " + pd); //$NON-NLS-1$ > return pd; >@@ -150,18 +152,15 @@ > } > > private static void loadGnomeLib() { >- if (!isGnomeLibLoaded) { >- try { >- System.loadLibrary("proxygnome"); //$NON-NLS-1$ >- gconfInit(); >- isGnomeLibLoaded = true; >- if (DEBUG) >- System.out.println("Loaded (Gnome) libraries"); //$NON-NLS-1$ >- } catch (UnsatisfiedLinkError ex) { >- // Expected on systems that are missing Gnome libraries >- if (DEBUG) >- System.out.println("Missing gconf (Gnome) libraries"); //$NON-NLS-1$ >- } >+ try { >+ System.loadLibrary("proxygnome"); //$NON-NLS-1$ >+ gconfInit(); >+ if (DEBUG) >+ System.out.println("Loaded (Gnome) libraries"); //$NON-NLS-1$ >+ } catch (UnsatisfiedLinkError ex) { >+ // Expected on systems that are missing Gnome libraries >+ if (DEBUG) >+ System.out.println("Missing gconf (Gnome) libraries"); //$NON-NLS-1$ > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 228739
:
97571
| 98755 |
115783
|
118282
|
118360