Modify

Opened 9 years ago

Closed 9 years ago

#13510 closed defect (fixed)

View menu items are not disabled after last OSM data layer was removed

Reported by: openstreetmap.org-user-d1g Owned by: team
Priority: minor Milestone: 16.10
Component: Core Version:
Keywords: regression gsoc-core menu zoom Cc: michael2402

Description

What steps will reproduce the problem?

  1. create New layer
  2. remove it

What is the expected result?

Items in "Help/Menu/View" menu should be disabled, because there nothing to view/zoom/pan

What happens instead?

Items 4 and 5 are normal buttons

Please provide any additional information below. Attach a screenshot if possible.

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-09-01 20:56:44 +0200 (Thu, 01 Sep 2016)
Build-Date:2016-09-02 01:33:38
Revision:10929
Relative:URL: ^/trunk

Attachments (0)

Change History (13)

comment:1 by openstreetmap.org-user-d1g, 9 years ago

Keywords: disableditems added

comment:2 by Klumbumbus, 9 years ago

Do you mean "zoom in" and "zoom out"?

comment:3 by Don-vip, 9 years ago

Milestone: 16.08
Priority: trivialminor

comment:4 by Don-vip, 9 years ago

Keywords: regression added; disableditems removed

comment:5 by Don-vip, 9 years ago

Cc: michael2402 added
Keywords: gsoc-core added

@Michael: ZoomInAction.updateEnabledState() is called during layerRemoving event. At this time Main.getLayerManager().getLayers() is not (yet) empty. What's the best way to fix this?

comment:6 by michael2402, 9 years ago

There are several options for that:

  • Register a LayerAvailabilityListener if we want to know if any layer is present or not (I prefer this one)
  • Register a ActiveLayerChangeListener if the option depends on the active layer (which may be null).
  • Use isLastLayer() on the LayerRemoveEvent to see if the last layer was removed. (quick, dirty)

The nice way would be to have a unified way for all menus to be disabled if all items are disabled. Then the menu items can simply be disabled. This is what I did in my main menu branch. We could bind the zoom actions directly to the map view and add them whenever the map view is added to the view, remove them otherwise.

Last edited 9 years ago by michael2402 (previous) (diff)

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

Keywords: menu zoom added
Milestone: 16.0816.09

Replying to michael2402:

The nice way would be to have a unified way for all menus to be disabled if all items are disabled. Then the menu items can simply be disabled. This is what I did in my main menu branch.

OK let's fix this in next milestone then.

comment:8 by simon04, 9 years ago

Milestone: 16.0916.10

Milestone renamed

comment:9 by simon04, 9 years ago

Milestone: 16.1016.11

comment:10 by Don-vip, 9 years ago

Milestone: 16.1116.12

Milestone renamed

comment:11 by Don-vip, 9 years ago

Milestone: 16.1217.01

comment:12 by Don-vip, 9 years ago

Milestone: 17.0117.02

comment:13 by Don-vip, 9 years ago

Milestone: 17.0216.10
Resolution: fixed
Status: newclosed

This has been fixed in r10998.

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.