Modify

Opened 9 years ago

Closed 9 years ago

Last modified 5 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 9 years ago.
Versteck.png (9.8 KB ) - added by Klumbumbus 9 years ago.

Download all attachments as: .zip

Change History (17)

in reply to:  description ; comment:1 by bastiK, 9 years ago

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.

in reply to:  1 ; comment:2 by kolesar, 9 years ago

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 9 years ago by kolesar (previous) (diff)

in reply to:  2 comment:3 by bastiK, 9 years ago

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 by kolesar, 9 years ago

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

comment:5 by bastiK, 9 years ago

Resolution: fixed
Status: newclosed

In 9743/josm:

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

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

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 by Klumbumbus, 9 years ago

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?


by Klumbumbus, 9 years ago

Attachment: Versteck.png added

in reply to:  6 ; comment:8 by kolesar, 9 years ago

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.

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

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

in reply to:  9 comment:10 by kolesar, 9 years ago

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.

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

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.

in reply to:  7 comment:12 by Don-vip, 9 years ago

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 by Klumbumbus, 9 years ago

In 9772/josm:

see #12438 - add translation context for "Hide"

comment:14 by Klumbumbus, 9 years ago

Resolution: fixed
Status: reopenedclosed

comment:15 by skyper, 5 years ago

Needs to be documented, see Help/Dialog/AddValue

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