Opened 6 years ago

Last modified 6 years ago

#2097 closed enhancement

Undo aggregate and block context managers — at Initial Version

Reported by: Conrad Huang Owned by: Conrad Huang
Priority: major Milestone: 1.0
Component: Core Version:
Keywords: Cc: gregc@…
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Undo manager needs to provide ways of aggregating undo for multiple commands into a single entry (use case: nucleotide style buttons) or to block undo actions (use case: "tile" command not wanting "move" undo actions). Usage may be something like:

with session.undo.aggregate("cmd_title"):
   run("command 1; command 2; command 3")
   # Each command needs to be undone, in order
with session.undo.block("tile"):
   run("move x 10 #1; move x 20 #2")
   # A bunch of commands whose net result is captured by view
   # and undo only uses the saved views

Aggregate undo actions can be "redo"ne if all sub-actions can be redone.

Change History (0)

Note: See TracTickets for help on using tickets.