82 lines
1.9 KiB
C++
Executable File
82 lines
1.9 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Restock Charges - Restocks Charges of a distinct weapon selectively. Or their defaults. Or both.
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Iuliana Ojog - 2022-03-17
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
//Lts
|
|
#include <LtsWidgets/lts_dialog.h>
|
|
#include <LtsSession/lts_session.h>
|
|
#include <LtsUtilsGuiDds/request_helper.h>
|
|
|
|
//ParticipantManagement
|
|
#include <ParticipantManagement/logger.h>
|
|
#include <ParticipantManagement/ppm_ftc.h>
|
|
|
|
namespace Ui
|
|
{
|
|
class ParticipantGearRestock;
|
|
}
|
|
|
|
namespace ProjectDataManagement {
|
|
namespace Interface {
|
|
class Dtc;
|
|
}
|
|
}
|
|
|
|
namespace ParticipantManagement
|
|
{
|
|
namespace Interface {
|
|
class Dtc;
|
|
}
|
|
|
|
class ParticipantGearRestock : public LtsWidgets::LtsDialog
|
|
, protected ParticipantManagement::Interface::Ftc::SelectiveReammunitionReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum DialogMode
|
|
{
|
|
DM_Restock,
|
|
DM_SetRestockDefaults
|
|
};
|
|
|
|
explicit ParticipantGearRestock(int gearId, int gearTypeId, const Participant &participant, DialogMode dialogMode, QWidget *parent = nullptr);
|
|
~ParticipantGearRestock();
|
|
|
|
bool init(LtsSession::LtsSession *session, bool showAllOptions = false);
|
|
|
|
private:
|
|
void retranslate() override;
|
|
bool apply() override final;
|
|
void onSelectiveReammunitionReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
|
|
|
private slots:
|
|
void validate(int newVal);
|
|
|
|
private:
|
|
LtsUtils::RequestHelper *m_requestHelper;
|
|
LtsSession::LtsSession *m_session;
|
|
|
|
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
|
|
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftc;
|
|
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_pdmDtc;
|
|
|
|
int m_gearId{-1};
|
|
int m_gearTypeId{-1};
|
|
Participant m_participant;
|
|
int m_max{9999};
|
|
DialogMode m_dialogMode{DM_SetRestockDefaults};
|
|
|
|
Ui::ParticipantGearRestock *m_ui;
|
|
LOGGER_T m_logger;
|
|
};
|
|
|
|
} //namespace ParticipantManagement
|