/** * @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 #include #include //ParticipantManagement #include #include 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 m_dtc; std::shared_ptr m_ftc; std::shared_ptr 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