Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years 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 5 years ago.
Add tab "Installation Detais" to About JOSM popup
inst-details.PNG (52.2 KB ) - added by GerdP 5 years ago.
17192-v2.patch (5.5 KB ) - added by GerdP 5 years ago.
2019-01-12_19-33.png (54.3 KB ) - added by simon04 5 years ago.
17192-v3.patch (6.1 KB ) - added by GerdP 5 years ago.
17192-v4.patch (6.1 KB ) - added by GerdP 5 years ago.
Hopefully final version
AboutInstallationDetails_screenshot.png (52.2 KB ) - added by GerdP 5 years ago.
17192-v5.patch (8.0 KB ) - added by GerdP 5 years ago.
v5.PNG (55.5 KB ) - added by GerdP 5 years ago.

Download all attachments as: .zip

Change History (41)

comment:1 by Klumbumbus, 5 years ago

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 by GerdP, 5 years ago

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 by GerdP, 5 years ago

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

comment:4 by GerdP, 5 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?

Last edited 5 years ago by Don-vip (previous) (diff)

by GerdP, 5 years ago

Attachment: 17192.patch added

Add tab "Installation Detais" to About JOSM popup

by GerdP, 5 years ago

Attachment: inst-details.PNG added

comment:5 by GerdP, 5 years ago

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

comment:6 by GerdP, 5 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

comment:7 by Don-vip, 5 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.

in reply to:  4 comment:8 by Don-vip, 5 years ago

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 by Don-vip, 5 years ago

Milestone: 19.01

in reply to:  7 comment:10 by GerdP, 5 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?

comment:11 by simon04, 5 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 GerdP, 5 years ago

Attachment: 17192-v2.patch added

in reply to:  11 comment:12 by GerdP, 5 years ago

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 5 years ago by GerdP (previous) (diff)

by simon04, 5 years ago

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

comment:13 by simon04, 5 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 GerdP, 5 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 GerdP, 5 years ago

Attachment: 17192-v3.patch added

comment:15 by GerdP, 5 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?

in reply to:  15 comment:16 by simon04, 5 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 Don-vip, 5 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)

by GerdP, 5 years ago

Attachment: 17192-v4.patch added

Hopefully final version

comment:18 by simon04, 5 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 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 by GerdP, 5 years ago

Resolution: fixed
Status: newclosed

In 14693/josm:

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

comment:20 by simon04, 5 years ago

Very nice, thank you!

comment:21 by GerdP, 5 years ago

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.

by GerdP, 5 years ago

Attachment: 17192-v5.patch added

by GerdP, 5 years ago

Attachment: v5.PNG added

comment:22 by GerdP, 5 years ago

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

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

comment:23 by GerdP, 5 years ago

Resolution: fixed
Status: reopenedclosed

In 14701/josm:

fix #17192 Improve about installation details dialog

comment:24 by stoecker, 5 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?

comment:25 by GerdP, 5 years ago

See comment:21 Working on it...

comment:26 by GerdP, 5 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)?

in reply to:  26 comment:27 by stoecker, 5 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.

comment:28 by GerdP, 5 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?

in reply to:  28 comment:29 by stoecker, 5 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).

comment:30 by GerdP, 5 years ago

OK, reload worked. Thanks for the explanation.

comment:31 by simon04, 5 years ago

In 14707/josm:

see #17192 - Harmonize "<unset>" with advanced preference

comment:32 by Don-vip, 5 years ago

Ticket #17212 has been marked as a duplicate of this ticket.

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.