Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Gui Plugin for AudioVideoManagement - Eloka
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Astrid Mueller, SGAS, 2017-10-17
|
||||
*/
|
||||
|
||||
#include "avm_eloka_gui_plugin.h"
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <Services/AudioVideoManagement/avm_operator_rights.h>
|
||||
#include <avm_eloka_dialog.h>
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
|
||||
namespace AudioVideoManagement
|
||||
{
|
||||
|
||||
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.avm.Eloka"))
|
||||
, m_dtc(nullptr)
|
||||
, m_avmDataIfc(nullptr)
|
||||
{}
|
||||
|
||||
|
||||
bool InterfaceImpl::fetchInterfaces()
|
||||
{
|
||||
if (!m_session->getDtc<AudioVideoManagement::DataInterface>(m_dtc))
|
||||
return false;
|
||||
if (!m_session->getForeignDataInterface_NEW<AudioVideoManagement::DataInterface>(m_avmDataIfc))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void InterfaceImpl::clearInterfaces()
|
||||
{
|
||||
m_dtc = nullptr;
|
||||
m_avmDataIfc = nullptr;
|
||||
}
|
||||
|
||||
QString InterfaceImpl::menuGroup() const
|
||||
{
|
||||
return tr("Audio / Video");
|
||||
}
|
||||
|
||||
|
||||
QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
|
||||
{
|
||||
if (!m_avmDataIfc->hasAvsSession())
|
||||
return {}; // Someone else has access to the AvaSession in a different exercise context.
|
||||
|
||||
QVector<LtsWidgets::PluginData> actions;
|
||||
|
||||
LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance();
|
||||
const bool enableElectronicWarfareMeasures = ps->value(QStringLiteral("avm"),
|
||||
QStringLiteral("enableElectronicWarfareMeasures")).toBool();
|
||||
|
||||
if (enableElectronicWarfareMeasures)
|
||||
{
|
||||
LtsWidgets::PluginData plData;
|
||||
plData.menuGroup = menuGroup();
|
||||
plData.menuText = tr("Electronic Warfare Measures");
|
||||
plData.identifier = QLatin1String("avmEwm");
|
||||
plData.menuIcon = QIcon(QLatin1String("icon:electronical_warfare_measures.svg"));
|
||||
plData.operatorRight = OperatorRights::ElectronicWarfareMeasures::AvmEwmEdit;
|
||||
plData.exercisePart = LtsWidgets::ExercisePart::eExecution;
|
||||
plData.createWidgetFunc = [this](QWidget *parent)
|
||||
{
|
||||
return onShowEloka(parent);
|
||||
};
|
||||
actions.append(plData);
|
||||
}
|
||||
return actions;
|
||||
}
|
||||
|
||||
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowEloka(QWidget *parent)
|
||||
{
|
||||
return new ElokaDialog(m_session, m_avmDataIfc->avaSession(), m_dtc.get(), m_avmDataIfc->streamNameMapping(),
|
||||
menuGroup(), parent);
|
||||
}
|
||||
|
||||
} // namespace AudioVideoManagement
|
||||
Reference in new issue
Block a user