Opened 13 years ago
Closed 13 years ago
#6880 closed enhancement (fixed)
[Patch] Relation editor closes on ESC without asking for confirmation
Reported by: | Owned by: | team | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | tested |
Keywords: | Cc: |
Description (last modified by )
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)
Change History (8)
comment:1 by , 13 years ago
follow-up: 3 comment:2 by , 13 years ago
Please find enclosed my first patch for JOSM. Hope it looks like Java, not like C#...
comment:3 by , 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 , 13 years ago
Attachment: | GenericRelationEditor.patch added |
---|
comment:4 by , 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.
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.