本文整理汇总了C++中AMListAction3::parentAction方法的典型用法代码示例。如果您正苦于以下问题:C++ AMListAction3::parentAction方法的具体用法?C++ AMListAction3::parentAction怎么用?C++ AMListAction3::parentAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMListAction3
的用法示例。
在下文中一共展示了AMListAction3::parentAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: currentActionStateChanged
void AMActionRunner3::onCurrentActionStateChanged(int state, int previousState)
{
emit currentActionStateChanged(state, previousState);
if(state == AMAction3::Starting){
AMListAction3* listAction = qobject_cast<AMListAction3*>(currentAction_);
if(listAction){
int parentLogId = -1;
AMListAction3* parentAction = qobject_cast<AMListAction3*>(listAction->parentAction());
if(parentAction)
parentLogId = parentAction->logActionId();
if(!AMActionLog3::logUncompletedAction(currentAction_, loggingDatabase_, parentLogId)) {
AMErrorMon::report(AMErrorReport(this, AMErrorReport::Alert, -200, "There was a problem logging the uncompleted action to your database. Please report this problem to the Acquaman developers."));
}
}
if (isScanAction())
emit scanActionCreated((AMScanAction *)currentAction());
}
if ( (state == AMAction3::Running) && (previousState != AMAction3::Resuming) ){
if (isScanAction())
emit scanActionStarted((AMScanAction *)currentAction());
}
if(state == AMAction3::Failed) {
// What should we do?
int failureResponse = currentAction_->failureResponseInActionRunner();
if(failureResponse == AMAction3::PromptUserResponse)
failureResponse = internalAskUserWhatToDoAboutFailedAction(currentAction_);
if(failureResponse == AMAction3::AttemptAnotherCopyResponse) {
// make a fresh copy of this action and put it at the front of the queue to run again.
insertActionInQueue(currentAction_->createCopy(), 0);
}
// other failure response is to MoveOn, which we'll do anyway.
}
if(state == AMAction3::Cancelled) {
// Usability guess for now: If the user intervened to cancel, they probably want to make some changes to something. Let's pause the workflow for now to let them do that, rather than automatically go on to the next.
setQueuePaused(true);
}
// for all three final states, this is how we wrap things up for the current action:
if(state == AMAction3::Failed ||
state == AMAction3::Cancelled ||
state == AMAction3::Succeeded) {
// log it, unless it's a list action that wants to take care of logging its sub-actions itself.
AMListAction3* listAction = qobject_cast<AMListAction3*>(currentAction_);
int parentLogId = -1;
AMListAction3* parentAction = qobject_cast<AMListAction3*>(currentAction_->parentAction());
if(parentAction)
parentLogId = parentAction->logActionId();
if(!(listAction && listAction->shouldLogSubActionsSeparately())) {
if(!AMActionLog3::logCompletedAction(currentAction_, loggingDatabase_, parentLogId)) {
AMErrorMon::report(AMErrorReport(this, AMErrorReport::Alert, -200, "There was a problem logging the completed action to your database. Please report this problem to the Acquaman developers."));
}
}
else if(listAction){
if(!AMActionLog3::updateCompletedAction(currentAction_, loggingDatabase_)) {
AMErrorMon::report(AMErrorReport(this, AMErrorReport::Alert, -200, "There was a problem updating the log of the completed action to your database. Please report this problem to the Acquaman developers."));
}
}
if (isScanAction())
emit scanActionFinished((AMScanAction *)currentAction());
// move onto the next, if there is one, and disconnect and delete the old one.
internalDoNextAction();
}
}