Class sh::actions::ActionExecutionInfo

class sh::actions::ActionExecutionInfo : public QObject

Programming interface for giving status infos and communication with the user in an action execution.

An instance is always available during an execution.

Public Functions

ActionExecutionInfo(QObject *parent = 0)

Constructed only by the infrastructure and made available otherwise.

~ActionExecutionInfo()
void setVisualProcessFeedbackActive(bool active)

Specifies if there must be a visual process feedback.

The visual process feedback is typically realized as a dialog showing progress information.

Note: It can also appear in some situations, even if this property is set to false.

bool isVisualProcessFeedbackActive()

Determines if there must be a visual process feedback.

void setManualInterventionNeeded(bool isneeded)

Specifies if manual input is currently required.

bool isManualInterventionNeeded()

Determines if manual input is currently required.

void startExecution(std::shared_ptr<sh::actions::AbstractActionItem> action)

Triggers the beginning of the actual execution. .

void finishExecution()

Triggers the finishing of the execution. .

void setDetails(QString fromverb, QString fromobj, QString toverb = QString(), QString toobj = QString())

Sets some detail texts.

QString fromVerb()

Gets detail text ‘from-verb’.

QString fromObjectName()

Gets detail text ‘from-objectname’.

QString toVerb()

Gets detail text ‘to-verb’.

QString toObjectName()

Gets detail text ‘to-objectname’.

void setHead(QString text)

Sets the header text.

QString head()

Gets the header text.

void setProgressIndeterminate(QString text = QString())

Sets progress information to ‘indeterminate’.

void setProgress(quint64 done, quint64 all, QString text)

Sets progress information.

bool isProgressDeterminate()

Gets if progress information is ‘indeterminate’.

quint64 progressDone()

Gets count of finished items.

quint64 progressAll()

Gets count of all items.

QString progressText()

Gets progress information text.

sh::actions::ActionExecutionUserFeedback *userfeedback()

Program interface for interactive user input.

bool isCancelled()

Gets if the current action execution was cancelled.

void cancel()

Cancel the current action execution.

Used from outside, e.g. as handler for a ‘Cancel’ button.

void respectCancel()

Called regularly from an action execution code in order to cancel execution at that place, if the user has cancelled it.

void withExecuteGuards_infodlg(std::function<void()>int flags = 0, )

Executes code with different exception handlers for presenting exceptions in the action execution inside the action dialog (instead of the default exception dialog).

sh::filesystem::Operation *operation()

Program interface for operations on the filesystem (reading or writing).

void addChangedEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Reminds an important change of a certain node in the filesystem (file created, modified, removed?).

The infrastructure will force the ui to refresh those nodes.

void shutdown(bool success)

Shuts down this execution info and releases resources.

Signals

void detailsChanged()

Signal for changed execution details.

void headChanged()

Signal for changed head.

void progressChanged()

Signal for changed progress.

void visualProcessFeedbackActiveChanged()

Signal for changed visibility-required.

void wasCancelled()

Signal for cancellation on user behalf.

bool manualInterventionNeededChanged()

Signal for changed manual-intervention-needed.

Private Functions

std::shared_ptr<sh::ui::ActionExecutionInfoDialog> createDialog()
std::shared_ptr<ui::ActionExecutionInfoPanel> createPanel(sh::ui::ActionExecutionInfoDialog *dialog)

Private Members

QMutex mutex
QString _head
QString _fromverb
QString _fromobj
QString _toverb
QString _toobj
bool _progressDeterminate
quint64 _progressDone
quint64 _progressAll
bool _visualProcessFeedbackActive = false
bool _wasAlwaysInvisible = true
bool _manualInterventionNeeded = false
QString _progressText
std::shared_ptr<sh::ui::ActionExecutionInfoDialog> infodialog = 0
std::shared_ptr<sh::ui::ActionExecutionInfoPanel> infopanel = 0
bool _iscancelled = false
sh::filesystem::Operation _operation
QList<std::shared_ptr<const sh::filesystem::Eurl>> changes
QStack<std::shared_ptr<sh::actions::AbstractActionItem>> stack

Private Slots

void _checkVisibilityOnce()