vmchooserdialog.cpp 667 Bytes
Newer Older
Belákovics Ádám committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#include "vmchooserdialog.h"
#include "ui_vmchooserdialog.h"

VMChooserDialog::VMChooserDialog(QWidget *parent):QDialog(parent), ui(new Ui::VMChooserDialog)
{
    ui->setupUi(this);
}

VMChooserDialog::~VMChooserDialog(){
    delete ui;
}

void VMChooserDialog::on_buttonBox_accepted()
{
    emit send_chosen_template(templates.at(ui->lwTemplates->currentIndex().row()));
    this->done(1);
}

void VMChooserDialog::on_buttonBox_rejected()
{
    this->done(-1);
}

void VMChooserDialog::set_templates(std::vector<Template> _templates){
    templates = _templates;
    for(auto t : templates){
        ui->lwTemplates->addItem(QString::fromUtf8(t.c_str()));
    }
}