/** * @RDE_HEADER@ * Add Equipment Type - Ask for new ID and id of template to copy from * $Id$ * $HeadURL$ * $Author$ * Created by Malte Diers, NLE, 2020-07-20 */ #include "injury_model_add.h" #include "ui_injury_model_add.h" namespace WarehouseManagement { InjuryModelAdd::InjuryModelAdd(const QSet &availableIds, QWidget *parent) : LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal) , m_ui(new Ui::InjuryModelAdd) { m_ui->setupUi(this); connect(m_ui->ltsDialogButtonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked, this, &InjuryModelAdd::reject); connect(m_ui->ltsDialogButtonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked, this, &InjuryModelAdd::onOkay); for (int val = 1; val <= 255; ++ val) { if (availableIds.contains(val)) m_ui->cbId->addItem(QString::number(val), val); } } InjuryModelAdd::~InjuryModelAdd() { delete m_ui; } void InjuryModelAdd::onOkay() { emit newInjuryModel(m_ui->cbId->currentData().toInt()); accept(); } } // namespace AreaEffectSimulation