Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 228739

Summary: [Proxy] add UI support to see what the automatically detected proxy settings are
Product: [Eclipse Project] Platform Reporter: Francis Upton IV <francisu>
Component: TeamAssignee: Pawel Pogorzelski <pawel.pogorzelski1>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: Kevin_McGuire, krzysztof.daniel, Szymon.Brandys
Version: 3.4   
Target Milestone: 3.5 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch for UI and underlying changes
none
Revised patch to have all changes in one place
none
Screenshot
none
Patch_v01
none
Patch_v02 pawel.pogorzelski1: iplog+

Description Francis Upton IV CLA 2008-04-24 14:53:42 EDT
With bug 180921 and bug 226462 it will automatically detect the proxy settings in various ways depending on the platform.

However this is currently done silently, so the user may find themselves using a proxy and not knowing why or how.  

This will provide a means to tell the user what the current automatic settings are and how they were detected.

A patch will be provided.
Comment 1 Francis Upton IV CLA 2008-04-25 02:45:20 EDT
Created attachment 97571 [details]
Patch for UI and underlying changes

This depends also on the patch for bug 226462.

This adds a "show" button to the proxy preferences that shows the current detected system values.

It also changes the language slightly in the existing system proxy selection button tooltip.
Comment 2 Szymon Brandys CLA 2008-04-25 10:07:09 EDT
Me to review.
Comment 3 Szymon Brandys CLA 2008-05-02 18:20:36 EDT
Francis, this patch is incomplete. ProxyData#getSource which should be in this patch, was added to another one and I didn't commit it. 

I believe it is better to have in a patch only changes that are required to fix the bug and I avoid adding things that possibly can be useful somewhere else.

Anyway, I noticed that your changes contain new API and because we are past M6 we can't use it now. I think that we could create an example that contains dialog or view to test proxy, which will not be a part of SDK but will be available for people.
Comment 4 Francis Upton IV CLA 2008-05-02 18:28:24 EDT
The patch was complete with the original patches for bug 226462, but as you said, you removed those changes.

This patch does not affect the API (I would not have submitted for M7 if it did), ProxyData is an internal class (note that I did not change IProxyData).

I strongly feel this patch is important for supportability in 3.4, and realize that it is now past the functional complete milestone M7, so I'm not sure what the process is to get it in.

I will revise the patch to make it self contained.  It was difficult to make the original patch self contained since it was tied up with the other two bug reports for the same work.
Comment 5 Szymon Brandys CLA 2008-05-02 19:23:59 EDT
(In reply to comment #4)
> The patch was complete with the original patches for bug 226462, but as you
> said, you removed those changes.

Right. I explained why, in my previous comment.

> This patch does not affect the API (I would not have submitted for M7 if it
> did), ProxyData is an internal class (note that I did not change IProxyData).

Right. I noticed that you use x-friends.
 
> I will revise the patch to make it self contained.  

This would be the best.

> I strongly feel this patch is important for supportability in 3.4, and realize
> that it is now past the functional complete milestone M7, so I'm not sure what
> the process is to get it in.

One comment about the patch. AFAIS it will present correctly only statically defined proxies. If we worked with dynamic stuff, the presented information would not be complete.

I think that this is a polishing issue. The information about system proxies is rather harsh now and we need to have a nicer message.
Comment 6 Francis Upton IV CLA 2008-05-02 19:27:15 EDT
(In reply to comment #5)
> 
> One comment about the patch. AFAIS it will present correctly only statically
> defined proxies. If we worked with dynamic stuff, the presented information
> would not be complete.
> 
> I think that this is a polishing issue. The information about system proxies is
> rather harsh now and we need to have a nicer message.
> 
I'm not sure what you mean by this.  The gnome proxy configuration for example is dynamic, when you change the settings in gnome, and then use the UI in this patch, you can see the updated settings.  The UI will get the current settings from the environment.  Is this what you mean, or something different?

Comment 7 Szymon Brandys CLA 2008-05-02 19:34:22 EDT
(In reply to comment #6)
> I'm not sure what you mean by this.  The gnome proxy configuration for example
> is dynamic, when you change the settings in gnome, and then use the UI in this
> patch, you can see the updated settings.  The UI will get the current settings
> from the environment.  Is this what you mean, or something different?
> 

So, even on gnome you can set PAC script (javascript file) as a source of proxy settings. It returns proxies relying on a given URL. So you can get different proxy settings for the same protocol but different hosts.



Comment 8 Francis Upton IV CLA 2008-05-02 19:38:42 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > I'm not sure what you mean by this.  The gnome proxy configuration for example
> > is dynamic, when you change the settings in gnome, and then use the UI in this
> > patch, you can see the updated settings.  The UI will get the current settings
> > from the environment.  Is this what you mean, or something different?
> > 
> 
> So, even on gnome you can set PAC script (javascript file) as a source of proxy
> settings. It returns proxies relying on a given URL. So you can get different
> proxy settings for the same protocol but different hosts.
> 
I did not try setting the PAC script on gnome, but I did try modifying the proxy settings in the preferences (changing the host/port, turning of the use of proxies, etc) and the modifications that I made were reflected in the Eclipse UI when I reopened the dialog (as they should be because it calls the proxy provider to get the current values and it reads them from gconf which is dynamically updated).

I'm not sure how the PAC stuff works with Gnome, if it sets the gconf settings based on the contents of the Javascript file, then it should update and we should see the new values (I suspect this is what it does).  If it relies on the consumer of the configuration (in this case Eclipse) to figure out the Javascript file, then it will have no effect (we don't do anything to look for the values in this file).

My implementation of the Gconf/Gnome stuff has the same functionality as what is built into the more recent versions of Java; whatever they did, that's what we do.

When I revise the patch I will see how it handles the PAC file.

Comment 9 Francis Upton IV CLA 2008-05-06 03:04:38 EDT
Created attachment 98755 [details]
Revised patch to have all changes in one place

Since this touches the UnixProxyProvider, it also has the changes for bug 230040 included, so hopefully that will be applied first.
Comment 10 Krzysztof Daniel CLA 2008-10-22 04:46:49 EDT
Created attachment 115783 [details]
Screenshot

Is this correct that the same proxy setting is displayed three times?

Maybe we do not need new dialog? Could not we just reorder options:

* Direct connection to the Internet
* System proxy configuration
* Manual proxy configuration

Then we could optionally put the settings into the border and:
(a) disable it when direct connection is selected
(b) prefill it with system settings when system proxy is selected, but still user should not be able to edit those settings
(c) enable it for edition, and place default values when the user wants to configure it manually.

I could imagine even hiding all those setting fields when direct connection is selected, and displaying it only when b or c occurs.

what do you think?
Comment 11 Francis Upton IV CLA 2008-10-22 04:53:31 EDT
(In reply to comment #10)

> what do you think?
> 

I think these ideas are good.  The original patch was created quickly to get something out there for a UI, your ideas certainly are better.  Keep in mind however that we probably want to be flexible in the UI to allow for changes in the proxy providers without having to alter the UI.  I don't remember all of the details of this, but the same UI needs to work with the Windows and Unix proxy providers and probably other proxy providers in the future.

Comment 12 Pawel Pogorzelski CLA 2008-10-22 05:52:53 EDT
System proxy configuration cannot share the same UI with manual configuration. This is because information about the proxy source has to be displayed per protocol. For Linux it is possible to set HTTP proxy as an environment variable and still have other protocols defined in GNOME.
Comment 13 Pawel Pogorzelski CLA 2008-11-18 05:20:22 EST
Bug 255616 has been created as a part of work originated from this bug.
Comment 14 Pawel Pogorzelski CLA 2008-11-19 11:48:29 EST
Created attachment 118282 [details]
Patch_v01

Patch that introduces the new proxy UI. Any feedback is welcome...
Comment 15 Szymon Brandys CLA 2008-11-20 08:40:27 EST
Comments:
- add class headers to new classes (e.g. ProxyEntryDialog)
-.classpath should not be modified
- NonProxyHostsComposite contains unused import
- ProxyEntryDialog line 199 -> warning
- on Windows, check "Use the same proxy server for all protocols" in the Windows OS proxy dialog. When I open the settings page in Eclipse you will not see any native entries.

Comment 16 Pawel Pogorzelski CLA 2008-11-20 08:50:22 EST
Created attachment 118360 [details]
Patch_v02

I've addressed first four comments. The fifth one is not connected with the patch provided, I opened a separate bug to track the issue. See bug 255959 for details.
Comment 17 Szymon Brandys CLA 2008-11-20 10:30:00 EST
Ok. Looks good.
Comment 18 Tomasz Zarna CLA 2008-11-20 10:51:16 EST
Released to HEAD.