Modify

Opened 13 years ago

Closed 12 years ago

#6880 closed enhancement (fixed)

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

Reported by: Bernhard Hiller <bhil@…> Owned by: team
Priority: normal Milestone:
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@…> 13 years ago.
Patch
GenericRelationEditor.patch (5.0 KB ) - added by bhil@… 13 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Bernhard Hiller <bhil@…>, 13 years ago

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.

by Bernhard Hiller <bhil@…>, 13 years ago

Attachment: GenericRelationEditor.zip added

Patch

comment:2 by Bernhard Hiller <bhil@…>, 13 years ago

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

in reply to:  2 comment:3 by skyper, 13 years ago

Description: modified (diff)
Summary: Relation editor closes on ESC without asking for confirmation[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

by bhil@…, 13 years ago

Attachment: GenericRelationEditor.patch added

comment:4 by bastiK, 13 years ago

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 by skyper, 12 years ago

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

comment:6 by stoecker, 12 years ago

Resolution: fixed
Status: newclosed

In [4563/josm]:

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

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.