buttleofx.core.undo_redo.manageTools package

Submodules

buttleofx.core.undo_redo.manageTools.commandManager module

class buttleofx.core.undo_redo.manageTools.commandManager.CommandManager[source]

Bases: quickmamba.patterns.singleton.Singleton

Manages a list of commands.

active = False
canRedo()[source]

Retrieves a Boolean indicating whether a command can be redone.

canUndo()[source]

Retrieves a Boolean indicating whether a command can be undone.

clean()[source]

Clears this command manager by emptying its list of commands.

cleanIndex = 0
commands = []
count()[source]

Gets the number of commands in the CommandManager.

countRedo()[source]

Gets the number of redo commands in the CommandManager.

countUndo()[source]

Gets the number of undo commands in the CommandManager.

getCleanIndex()[source]

Gets the clean index of the CommandManager.

getCommands()[source]

Gets the list of commands of the CommandManager.

getIndex()[source]

Gets the index of the lastest command in the CommandManager.

getRedoLimit()[source]

Gets the redo limit of the CommandManager.

getUndoLimit()[source]

Gets the undo limit of the CommandManager.

graphHadChanged()[source]

Indicates to ButtleData that a command just had been done. This function will update the property graphCanBeSaved of ButtleData and will change the display of the “Save Graph” icon.

index = 0
isActive()[source]

Tests if the CommandManager is active.

isClean()[source]

Tests if the list of commands is empty.

push(newCommand)[source]

Executes a new undoable command (add command to the stack ?)

redo()[source]

Redoes the last undone command.

redoLimit = 10
savedGraphIndex = 0
setActive(active=True)[source]

Sets the CommandManager activity (true to false, or false to true).

setRedoLimit(limit)[source]

Sets the redo limit of the CommandManager.

setSavedGraphIndex(index)[source]

Sets the index where the graph was when last saved, and indicates to buttleData that something changed (useful for the display of the “Save Graph” icon)

setUndoLimit(limit)[source]

Sets the undo limit of the CommandManager.

undo()[source]

Undoes the last command.

undoLimit = 10

buttleofx.core.undo_redo.manageTools.groupUndoableCommands module

class buttleofx.core.undo_redo.manageTools.groupUndoableCommands.GroupUndoableCommands(commands, label)[source]

Bases: object

Group of objects saved in the Command Manager.

doCmd()[source]

Executes the user request (the group of functions). Returns nothing, maybe need to be improved in the future (list of return value of each command?).

getLabel()[source]

Return what does the command undo/redo

groupUndoableCommands = []
redoCmd()[source]

Undoes the operations performed by undoCmd method.

undoCmd()[source]

Executes the user request (Ctrl Z) (undo a group of commands).

buttleofx.core.undo_redo.manageTools.undoableCommand module

class buttleofx.core.undo_redo.manageTools.undoableCommand.UndoableCommand[source]

Bases: object

Object saved in the Command Manager.

doCmd()[source]

Executes the user request (the true function)

getLabel()[source]

Return what does the command undo/redo

redoCmd()[source]

Undoes the operation performed by undoCmd method (Ctrl Y)

undoCmd()[source]

Executes the user request (Ctrl Z)

Module contents