71 lines
2.0 KiB
C++
Executable File
71 lines
2.0 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* GUI Plugin for ParticipantManagement - UAS
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Hannes Fritsche, ESZS, 2025-05-16
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <ParticipantManagement/logger.h>
|
|
|
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
|
#include <Plugins/ParticipantManagement/ppm_participants_gui_plugin_interface.h>
|
|
#include <Plugins/ParticipantManagement/ppm_data_plugin_interface.h>
|
|
|
|
namespace ExerciseManagement
|
|
{
|
|
namespace Interface
|
|
{
|
|
class Dtc;
|
|
}
|
|
}
|
|
|
|
namespace ParticipantManagement
|
|
{
|
|
|
|
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
|
|
{
|
|
Q_PLUGIN_METADATA(IID "gui:3:ppm.uas")
|
|
Q_INTERFACES(GuiPluginBase::Plugin)
|
|
|
|
Q_OBJECT
|
|
public:
|
|
GuiPlugin() = default;
|
|
~GuiPlugin() = default;
|
|
|
|
QString pluginName() override { return QStringLiteral("ParticipantManagement.GuiPlugin.uas"); }
|
|
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
|
|
bool availableInPartition(IDL::PartitionType partition) const override
|
|
{
|
|
return (partition == IDL::PartitionType::Global || partition == IDL::PartitionType::Exercise);
|
|
}
|
|
}; // class GuiPlugin
|
|
|
|
class InterfaceImpl final : public QObject, public ForeignGuiParticipantsInterface, public GuiPluginBase::Interface
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
|
|
|
QVector<LtsWidgets::PluginData> getActions() override;
|
|
bool fetchInterfaces() override;
|
|
void clearInterfaces() override;
|
|
QString menuGroup() const override;
|
|
|
|
bool availableInPartition(IDL::PartitionType partition) const override { return (partition == IDL::PartitionType::Global || partition == IDL::PartitionType::Exercise); }
|
|
|
|
private:
|
|
LtsWidgets::LtsDialog *onUasListDialog(QWidget *parent);
|
|
|
|
private:
|
|
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
|
|
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ppmFtc;
|
|
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_exmDtc;
|
|
|
|
}; // class InterfaceImpl
|
|
|
|
} // namespace ParticipantManagement
|