#include "temporaryreceiptsaveform.h"
#include "ui_temporaryreceiptsaveform.h"

TemporaryReceiptSaveForm::TemporaryReceiptSaveForm(QSharedPointer<Voucher> voucher, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::TemporaryReceiptSaveForm)
{
    ui->setupUi(this);
    m_voucher = voucher;
    m_binder.registerBinding(ui->name);
    m_binder.setData(m_voucher.data());
}

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

void TemporaryReceiptSaveForm::accept()
{
    m_binder.bindToData();
    QDialog::accept();
}
