48 lines
1.2 KiB
C++
Executable File
48 lines
1.2 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* ContaminationManangement - ChargeEdit Dlg
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Patric Karwat, SLSE, 2019-05-17
|
|
*/
|
|
|
|
#include "aes_charge_edit.h"
|
|
#include "ui_aes_charge_edit.h"
|
|
|
|
namespace AreaEffectSimulation
|
|
{
|
|
|
|
ChargeEdit::ChargeEdit(int chargeId, const QString &charge, int oldStock, QWidget *parent)
|
|
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
|
|
, m_chargeId(chargeId)
|
|
, m_oldStock(oldStock)
|
|
, m_buttonBox(new LtsWidgets::LtsDialogButtonBox(this))
|
|
, m_ui(new Ui::ChargeEdit)
|
|
{
|
|
m_ui->setupUi(this);
|
|
m_ui->verticalLayout->addWidget(m_buttonBox);
|
|
|
|
connect(m_buttonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked,
|
|
this, &ChargeEdit::onSendStock);
|
|
connect(m_buttonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked,
|
|
this, &ChargeEdit::onSendStock);
|
|
m_ui->spStock->setValue(oldStock);
|
|
m_ui->lblCharge->setText(charge);
|
|
}
|
|
|
|
ChargeEdit::~ChargeEdit()
|
|
{
|
|
delete m_ui;
|
|
}
|
|
|
|
void ChargeEdit::onSendStock()
|
|
{
|
|
if (sender() == m_buttonBox->getButton(LtsWidgets::DialogButton::Close))
|
|
emit newStock(m_chargeId, m_oldStock);
|
|
else
|
|
emit newStock(m_chargeId, m_ui->spStock->value());
|
|
}
|
|
|
|
} // namespace AreaEffectSimulation
|