예제 #1
0
BaseState * StateWidget::getState()
{
    BaseState * toInsertState = StateWidgets[tmpWidget]->getStateObject();
    if(toInsertState==NULL)return NULL;
    toInsertState->setName(this->stateNameEdit->text());
    int chosen = getStateTypeTable().indexOf(stateTypeCombo->currentText());
    toInsertState->setType((StateType)chosen);
    toInsertState->setParameters(paramEdit->text());
    return toInsertState;
}
예제 #2
0
void StateWidget::AcceptState()
{
    if(edited==NULL)
    {
        emit reportError(QString("Please, select a state to edit, edit it and then press OK."));
        return;
    }
    if ( !StateNameOK())
    {
        return;
    }
    BaseState * toInsertState = StateWidgets[tmpWidget]->getStateObject();
    if(toInsertState==NULL)
        return;
    toInsertState->setName(this->stateNameEdit->text());
    toInsertState->setType(StateType(stateTypeCombo->currentIndex()));
    toInsertState->setParameters(paramEdit->text());
    OKButton->setDisabled(true);
    BaseState * tmp = edited;
    edited = NULL;
    emit ReplaceState(tmp, toInsertState);
}