Пример #1
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 = this->getState();
    if(toInsertState==NULL)return;
    OKButton->setDisabled(true);
    BaseState * tmp = edited;
    edited = NULL;
    emit ReplaceState(tmp, toInsertState);
    StateSelected(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);
}