madgui.util.history module

Utility for managing a simple history.

Classes

History()

Simple class for tracking a value through a linear change history.

class madgui.util.history.History[source]

Bases: object

Simple class for tracking a value through a linear change history.

This is basically a list with the additional notion of a current revision which can be incremented or decremented by “undoing” or “redoing”.

Methods

can_redo()

Check whether we can move forward in history.

can_undo()

Check whether we can move backward in history.

clear()

Clear history.

create_redo_action(parent)

Create a QAction for a “Redo” button.

create_undo_action(parent)

Create a QAction for an “Undo” button.

push(value)

Add a value at our history position and clear anything behind.

redo()

Move forward in history.

undo()

Move backward in history.

Attributes

changed

Signal<>

can_redo()[source]

Check whether we can move forward in history.

can_undo()[source]

Check whether we can move backward in history.

changed

Signal<>

clear()[source]

Clear history.

create_redo_action(parent)[source]

Create a QAction for a “Redo” button.

create_undo_action(parent)[source]

Create a QAction for an “Undo” button.

push(value)[source]

Add a value at our history position and clear anything behind. Keeps the value unique in the stack by removing previous appearance of it in the stack.

redo()[source]

Move forward in history.

undo()[source]

Move backward in history.