Engauge Digitizer 2
|
Command stack that shadows the CmdMediator command stack at startup when reading commands from an error report file. More...
#include <CmdStackShadow.h>
Public Slots | |
void | slotRedo () |
Move next command from list to CmdMediator. Noop if there are no more commands. | |
void | slotUndo () |
Throw away every command since trying to reconcile two different command stacks after an undo is too dangerous. |
Signals | |
void | signalRedo () |
Signal used to emulate a shift-control-z redo command from user during testing. | |
void | signalUndo () |
Signal used to emulate a shift-z undo command from user during testing. |
Public Member Functions | |
CmdStackShadow () | |
Single constructor. | |
bool | canRedo () const |
Return true if there is a command available. | |
void | loadCommands (MainWindow &mainWindow, Document &document, QXmlStreamReader &reader) |
Load commands from serialized xml. |
Command stack that shadows the CmdMediator command stack at startup when reading commands from an error report file.
The commands are loaded into this container rather than CmdMediator, since CmdMediator would try to execute all the commands immediately. For the best debugging, we want to be able to execute each command one by one. This container nicely stores commands until we want to copy them to CmdMediator so they can be executed.
This class is not subclassed from QUndoStack since that class is designed to prevent access to individual commands, to preserve their integrity
This class is not named CmdMediatorShadow since does not maintain a Document like CmdMediator, although in some ways that name might be a useful alias
Definition at line 31 of file CmdStackShadow.h.
CmdStackShadow::CmdStackShadow | ( | ) |
Single constructor.
Definition at line 21 of file CmdStackShadow.cpp.
bool CmdStackShadow::canRedo | ( | ) | const |
Return true if there is a command available.
Definition at line 27 of file CmdStackShadow.cpp.
void CmdStackShadow::loadCommands | ( | MainWindow & | mainWindow, |
Document & | document, | ||
QXmlStreamReader & | reader ) |
Load commands from serialized xml.
Definition at line 34 of file CmdStackShadow.cpp.
|
signal |
Signal used to emulate a shift-control-z redo command from user during testing.
|
signal |
Signal used to emulate a shift-z undo command from user during testing.
|
slot |
Move next command from list to CmdMediator. Noop if there are no more commands.
Definition at line 62 of file CmdStackShadow.cpp.
|
slot |
Throw away every command since trying to reconcile two different command stacks after an undo is too dangerous.
Definition at line 101 of file CmdStackShadow.cpp.