Opened 14 years ago

Closed 13 years ago

#8901 closed patch (Fixed)

Add undo/redo functionality to the cutlist editor

Reported by: Jim Stichnoth <stichnot@…> Owned by: sphery
Priority: minor Milestone: 0.25
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This patch adds an undo stack to the cutlist editor. I find this particularly useful because in the last two versions of the editor (the mythui-osd branch merge by markk and the subsequent reworked UI by mdean), making an editing mistake at one frame can irretrievably lose an editing mark at a different frame. This is in contrast to the original editor which generally operated on only single marks at a time.

The patch adds undo/redo entries to the cutlist menu, and also adds undo/redo keybindings (the "standard" ctrl+Z/ctrl+Y by default).

As an added bonus, the undo stack is preserved in-memory for the duration of playback, even if you exit and reenter the editor. (The undo entries are not stored in the DB.)

Attachments (7)

cutlist_undo_stack_v1.patch (19.1 KB) - added by Jim Stichnoth <stichnot@…> 14 years ago.
cutlist_undo_stack_v2.patch (11.1 KB) - added by Jim Stichnoth <stichnot@…> 14 years ago.
cutlist_undo_stack_v3.patch (19.0 KB) - added by Jim Stichnoth <stichnot@…> 14 years ago.
cutlist_undo_stack_v4.patch (19.6 KB) - added by Jim Stichnoth <stichnot@…> 13 years ago.
When doing "Exit without saving", make sure temporary marks are removed from the DB so they don't get loaded in the next edit session.
cutlist_undo_stack_v5.patch (19.5 KB) - added by Jim Stichnoth <stichnot@…> 13 years ago.
cutlist_undo_stack_v6.patch (20.8 KB) - added by Jim Stichnoth <stichnot@…> 13 years ago.
cutlist_undo_stack_v7.patch (21.9 KB) - added by Jim Stichnoth <stichnot@…> 13 years ago.

Download all attachments as: .zip

Change History (12)

Changed 14 years ago by Jim Stichnoth <stichnot@…>

Attachment: cutlist_undo_stack_v1.patch added

comment:1 Changed 14 years ago by sphery

Owner: set to sphery
Status: newaccepted

Changed 14 years ago by Jim Stichnoth <stichnot@…>

Attachment: cutlist_undo_stack_v2.patch added

comment:2 Changed 14 years ago by Jim Stichnoth <stichnot@…>

Simplified v2 patch directly includes the undo stack as part of the DeleteMap? class, rather than splitting it into its own class.

Changed 14 years ago by Jim Stichnoth <stichnot@…>

Attachment: cutlist_undo_stack_v3.patch added

comment:3 Changed 14 years ago by Jim Stichnoth <stichnot@…>

The v3 patch adds auto-save functionality like #7916. When an edit is made (as defined by an operation pushed onto the undo stack, hence the inclusion with this ticket), the working cutlist is stored into the recordedmarkup table using a set of temporary mark types.

When starting the editor, an auto-save cutlist is automatically loaded if available. It might be desirable to display an OSD notification, or allow the auto-save cutlist to be only explicitly loaded by extending the TV::ShowOSDAlreadyEditing() menu.

The DeleteMap? was extended to cache a pointer to the current PlayerContext? object, which is required for saving a cutlist. As such, the PlayerContext?* argument in most of the DeleteMap? methods is redundant and could be removed.

DeleteMap::LoadMap?() and DeleteMap::Clear() were modified from the previous patch so that they don't by default push an undo entry or auto-save, since they are sometimes called as part of higher level actions.

Changed 13 years ago by Jim Stichnoth <stichnot@…>

Attachment: cutlist_undo_stack_v4.patch added

When doing "Exit without saving", make sure temporary marks are removed from the DB so they don't get loaded in the next edit session.

Changed 13 years ago by Jim Stichnoth <stichnot@…>

Attachment: cutlist_undo_stack_v5.patch added

Changed 13 years ago by Jim Stichnoth <stichnot@…>

Attachment: cutlist_undo_stack_v6.patch added

Changed 13 years ago by Jim Stichnoth <stichnot@…>

Attachment: cutlist_undo_stack_v7.patch added

comment:4 Changed 13 years ago by Jim Stichnoth <stichnot@…>

Following Mike Dean's lead in https://github.com/MythTV/mythtv/commit/0a17efad1 , display a brief OSD message when an undo or redo operation is performed. Also display a message when the auto-save state from a previously crashed editing session is loaded.

comment:5 Changed 13 years ago by sphery

Milestone: unknown0.25
Resolution: Fixed
Status: acceptedclosed

In 0791662a7cb823f3e1a2f2f393e28ae582134beb:

Editor: Add Undo/Redo? and auto-save-to-temporary list.

Adds an undo/redo stack, and saves changes to a temporary list as you work.

Key bindings will be modified in future commits, so they're commented from Jim's patch.

Thanks to Jim Stichnoth for the wonderful new feature.

(See, also: f354621f1c5680306a90941343c00f4029501c01 and d471d7fcad3ce4e493862474d4fa541165b59f12 )

Note: See TracTickets for help on using tickets.