Workspace 6.21.5
Public Member Functions | List of all members
ToggleConnectionEnabledCmd Class Reference

Command class for disabling a connection.

#include <Workspace/DataExecution/UndoCommands/toggleconnectionenabledcmd.h>

Inheritance diagram for ToggleConnectionEnabledCmd:
[legend]

Public Member Functions

 ToggleConnectionEnabledCmd (Connection &connection)
 
void redo () override
 
void undo () override
 

Constructor & Destructor Documentation

◆ ToggleConnectionEnabledCmd()

Sets the commands text based on the connections enabled state so that it reads intuitively to the user.

The implementation of this function stores the reference to the connection in such a way that it is agnostic to the specific instance that was passed to it, which can be important for particular actions. For an example of where the underlying connection may change add a connection to the workspace, disable the connection, remove the connection, undo the removal of the connection, undo the disable of the connection (when the undo the disable happens the connection reference will have changed from the original connection reference that was used when it was disabled (since it was removed/destroyed and then replaced/recreated through the "remove" / "undo remove")). See also ConnectionCommonCmd.

Member Function Documentation

◆ redo()

void redo ( )
override

Toggles the connections enabled state.

◆ undo()

void undo ( )
override

Toggles the connections enabled state to what it was before the command happened.