Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13516 closed defect (fixed)

Layers dialog buttons remains enabled even if no layer is selected

Reported by: Don-vip Owned by: team
Priority: normal Milestone: 16.10
Component: Core Version:
Keywords: template_report gsoc-core regression layer Cc: michael2402

Description

What steps will reproduce the problem?

  1. Create two empty data layers (Ctrl-N twice)
  2. Delete the first one
  3. Note that the second layer is not selected, but the buttons of layers dialog (move up, delete, etc.) remain enabled and inoperant (as no layer is selected)

What is the expected result?

  1. buttons should all be disabled if no layer is selected
  2. second layer should become selected when the first one is deleted


Build-Date:2016-09-02 23:21:42
Revision:10932
Is-Local-Build:true

Identification: JOSM/1.5 (10932 SVN en) Windows 10 64-Bit
Memory Usage: 796 MB / 3634 MB (547 MB allocated, but free)
Java version: 1.8.0_102-b14, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1920x1080, \Display1 1920x1080, \Display2 1280x1024, 
Maximum Screen Size: 1920x1080
VM arguments: [-Dfile.encoding=UTF-8]
Program arguments: [--debug]
Dataset consistency test: No problems found

Plugins:
+ apache-commons (32699)
+ ejml (32680)
+ geotools (32813)
+ jts (32699)
+ opendata (32898)
+ pbf (32865)
+ pointInfo (32870)
+ utilsplugin2 (32815)

Map paint styles:
+ %UserProfile%\Desktop\test.mapcss

Last errors/warnings:
- W: Failed to load Mappaint styles from '%UserProfile%\Desktop\test.mapcss'. Exception was: java.io.FileNotFoundException: %UserProfile%\Desktop\test.mapcss (Le fichier spécifié est introuvable)
- E: java.io.FileNotFoundException: %UserProfile%\Desktop\test.mapcss (Le fichier spécifié est introuvable)
- W: Initializing map style %UserProfile%\Desktop\test.mapcss completed in 97 ms (1 errors, 0 warnings)
- E: <josm.pref>\plugins\opendata\resources\org\openstreetmap\josm\plugins\opendata\modules\fr\datagouvfr\datasets\agriculture\RegistreParcellaire.mapcss (Le chemin d’accès spécifié est introuvable)

Attachments (2)

bug.PNG (7.5 KB ) - added by Don-vip 8 years ago.
delete_layers.gif (152.1 KB ) - added by Klumbumbus 8 years ago.

Download all attachments as: .zip

Change History (12)

by Don-vip, 8 years ago

Attachment: bug.PNG added

comment:1 by michael2402, 8 years ago

... and it only works if there is only 1 layer remaining. If you have 2 remaining layers, the selection is changed correctly.

by Klumbumbus, 8 years ago

Attachment: delete_layers.gif added

comment:2 by Klumbumbus, 8 years ago

The selection jumps between the first and second entry when deleting multiple layers.

comment:3 by Don-vip, 8 years ago

Regression between r10268 and r10276.

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

comment:4 by Don-vip, 8 years ago

Keywords: layer added

It's a regression from r10271, r10273, r10274 ==> Diff

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

comment:5 by Don-vip, 8 years ago

Michael, I think the best way to handle it is to restore the old event logic: trigger an event after a layer has been removed.

comment:6 by Don-vip, 8 years ago

Milestone: 16.0816.09

comment:7 by michael2402, 8 years ago

Yes, we could do this.

The problem I had with it is that the remove event should not even depend on the active layer. Some layers called remove() for an other layer during the remove listener. This makes such behavior unpredictable.

I now added the option to schedule events for later removal to the remove event which avoids this problem, so we can change the event back to fire after the layer was removed.

comment:8 by michael2402, 8 years ago

Resolution: fixed
Status: newclosed

In 10998/josm:

Make layer remove event fire after the layer has been removed. This fixes #13485. Fixes #13516.

comment:9 by michael2402, 8 years ago

I checked the places where listeners may access other layers. There are no more dependencies of the removed layer being in the list other than the validator layer (which was my main concern in the first place). The validator layer uses scheduleRemoval now, so we should be fine.

By the way, we should consider it bad practice to modify the layer list inside the listeners. This causes inconsistencies in the order the listeners are fired.

comment:10 by simon04, 8 years ago

Milestone: 16.0916.10

Milestone renamed

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.