Modify

Opened 7 years ago

Closed 7 years ago

#7327 closed enhancement (fixed)

[Patch] show hint in undo-menu which action will be undone (from event stack)

Reported by: dieterdreist Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: undo stack buffer menu Cc:

Description

It would improve usability if the "undo" and "redo" text from the "edit" menu would be extended by the actual action that will be undone or redone (e.g. "undo delete node" instead of "undo"). This information is already available in the undo-buffer, but displaying it in the menu would improve the user experience and avoid some errateous undos.

Attachments (1)

7327.patch (6.6 KB) - added by simon04 7 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 7 years ago by akks

It is hard to implement, beacuse menu items are constructed at startup...

Changed 7 years ago by simon04

Attachment: 7327.patch added

comment:2 Changed 7 years ago by simon04

Summary: show hint in undo-menu which action will be undone (from event stack)[Patch] show hint in undo-menu which action will be undone (from event stack)

It was not too difficult to implement. Just needed to add the menu items as CommandQueueListener to UndoRedoHandler.

Currently each Command must provide a JLabel getDescription() method. I'd consider it better to request String getDescriptionText() and ImageIcon getDescriptionIcon() instead as this allows to use the data in other places as well without doing quirks (cf. String Command.getDescrpitionText() in patch).

comment:3 in reply to:  2 Changed 7 years ago by bastiK

Replying to simon04:

Currently each Command must provide a JLabel getDescription() method. I'd consider it better to request String getDescriptionText() and ImageIcon getDescriptionIcon() instead as this allows to use the data in other places as well without doing quirks (cf. String Command.getDescrpitionText() in patch).

Good idea. You can remove old method MutableTreeNode description() (and depricate JLabel getDescription()).

comment:4 Changed 7 years ago by akks

It is simpler than I thought :) Will it fit OK in menu on small screens?

comment:5 Changed 7 years ago by dieterdreist

maybe it won't fit. Would it be possible to get this as tooltip? (the overlay displayed besides the mouse cursor if you remain longer over a menu item or button. It could substitute the current tooltip "undo the last action" with "undo xyz" where xyz is the last action.

comment:6 in reply to:  5 Changed 7 years ago by simon04

Replying to dieterdreist:

maybe it won't fit. Would it be possible to get this as tooltip? (the overlay displayed besides the mouse cursor if you remain longer over a menu item or button. It could substitute the current tooltip "undo the last action" with "undo xyz" where xyz is the last action.

That is easily possible.

For the menu text, we could truncate after e.g. 3 words. Does this work with I18N, especially with right-to-left-languages?

comment:7 Changed 7 years ago by simon04

Resolution: fixed
Status: newclosed

In [4908/josm]:

fix #7327 - show hint in undo-menu which action will be undone (from event stack)

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.