#include "variableswidgetdialog.h"

VariablesWidgetDialog::VariablesWidgetDialog(QString *variable, QString *value,
        QWidget *parent=0): QDialog(parent), ui(new Ui::VariablesWidgetDialog),
        value(value), variable(variable){
       ui->setupUi(this);
       ui->ValueE->setText(*value);
       ui->variableE->setText(*variable);
}

void VariablesWidgetDialog::accept()
{
    if(ui->variableE->text()==""){
        *variable = "<Variable>";
    }else{
        *variable = ui->variableE->text();
    }
    if(ui->ValueE->toPlainText()==""){
        *value = "<Value>";
    }else{
        *value = ui->ValueE->toPlainText();
    }
    QDialog::accept();
}
