Opened 7 years ago
Last modified 7 years ago
#13765 new enhancement
[patch needs rework] adding a button to test the proxy settings
Reported by: | alno | Owned by: | team |
---|---|---|---|
Priority: | trivial | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | preferences, connection settings, proxy settings | Cc: |
Description
Hello,
I would like to submit the following patch to enhance a little bit the proxy settings panel in the preferences.
It just adds a button that saves the current proxy settings and tests the connection against the startup page of the wiki.
A label below the button shows the test result, enabling the user to know immediately if the entered settings are working or not.
I hope this helps! :)
Attachments (2)
Change History (5)
Changed 7 years ago by
Attachment: | josm-testing-proxy-button.patch added |
---|
Changed 7 years ago by
Attachment: | josm-testing-proxy-button-v2.patch added |
---|
comment:1 Changed 7 years ago by
attachment:josm-testing-proxy-button-v2.patch contains little modifications. The patch works nicely. What I find counter intuitive (as a user) is that I have to save the not-yet-known-to-be-working settings to test them. That is, if the test fails, I don't want to have the proxy settings saved. Would you consider the following pseudocode feasible?
OldSettings oldSettings = saveToPreferences(); try { testConnection(); // show test result } finally { restore(oldSettings); }
comment:2 Changed 7 years ago by
Hi, thanks a lot for your remarks!
As the proxy settings really need to be stored before thay are used (either in real case or for testing purposes), I had to save the user inputs before trying to test them. I don't know if in other popular applications the things are done in the same way, i.e. in Firefox, when you change the proxy settings with invalid ones, it is not clear wether the old settings are restored or kept until the user changes them again for valid ones.
I've been looking around in the code in order to find how I could implement some sort of backup of the settings before saving the settings that are about to be tested. Unfortunately, it appears more difficult to achieve this than what I expected, as there is no already existing object that represents the proxy settings as they are stored on disk. I think I'll need more time to find a solution for that.
I hope that more people will bring their opinion about my proposal :)
comment:3 Changed 7 years ago by
Summary: | [patch] adding a button to test the proxy settings → [patch needs rework] adding a button to test the proxy settings |
---|
I agree with Simon. There doesn't seem to be a particularly elegant way to store the settings. You kind of need to follow initFromPreferences
and save all those values. Later on re-apply the saved values similar to saveToPreferences()
.
patch file generated with NetBeans 8 subversion client