Modify

#6880 closed enhancement (fixed)

[Patch] Relation editor closes on ESC without asking for confirmation

Reported by: Bernhard Hiller Owned by: team
Priority: normal Component: Core
Version: tested Keywords:
Cc:

Description (last modified by skyper)

The relations editor can be closed by pressing ESC (Version 4279). It does not ask for a confirmation, even when the relation was edited. Thus some work can get lost.
Background: I edited some cycle routes. While the relations editor was opened, I edited some ways (divide them, correct the position of nodes, add nodes, even add complete ways); for getting rid of the editing mode for ways, I use the ESC key. Sometimes the relation editor happened to have the focus and was closed...
A simple confirmation message box for closing the editor on ESC (when the relation is "dirty") should be added, e.g.
"You are about to close the relations editor without saving. All your changes to the relation will be lost. Are you sure?"
Yes: close without saving
No: save the changes, and close the editor
Cancel: do not close the editor

Attachments (2)

GenericRelationEditor.zip (11.1 KB) - added by Bernhard Hiller <bhil@…> 20 months ago.
Patch
GenericRelationEditor.patch (5.0 KB) - added by bhil@… 20 months ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 20 months ago by Bernhard Hiller <bhil@…>

Meanwhile I coped with setting up a computer with Eclipse and the JOSM source code (though Eclipse uses to crash very often while debugging - hence I won't be able to develop a patch). My analysis so far:
The CancelAction of the GeneralRelationEditor only does a setVisible(false). A check like in the OKAction for tagEditor.getModel().isDirty() or !memberTableModel.hasSameMembersAs(getRealtionSnapshot()) is required.
And I found another problem here: though the click on Cancel and pressing the ESC key are handled by CancelAction, closing the window by a click on the "X" is not handled.

Changed 20 months ago by Bernhard Hiller <bhil@…>

Patch

comment:2 follow-up: Changed 20 months ago by Bernhard Hiller <bhil@…>

Please find enclosed my first patch for JOSM. Hope it looks like Java, not like C#...

comment:3 in reply to: ↑ 2 Changed 20 months ago by skyper

  • Description modified (diff)
  • Summary changed from Relation editor closes on ESC without asking for confirmation to [Patch] Relation editor closes on ESC without asking for confirmation

Replying to Bernhard Hiller <bhil@…>:

Please find enclosed my first patch for JOSM. Hope it looks like Java, not like C#...

Please attach patches as .patch files. Otherwise the syntax highlighting does not work and add [Patch] to the summary as a better eye spot.

Thanks

Changed 20 months ago by bhil@…

comment:4 Changed 19 months ago by bastiK

Such a dialog would have 2 purposes:

  • Preventing data loss when user presses Esc without the intention to cancel relation editor.


A confirmation pop up seems like a good idea. But I think your new dialog has confusingly many options. In addition, the options "Discard" and "Cancel" have the same icon. Maybe drop the first button and find better images?

  • Educating the user how the relation editor works. (Changes made in this dialog are temporary and you have click "Ok" to make the result visible to the rest of JOSM.)

There is a less obtrusive way to achieve this: Move the "apply" button from the upper left to the bottom button row. The Cancel / Ok / Apply pattern should be well known and easy to recognize for Windows and KDE users, so no extra dialog would be necessary. Ideally, the Apply button would be disabled when there are no pending changes.

comment:5 Changed 19 months ago by skyper

Ticket #7008 has been marked as a duplicate of this ticket.

comment:6 Changed 19 months ago by stoecker

  • Resolution set to fixed
  • Status changed from new to closed

In [4563/josm]:

fix #6880 - patch by Bernhard Hiller - Ask for confirmation when closing relation editor

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.