#17192 closed enhancement (fixed)
[Patch] Show actual path to preferences.xml and other directories used by JOSM
Reported by: | GerdP | Owned by: | GerdP |
---|---|---|---|
Priority: | normal | Milestone: | 19.01 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description
Sometimes we tell users to remove/rename the preferences.xml but some users have difficulties to find the file. It seems JOSM doesn't show the actual path to that file anywhere. Maybe the status report should contain it so that we can tell the user where to search for it.
It would also be good to find that information via Help -> About
Attachments (9)
Change History (41)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Owner: | changed from | to
---|
In Eclipse you find a button "Installation Details" in the "About Eclipse" popup, but it's probably easier to add the info to the status report. I'll try to code that.
comment:3 by , 6 years ago
Off topic: Would it be difficult to produce a MacOS package for the "latest" version?
follow-up: 8 comment:4 by , 6 years ago
Hmm, both "Show Status Report" and "Report bug" use the same methods to anonymize the data.
I don't dare to change that. I've also noticed a possible bug: The method
ShowStatusReportAction.paramReplace()
is called twice in paramCleanup()
:
val = paramReplace(val, envJavaHome, envJavaHomeAlt); val = paramReplace(val, envJavaHome, envJavaHomeAlt);
Any idea why?
by , 6 years ago
Attachment: | inst-details.PNG added |
---|
comment:5 by , 6 years ago
comment:6 by , 6 years ago
Summary: | Show actual path to preferences.xml and other directories used by JOSM → [Patch] Show actual path to preferences.xml and other directories used by JOSM |
---|
follow-up: 10 comment:7 by , 6 years ago
It would be nice to replace this new text field by a table, and in the last column add a new browse button to directly open the related folder.
comment:8 by , 6 years ago
Replying to GerdP:
The method
ShowStatusReportAction.paramReplace()
is called twice inparamCleanup()
:
val = paramReplace(val, envJavaHome, envJavaHomeAlt); val = paramReplace(val, envJavaHome, envJavaHomeAlt);Any idea why?
Introduced in r10138. probably a copy/paste mistake, it looks safe to remove one line. Can you please do it while fixing this ticket?
comment:9 by , 6 years ago
Milestone: | → 19.01 |
---|
comment:10 by , 6 years ago
Replying to Don-vip:
It would be nice to replace this new text field by a table, and in the last column add a new browse button to directly open the related folder.
Yes, but I have no idea how. The popup was more or less my first self written Java Dialog ;)
Can you point me to an existing example in JOSM?
follow-up: 12 comment:11 by , 6 years ago
To get started with Swing tables, you could take a look at org.openstreetmap.josm.gui.preferences.imagery.CacheSettingsPanel
and org.openstreetmap.josm.io.remotecontrol.AddTagsDialog
. Basically you'll need a DefaultTableModel
and a JTable
.
by , 6 years ago
Attachment: | 17192-v2.patch added |
---|
comment:12 by , 6 years ago
Replying to simon04:
To get started with Swing tables, you could take a look at
org.openstreetmap.josm.gui.preferences.imagery.CacheSettingsPanel
andorg.openstreetmap.josm.io.remotecontrol.AddTagsDialog
. Basically you'll need aDefaultTableModel
and aJTable
.
Thanks, please review my first attempt in 17192-v2.patch.
by , 6 years ago
Attachment: | 2019-01-12_19-33.png added |
---|
comment:13 by , 6 years ago
Looks good. A few remarks or improvement suggestions from my tests on Linux:
- The
JFileChooser
is somewhat useless. I'd expect a system file-manager to be opened.OpenBrowser.displayUrl("file://" + dir);
does the trick (at least on Linux). - If
JAVA_HOME
is unset: display"(unset)"
in italic, and hide the open directory button
comment:14 by , 6 years ago
On Windows OpenBrowser.displayUrl("file://" + dir);
doesn't but OpenBrowser.displayUrl(new File(dir).toURI());
I assume that is also OK on Linux?
by , 6 years ago
Attachment: | 17192-v3.patch added |
---|
follow-up: 16 comment:15 by , 6 years ago
17192-v3.patch implements the proposed changes. I'd prefer to be able to use copy with the displayed directory name and open the file in my preferred NC clone Totalcommander. How's that done?
comment:16 by , 6 years ago
Replying to GerdP:
OpenBrowser.displayUrl(new File(dir).toURI());
I assume that is also OK on Linux?
Yes.
Replying to GerdP:
17192-v3.patch implements the proposed changes. I'd prefer to be able to use copy with the displayed directory name and open the file in my preferred NC clone Totalcommander. How's that done?
You could try JosmTextArea
(cf. org.openstreetmap.josm.actions.AboutAction#actionPerformed
or an example usage) or UrlLabel
.
comment:17 by , 6 years ago
I wouldn't use the "open" icon. Either "...", "Browse", or "Open location" would be better. Some spacing wouldn't hurt neither (increase the left/right insets when you add components)
comment:18 by , 6 years ago
I like it the way it looks and works. A few details, though:
- please spell
addInstLine
in full w/o the abbreviation (unset)
needs to be wrapped intr()
- optional: visibility of
org.openstreetmap.josm.actions.ShowStatusReportAction#paramCleanup(java.lang.String)
could be changed to package - Having
JAVA_HOME
unset, I get the following NPE:
2019-01-13 12:15:10.352 SEVERE: Handled by bug report queue: java.lang.NullPointerException java.lang.NullPointerException at org.openstreetmap.josm.actions.ShowStatusReportAction.paramReplace(ShowStatusReportAction.java:256) at org.openstreetmap.josm.actions.ShowStatusReportAction.paramCleanup(ShowStatusReportAction.java:244) at org.openstreetmap.josm.actions.AboutAction.addInstLine(AboutAction.java:184) at org.openstreetmap.josm.actions.AboutAction.actionPerformed(AboutAction.java:123) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
by , 6 years ago
Attachment: | AboutInstallationDetails_screenshot.png added |
---|
comment:21 by , 6 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I've started to update the wiki help page and noticed that the implementation in r14693 doesn't work well when josm.pref and josm.userdata point to the same directory :(
I think about a better solution now.
by , 6 years ago
Attachment: | 17192-v5.patch added |
---|
by , 6 years ago
comment:22 by , 6 years ago
comment:24 by , 6 years ago
You added lots of images, but didn't reference them in the wiki page Help/Action/About. Why? Should the old ones be replaced?
follow-up: 27 comment:26 by , 6 years ago
Done, please review. I did not yet update the translation screenshot because the corresponding text is not translated yet.
BTW: Who can I contact regarding spotbugs on Jenkins (#17206)?
comment:27 by , 6 years ago
Replying to GerdP:
Done, please review. I did not yet update the translation screenshot because the corresponding text is not translated yet.
I removed your double files and replaced the original ones.
follow-up: 29 comment:28 by , 6 years ago
Hmm, these screenshots don't show the new Installation Details tab. That's why I tried to update them.
How do you remove an attached screenshot via Trac?
comment:29 by , 6 years ago
Replying to GerdP:
Hmm, these screenshots don't show the new Installation Details tab. That's why I tried to update them.
Try reload!
How do you remove an attached screenshot via Trac?
Files from other users can only be handled by admins. In this case simply attach the new one and mention to Klumbumbus, Vincent or me, that we should replace them. Files from yourself you can replace yourself (with a checkbox on upload).
The path is anonymized in the status report by design to protect the users privacy.
A button "Open profile folder" in the status report window or in the about window would be better. I think the statusreport window fits better. (Thats how firefox does it: https://www.dev2qa.com/change-firefox-profile-using-webdriver/)