Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Philipp Last, SLSE, 2017-10-26
|
||||
*/
|
||||
|
||||
#include "ppm_saab_gui_plugin.h"
|
||||
#include "ppm_saab_edit.h"
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <Services/ParticipantManagement/ppm_operator_rights.h>
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
|
||||
|
||||
namespace ParticipantManagement
|
||||
{
|
||||
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.Ppm.saab"))
|
||||
, m_pSession(session)
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
, m_ppmGuiCbxIfc(nullptr)
|
||||
, m_exmDtc(nullptr)
|
||||
{}
|
||||
|
||||
|
||||
bool InterfaceImpl::fetchInterfaces()
|
||||
{
|
||||
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_dtc))
|
||||
return false;
|
||||
if (!m_session->getFtc<ParticipantManagement::DataInterface>(m_ftc))
|
||||
return false;
|
||||
if (!m_session->getForeignGuiInterface<ParticipantManagement::ForeignGuiComboboxInterface>(m_ppmGuiCbxIfc))
|
||||
return false;
|
||||
if (!m_session->getDtc<ExerciseManagement::DataInterface>(m_exmDtc))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void InterfaceImpl::clearInterfaces()
|
||||
{
|
||||
m_dtc = nullptr;
|
||||
m_ftc = nullptr;
|
||||
m_ppmGuiCbxIfc = nullptr;
|
||||
m_exmDtc = nullptr;
|
||||
}
|
||||
|
||||
|
||||
QString InterfaceImpl::menuGroup() const
|
||||
{
|
||||
return tr("Participants");
|
||||
}
|
||||
|
||||
|
||||
QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
|
||||
{
|
||||
QVector<LtsWidgets::PluginData> ret;
|
||||
|
||||
/*
|
||||
* Importing exercise data is only possible if
|
||||
* the operator is actually operating within an exercise
|
||||
*/
|
||||
|
||||
LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance();
|
||||
const bool enableSAAB_ImExport = ps->value(QStringLiteral("ppm"),
|
||||
QStringLiteral("enableMSDL_ImExport")).toBool();
|
||||
|
||||
if ((m_pSession->exerciseId() != 0) && enableSAAB_ImExport)
|
||||
{
|
||||
LtsWidgets::PluginData plData;
|
||||
plData.menuGroup = menuGroup();
|
||||
plData.menuText = tr("SAAB Import/Export");
|
||||
plData.identifier = QLatin1String("ppmsaabview");
|
||||
plData.menuIcon = QIcon(QLatin1String("icon:import_saab.svg"));
|
||||
plData.operatorRight = OperatorRights::Msdl::MsdlImportExport; // TODO!
|
||||
plData.exercisePart = LtsWidgets::ExercisePart::ePlanning;
|
||||
plData.createWidgetFunc = [this](QWidget * parent)
|
||||
{
|
||||
return onShowSAABEdit(parent);
|
||||
};
|
||||
ret.append(plData);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowSAABEdit(QWidget *parent)
|
||||
{
|
||||
return LtsWidgets::initDialog(new ParticipantManagement::SAABEdit(m_session, parent),
|
||||
m_exmDtc, m_dtc, m_ftc, m_ppmGuiCbxIfc);
|
||||
}
|
||||
|
||||
} // namespace ParticipantManagement
|
||||
Reference in new issue
Block a user