#include "RefundForm.h"
#include "ui_RefundForm.h"

RefundForm::RefundForm(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::RefundForm)
{
    ui->setupUi(this);
    this->setWindowFlags(windowFlags()|Qt::FramelessWindowHint|Qt::Dialog);

    this->move(parent->pos().x()+(parent->width()-this->width())/2,
               parent->pos().y()+(parent->height()-this->height())/2);

    ui->refundRbtn0->toggle();
}

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

QString RefundForm::GetReason() const
{
    return _reason;
}

void RefundForm::on_refundBtnOk_clicked()
{
    this->accept();
}

void RefundForm::on_refundBtnCancle_clicked()
{
    this->reject();
}

void RefundForm::on_refundRbtn0_toggled(bool)
{
    _reason = ui->refundRbtn0->text();
}

void RefundForm::on_refundRbtn1_toggled(bool)
{
    _reason = ui->refundRbtn1->text();
}

void RefundForm::on_refundRbtn2_toggled(bool)
{
    _reason = ui->refundRbtn2->text();
}

void RefundForm::on_refundRbtn3_toggled(bool)
{
    _reason = ui->refundRbtn3->text();
}
