Modify

Opened 4 years ago

Closed 4 years ago

#12438 closed enhancement (fixed)

[patch] hide items from list of recently added tags

Reported by: kolesar Owned by: team
Priority: normal Milestone: 16.02
Component: Core Version:
Keywords: Cc:

Description

Added option to hide items from list of recently added tags that have key that already exists in selection. Also added option to keep these items enabled even they would replace existing tag. Popup menu on add tag dialog looks like this:

    Recent tags with existing key
    ( ) Enable
    (o) Disable
    ( ) Hide

Hiding already applied items allows better usage of available space in dialog. When a tag is applied to the selection, item hides from list. If apply was called without closing the dialog then list is refreshed immediately.

For backwards compatibility immediate refresh can be disabled. Created another menu item for setting this behaviour:

    Refresh recent tags list after applying tag
    ( ) Refresh tag status and list of recently added tags
    (o) Refresh tag status only
    ( ) No refresh

In the first case newly added tag shows first on top of recently used tags (if not hidden). Second case does not add/reorder list of recent tags immediately but refreshes status of tags (disabled or hidden) according to selection. In the third case nothing happens in the list (this was before this patch).

Default values of setting are shown above as (o). Previous behaviour was Disable + No refresh. I think new default setting is better than before.

Requires #12421 that made changes at the same location of code.

Attachments (2)

HideItemsFromRecentlyAddedTags.patch (17.8 KB) - added by kolesar 4 years ago.
Versteck.png (9.8 KB) - added by Klumbumbus 4 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 in reply to:  description ; Changed 4 years ago by bastiK

Replying to kolesar:

For backwards compatibility immediate refresh can be disabled. Created another menu item for setting this behaviour:

    Refresh recent tags list after applying tag
    ( ) Refresh tag status and list of recently added tags
    (o) Refresh tag status only
    ( ) No refresh

Do we really need this configuration option? You should simply make the default behavior good enough, so no one feels the need to change it.

comment:2 in reply to:  1 ; Changed 4 years ago by kolesar

Replying to bastiK:

Do we really need this configuration option? You should simply make the default behavior good enough, so no one feels the need to change it.

Absolutely needed. User can choose value from three options and backwards compatibility option is only one of them. The other two are also important.

Hide works best with the first option (full refresh), Disable with the second (refresh tags status only). When hiding used keys immediate refresh is very cool because it refreshes list and thus reuses space with tags that did not fit into dialog. For convenience options can be mixed together. If someone does not like immediate reordering with hiding, can choose one of the lower options. Others may like reordering with Disable or even Enable.

Last edited 4 years ago by kolesar (previous) (diff)

comment:3 in reply to:  2 Changed 4 years ago by bastiK

Replying to kolesar:

Replying to bastiK:

Do we really need this configuration option? You should simply make the default behavior good enough, so no one feels the need to change it.

Absolutely needed.

Alright then... :)

Could you please update the patch?

comment:4 Changed 4 years ago by kolesar

Refreshed patch. Added javadoc comments to all public methods in TagEditHelper.

(I have started using Eclipse, errors and warnings are helpful, but still can't start JOSM from Eclipse.)

Changed 4 years ago by kolesar

comment:5 Changed 4 years ago by bastiK

Resolution: fixed
Status: newclosed

In 9743/josm:

applied #12438 - hide items from list of recently added tags (patch by kolesar; minor changes)

comment:6 in reply to:  4 ; Changed 4 years ago by bastiK

Milestone: 16.02

Replying to kolesar:

Refreshed patch. Added javadoc comments to all public methods in TagEditHelper.

Thanks!

(I have started using Eclipse, errors and warnings are helpful, but still can't start JOSM from Eclipse.)

Any error messages? Running it from Eclipse will be useful, at least for interactive debugging and running the tests.

comment:7 Changed 4 years ago by Klumbumbus

Resolution: fixed
Status: closedreopened

There is a problem with translation. "Hide" is already in use for item "Facilities/Hunting Stand" check "Hide" see https://translations.launchpad.net/josm/trunk/+pots/josm/de/5982/+translate

How to solve? Add translation context here or in defaultpresets.xml?


Changed 4 years ago by Klumbumbus

Attachment: Versteck.png added

comment:8 in reply to:  6 ; Changed 4 years ago by kolesar

Replying to bastiK:

(I have started using Eclipse, errors and warnings are helpful, but still can't start JOSM from Eclipse.)

Any error messages? Running it from Eclipse will be useful, at least for interactive debugging and running the tests.

Eclipse gives 9 errors about The method seconds(int) is undefined for the type Timeout and 7681 warnings about different topics.

When finished build, a popup asks: Errors exists in required project(s): josm Proceed with launch? If I click Proceed, the following error is printed to console:

ERROR: java.io.IOException: Failed to open input stream for resource 'resource://data/preferences.xsd'
java.io.IOException: Failed to open input stream for resource 'resource://data/preferences.xsd'
	at org.openstreetmap.josm.io.CachedFile.getInputStream(CachedFile.java:205)
	at org.openstreetmap.josm.data.Preferences.validateXML(Preferences.java:1644)
	at org.openstreetmap.josm.data.Preferences.load(Preferences.java:900)
	at org.openstreetmap.josm.data.Preferences.init(Preferences.java:970)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:358)

At the same time a JOSM popup is displayed: Preferences file had errors. If I press OK, a new error is displayed:

ERROR: java.lang.RuntimeException: java.io.IOException: Failed to open input stream for resource 'resource://data/fonts/DroidSans.ttf'. Cause: java.io.IOException: Failed to open input stream for resource 'resource://data/fonts/DroidSans.ttf'
java.lang.RuntimeException: java.io.IOException: Failed to open input stream for resource 'resource://data/fonts/DroidSans.ttf'
	at org.openstreetmap.josm.tools.FontsManager.initialize(FontsManager.java:43)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:384)
Caused by: java.io.IOException: Failed to open input stream for resource 'resource://data/fonts/DroidSans.ttf'
	at org.openstreetmap.josm.io.CachedFile.getInputStream(CachedFile.java:205)
	at org.openstreetmap.josm.tools.FontsManager.initialize(FontsManager.java:40)
	... 1 more

JOSM stops here.

comment:9 in reply to:  8 ; Changed 4 years ago by bastiK

Replying to kolesar:

Replying to bastiK:

(I have started using Eclipse, errors and warnings are helpful, but still can't start JOSM from Eclipse.)

Any error messages? Running it from Eclipse will be useful, at least for interactive debugging and running the tests.

Eclipse gives 9 errors about The method seconds(int) is undefined for the type Timeout and 7681 warnings about different topics.

Maybe using an old version of junit? Make sure you have up-to-date Eclipse (4.5.1).

ERROR: java.io.IOException: Failed to open input stream for resource 'resource://data/preferences.xsd'

The resources must be in classpath (i.e. copied to the .jar file). This should work automatically if you are using the preconfigured project in the repository. (File > Import... > General > Existing Project)
We use some kind of hack for this: Check project properties > Java Build Path. In the source tab, it should have entries JOSM/data, JOSM/styles with output folder set to JOSM/bin2/...
Then there should be two predefined run configurations (java 7 and 8). In the Classpath tab under user entries, there must be an entry "bin2".

comment:10 in reply to:  9 Changed 4 years ago by kolesar

Replying to bastiK:

The resources must be in classpath (i.e. copied to the .jar file). This should work automatically if you are using the preconfigured project in the repository. (File > Import... > General > Existing Project)

Thank you, importing was the key to the solution. I have followed DevelopersGuide/Compiling that told me: "Just add a new Java Project using the JOSM source folder as existing path." This way did not work, importing works. Updated wiki page.

comment:11 in reply to:  9 Changed 4 years ago by Don-vip

Replying to bastiK:

Replying to kolesar:

Eclipse gives 9 errors about The method seconds(int) is undefined for the type Timeout and 7681 warnings about different topics.

Maybe using an old version of junit? Make sure you have up-to-date Eclipse (4.5.1).

This is new in JUnit 4.12. You must either use latest Eclipse (>= 4.5) or configure the classpath with older versions of Eclipse as Luna does only include JUnit 4.11.

comment:12 in reply to:  7 Changed 4 years ago by Don-vip

Replying to Klumbumbus:

There is a problem with translation. "Hide" is already in use for item "Facilities/Hunting Stand" check "Hide" see https://translations.launchpad.net/josm/trunk/+pots/josm/de/5982/+translate

How to solve? Add translation context here or in defaultpresets.xml?

I would say in presets. We're more likely to use "Hide" without context to refer to an UI item rather than a hunting stand :)

comment:13 Changed 4 years ago by Klumbumbus

In 9772/josm:

see #12438 - add translation context for "Hide"

comment:14 Changed 4 years ago by Klumbumbus

Resolution: fixed
Status: reopenedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
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.