void LinkEditor::setLinkId( uint32 linkId ) { setup(); currentLinkId = linkId; IParser *parser = CWidgetManager::getInstance()->getParser(); SLinkData data; if( !parser->getLinkData( currentLinkId, data ) ) return; expressionEdit->setPlainText( data.expr.c_str() ); targetEdit->setText( data.target.c_str() ); ahEdit->setText( data.action.c_str() ); ahParamEdit->setText( data.params.c_str() ); condEdit->setText( data.cond.c_str() ); }
void LinkEditor::onOKButtonClicked() { IParser *parser = CWidgetManager::getInstance()->getParser(); SLinkData data; if( !parser->getLinkData( currentLinkId, data ) ) return; data.expr = expressionEdit->toPlainText().toUtf8().constData(); data.target = targetEdit->text().toUtf8().constData(); data.action = ahEdit->text().toUtf8().constData(); data.params = ahParamEdit->text().toUtf8().constData(); data.cond = condEdit->text().toUtf8().constData(); parser->updateLinkData( data.id, data ); Q_EMIT okClicked(); hide(); }