Modify

Opened 13 years ago

Closed 12 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 13 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by akks, 13 years ago

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

by simon04, 13 years ago

Attachment: 7327.patch added

comment:2 by simon04, 13 years ago

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).

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

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 by akks, 13 years ago

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

comment:5 by dieterdreist, 13 years ago

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.

in reply to:  5 comment:6 by simon04, 13 years ago

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

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. 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.