Files
qt5-legatus-legacy/Lts/Plugins/TakeHomePackageManager/THP2/Thp2Management/tpm2_gui_plugin.cpp
T
2026-08-13 18:33:10 +02:00

62 lines
1.7 KiB
C++
Executable File

/**
* @RDE_HEADER@
* GUI Plugin for THP2
* $Id: tpm_gui_plugin.cpp 48572 2019-10-02 11:47:04Z rudolphus_g $
* $HeadURL: svn://slssvn/TDS/branches/product/iterations/21_03_salted_caramel/Lts/Plugins/TakeHomePackageManager/tpm_gui_plugin.cpp $
* $Author: rudolphus_g $
*
* Created by Mike Wille, ESZS, 2024-02-20
*/
#include "tpm2_gui_plugin.h"
#include "tpm2_exported_scripts_dialog.h"
#include "logger.h"
namespace TakeHomePackageManager
{
std::shared_ptr<GuiPluginBase::Interface> GuiPlugin::createGuiInterface(LtsSession::LtsSession *session)
{
return std::make_shared<InterfaceImpl>(session);
}
InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session)
: GuiPluginBase::Interface(session, getLogger("Plugins.Gui.Tpm"))
{}
bool InterfaceImpl::fetchInterfaces()
{
return true;
}
QString InterfaceImpl::menuGroup() const
{
return tr("Presentation");
}
QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
{
QVector<LtsWidgets::PluginData> ret;
LtsWidgets::PluginData plData;
plData.menuGroup = menuGroup();
if (m_session->app() == LtsAppDescriptor::App::Scripts)
plData.exercisePart = LtsWidgets::ExercisePart::eSpecial;
else
plData.exercisePart = LtsWidgets::ExercisePart::eAfterAction;
plData.identifier = QLatin1String("PresentationManagement.ScriptDialog.ManageExportedScripts");
plData.menuIcon = QIcon(QLatin1String("icon:export_documents.svg"));
plData.menuText = tr("Manage Exported Scripts");
// plData.operatorRight = OperatorRights::ScriptEditorEdit;
plData.createWidgetFunc = [this](QWidget *)
{
return LtsWidgets::createThrowableDialog<ExportedScriptsDialog>(m_session, nullptr);
};
ret.append(plData);
return ret;
}
} // namespace TakeHomePackageManager