Modify

Opened 9 days ago

Closed 2 days ago

Last modified 2 days ago

#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)

17192.patch (2.8 KB) - added by GerdP 7 days ago.
Add tab "Installation Detais" to About JOSM popup
inst-details.PNG (52.2 KB) - added by GerdP 7 days ago.
17192-v2.patch (5.5 KB) - added by GerdP 6 days ago.
2019-01-12_19-33.png (54.3 KB) - added by simon04 6 days ago.
17192-v3.patch (6.1 KB) - added by GerdP 6 days ago.
17192-v4.patch (6.1 KB) - added by GerdP 6 days ago.
Hopefully final version
AboutInstallationDetails_screenshot.png (52.2 KB) - added by GerdP 2 days ago.
17192-v5.patch (8.0 KB) - added by GerdP 2 days ago.
v5.PNG (55.5 KB) - added by GerdP 2 days ago.

Download all attachments as: .zip

Change History (39)

comment:1 Changed 8 days ago by Klumbumbus

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/)

comment:2 Changed 8 days ago by GerdP

Owner: changed from team to GerdP

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 Changed 8 days ago by GerdP

Off topic: Would it be difficult to produce a MacOS package for the "latest" version?

comment:4 Changed 7 days ago by GerdP

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?

Last edited 7 days ago by Don-vip (previous) (diff)

Changed 7 days ago by GerdP

Attachment: 17192.patch added

Add tab "Installation Detais" to About JOSM popup

Changed 7 days ago by GerdP

Attachment: inst-details.PNG added

comment:5 Changed 7 days ago by GerdP

Please try the simple patch on Linux / MacOS. On Windows it looks like this

comment:6 Changed 7 days ago by GerdP

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

comment:7 Changed 7 days ago by 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.

comment:8 in reply to:  4 Changed 7 days ago by Don-vip

Replying to GerdP:

The method ShowStatusReportAction.paramReplace() is called twice in paramCleanup():

        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 Changed 7 days ago by Don-vip

Milestone: 19.01

comment:10 in reply to:  7 Changed 7 days ago by GerdP

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?

comment:11 Changed 6 days ago by simon04

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.

Changed 6 days ago by GerdP

Attachment: 17192-v2.patch added

comment:12 in reply to:  11 Changed 6 days ago by GerdP

Replying to simon04:

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.

Thanks, please review my first attempt in 17192-v2.patch.

Last edited 6 days ago by GerdP (previous) (diff)

Changed 6 days ago by simon04

Attachment: 2019-01-12_19-33.png added

comment:13 Changed 6 days ago by simon04

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 Changed 6 days ago by GerdP

On Windows OpenBrowser.displayUrl("file://" + dir); doesn't but OpenBrowser.displayUrl(new File(dir).toURI());
I assume that is also OK on Linux?

Changed 6 days ago by GerdP

Attachment: 17192-v3.patch added

comment:15 Changed 6 days ago by 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?

comment:16 in reply to:  15 Changed 6 days ago by simon04

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 Changed 6 days ago by Don-vip

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)

Changed 6 days ago by GerdP

Attachment: 17192-v4.patch added

Hopefully final version

comment:18 Changed 5 days ago by simon04

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 in tr()
  • 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)

comment:19 Changed 5 days ago by GerdP

Resolution: fixed
Status: newclosed

In 14693/josm:

fix #17192 Add tab with installation details in "About" popup

comment:20 Changed 5 days ago by simon04

Very nice, thank you!

Changed 2 days ago by GerdP

comment:21 Changed 2 days ago by GerdP

Resolution: fixed
Status: closedreopened

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.

Changed 2 days ago by GerdP

Attachment: 17192-v5.patch added

Changed 2 days ago by GerdP

Attachment: v5.PNG added

comment:22 Changed 2 days ago by GerdP

With 17192-v5.patch it looks like this on Windows:

Maybe I should move the line "Preferences are stored..." to the top?

comment:23 Changed 2 days ago by GerdP

Resolution: fixed
Status: reopenedclosed

In 14701/josm:

fix #17192 Improve about installation details dialog

comment:24 Changed 2 days ago by stoecker

You added lots of images, but didn't reference them in the wiki page Help/Action/About. Why? Should the old ones be replaced?

comment:25 Changed 2 days ago by GerdP

See comment:21 Working on it...

comment:26 Changed 2 days ago by GerdP

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 in reply to:  26 Changed 2 days ago by stoecker

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.

comment:28 Changed 2 days ago by GerdP

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 in reply to:  28 Changed 2 days ago by stoecker

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).

comment:30 Changed 2 days ago by GerdP

OK, reload worked. Thanks for the explanation.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain GerdP.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.