Opened 10 years ago
Last modified 9 years ago
#12522 closed enhancement
Advanced preferences: display default entries consistently — at Version 8
| Reported by: | bastiK | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | 16.02 |
| Component: | Core | Version: | |
| Keywords: | Cc: |
Description (last modified by )
In the advanced preference dialog, we do not show keys and default values for all settings that exist in the software. Instead we fill the list at runtime, whenever the value of a setting is requested in the code.
I noticed this is irritating and users often don't understand this concept.
It would be better, if the list of advanced preferences would consistently show all (or nearly all) available entries.
Proposed solutions:
- Central registry: Basically convert all
Main.pref.get(...)calls toStringPropertyand put those properties in a class that is loaded early. - When JOSM exits, write all known defaults to a cache file (
~/.josm/cache/default_preferences.xml) and load these entries back at next start.
edit:
- Static code analysis: Scrape the JOSM source code (or byte code) and collect all preference keys + default values. Then distribute this list in the .jar file and load at runtime.
Change History (11)
by , 10 years ago
| Attachment: | save_default_settings.patch added |
|---|
comment:1 by , 10 years ago
comment:3 by , 10 years ago
| Milestone: | → 16.02 |
|---|
comment:4 by , 10 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
Does not work:
- start JOSM without existing preference direction
- open preferences
- look for
properties.recently-added-tags
URL:http://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2016-10-19 17:30:15 +0200 (Wed, 19 Oct 2016) Build-Date:2016-10-20 01:37:11 Revision:11148 Relative:URL: ^/trunk Identification: JOSM/1.5 (11148 en) Linux Debian GNU/Linux 8.6 (jessie) Memory Usage: 527 MB / 882 MB (212 MB allocated, but free) Java version: 1.8.0_102-8u102-b14.1-1~bpo8+1-b14, Oracle Corporation, OpenJDK 64-Bit Server VM Java package: openjdk-8-jre:amd64-8u102-b14.1-1~bpo8+1 Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-9 Program arguments: [--language=en] Dataset consistency test: No problems found Plugins: + Mapillary (v1.3.1) + apache-commons (32699) + apache-http (32699) + imagery_offset_db (32796) + reverter (32796) + tag2link (32941) + undelete (32699) + utilsplugin2 (32815) + wikipedia (33017) Last errors/warnings: - W: java.net.SocketTimeoutException: Read timed out - E: java.net.SocketTimeoutException: Read timed out - W: Old style SideButton usage for action org.openstreetmap.josm.plugins.mapillary.gui.MapillaryChangesetDialog$SubmitAction@34da22e6 - W: Unable to get color from '' for color preference 'extrude.main.line' - W: Unable to get color from '' for color preference 'improve.way.accuracy.helper.line' - W: Unable to get color from '' for color preference 'make.parallel.helper.line'
comment:5 by , 10 years ago
(starting point was ticket:13717#comment:6)
Also there is no default_preferences.xml file in my cache folder.
comment:6 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
This works as intended:
- For advanced properties to show up in the list, they have to be "requested" at least once. In this case you have to add a tag once to register the property
properties.recently-added-tags. - The improvement in [9821] is that these entries will be remembered when JOSM is closed and reopened.
- The
cache/default_preferences.xmlwill be created when JOSM exits.
This is not perfect, but the next best solution (a) is much more involved.
comment:7 by , 10 years ago
Thanks for the explanation. Well, I still can't find the cache/default_preferences.xml file but JOSM correctly registers the preference key after it was requested and also remembers it after restart. So it works as you describe.
comment:8 by , 9 years ago
| Description: | modified (diff) |
|---|---|
| Resolution: | fixed |
| Status: | closed → reopened |
by , 9 years ago
| Attachment: | static_code_analysis-einstein_collector.patch added |
|---|
by , 9 years ago
| Attachment: | static_code_analysis-einstein_collector.2.patch added |
|---|



Attached is a patch for solution (b).