void AMActionRunnerAddActionBar3::onStartActionRequested(){

	if(AMActionRunner3::workflow()->actionRunning())
		return;

	// check first: if there's already items queue up in the workflow, we need to find out if they want to add this action to the end of the queue and run, add this action to the beginning of the queue and run, add to end but not run, or just run this one first and leave the rest of the queue alone.
	QAbstractButton* result = 0;
	QPushButton* cancel=0, *addToBeginningAndStart=0, *addToEndAndStart=0, *addToEnd=0, *runOnlyThisOne=0;
	if(AMActionRunner3::workflow()->queuedActionCount()) {

		QMessageBox questionBox;
		questionBox.setText("There are already actions waiting in the workflow queue.");
		questionBox.setInformativeText("What do you want to do with this " % actionCategoryName_ % "?");
		questionBox.setIcon(QMessageBox::Question);

		cancel = questionBox.addButton("Cancel", QMessageBox::RejectRole);
		addToBeginningAndStart = questionBox.addButton("Add to beginning and start workflow", QMessageBox::YesRole);
		addToEndAndStart = questionBox.addButton("Add to end and start workflow", QMessageBox::YesRole);
		addToEnd = questionBox.addButton("Add to end", QMessageBox::YesRole);
		runOnlyThisOne = questionBox.addButton("Run just this " % actionCategoryName_, QMessageBox::YesRole);

		questionBox.setDefaultButton(runOnlyThisOne);
		questionBox.exec();

		result = questionBox.clickedButton();
		if(result == cancel) {
			return;
		}
	}

	ActionQueue::QueueOperation operation = ActionQueue::AddToEnd;
	if (result == 0) { // no other actions in queue... Just run now.
		operation = ActionQueue::RunAtOnce;

	} else if (result == runOnlyThisOne) { // there are other actions, but we only want to run this one.
		operation = ActionQueue::RunOnlyThisOne;

	} else if (result == addToBeginningAndStart) {
		operation = ActionQueue::AddToBeginningAndStart;

	} else if (result == addToEndAndStart) {
		operation = ActionQueue::AddToEndAndStart;

	} else if (result == addToEnd) {
		operation = ActionQueue::AddToEnd;
	}

	addActionToQueue(operation);
}
예제 #2
0
파일: Queue.cpp 프로젝트: dtamayo/OGRE
Queue::Queue(int rows, int columns, QWidget* parent) : QTableWidget(rows, columns, parent) {
    setColumnWidth(0, 210);
    QHeaderView* h = horizontalHeader();
    h->setResizeMode(QHeaderView::Stretch);
    setContextMenuPolicy(Qt::CustomContextMenu);
    QStringList headers;
    headers << "Action" << "Span" << "X Rotation" << "Y Rotation" << "Z Rotation"
            << "Zoom Factor" << "Frame Number";
    setHorizontalHeaderLabels(headers);
    Action act;
    act.typ = INITIALIZE;
    act.xrot = 0;
    act.yrot = 0;
    act.zrot = 0;
    act.scale = 1;
    act.frame = 0;
    act.span = 0;
    act.queueIndex = 0;
    addActionToQueue(act);
}
void AMActionRunnerAddActionBar3::onAddToQueueRequested() {
	addActionToQueue(ActionQueue::AddToEnd);
}