Workspace 6.21.5
|
Checks that an Updatable object's execution thread is stopped. More...
#include <Workspace/Presentation/stillexecutingchecker.h>
Static Public Member Functions | |
static bool | canAllowTask (DataExecution::Updatable &updatable, bool promptAndStop=true) |
static ExecutionAction * | disableActionWhileExecuting (DataExecution::Updatable &updatable, QAction &action) |
static bool | isRunning (DataExecution::Updatable &updatable) |
A number of tasks require that a workspace not be executing to be safe. Examples include adding or removing an operation, connection or an element of an input array, or even changing the data type of a polymorphic operation. This class provides a convenient way to check that an object's execution thread is not running and to warn the user if it is, providing them with the opportunity to halt execution and continue or to cancel the requested action.
|
static |
updatable | The object whose execution thread is to be checked. |
promptAndStop | Ask the user and stop if executing, otherwise do a silent 'pause' execution that the caller is responsible for restarting. See saveWorkspace() |
If the execution thread is still running when this function is called, it will show a dialog informing the user it needs to be halted. The user can then cancel the requested task, in which case the function returns false, or they can let the checker ask for execution to be stopped. After waiting for a few seconds, if the execution thread is still running the checker will ask the user again. This process continues until either the execution thread halts or the user decides to cancel the task they were about to do.
|
static |
updatable | The object whose execution thread should control whether the specified action should be allowed. If there is no execution thread associated with updatable, this function has no effect. |
action | This action will be disabled while the execution thread for updatable is running. |
|
static |
updatable | The object whose execution thread is to be checked. |
This function differs from canAllowTask() in that it merely checks the current execution state without offering the user any means to stop it if it is running.