/** * @RDE_HEADER@ * Gui Plugin for MeteoDataManagement * $Id$ * $HeadURL$ * $Author$ * Created by Patric Karwat, SLSE, 2016-10-05 */ #include "esm_effect_show_list.h" #include "esm_effect_show_actor_relocation_list.h" #include "esm_effect_show_actor_list.h" #include "esm_effect_show_gui_plugin.h" #include #include #include #include namespace EffectShowManagement { std::shared_ptr GuiPlugin::createGuiInterface(LtsSession::LtsSession *session) { return std::make_shared(session); } InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session) : GuiPluginBase::Interface(session, getLogger("Plugins.Gui.Esm.EffectShow")) , m_dtc(nullptr) , m_ftc(nullptr) , m_dtcPpm(nullptr) , m_dtcPdm(nullptr) {} bool InterfaceImpl::fetchInterfaces() { if (!m_session->getDtc(m_dtc)) return false; if (!m_session->getFtc(m_ftc)) return false; if (!m_session->getDtc(m_dtcPpm)) return false; if (!m_session->getDtc(m_aesDtc)) return false; if (!m_session->getDtc(m_dtcPdm)) return false; return true; } void InterfaceImpl::clearInterfaces() { m_dtc = nullptr; m_ftc = nullptr; m_dtcPpm = nullptr; m_dtcPdm = nullptr; } QString InterfaceImpl::menuGroup() const { return tr("Effect Representation"); } QVector InterfaceImpl::getActions() { QVector ret; LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance(); const bool enableEffectShowManagement = ps->value(QStringLiteral("esm"), QStringLiteral("enableEffectShowManagement")).toBool(); if (enableEffectShowManagement) { LtsWidgets::PluginData plData; plData.menuGroup = menuGroup(); plData.menuText = tr("Effect Representations"); plData.identifier = QLatin1String("esmEffectShowList"); plData.menuIcon = QIcon(QLatin1String("icon:create_evaluation_topic.svg")); plData.operatorRight = OperatorRights::EffectShowEdit; plData.exercisePart = LtsWidgets::ExercisePart::eExecution; plData.createWidgetFunc = [this](QWidget * parent) { return onShowEffectShows(parent); }; ret.append(plData); plData.menuGroup = menuGroup(); plData.menuText = tr("Actor Position Relocations"); plData.identifier = QLatin1String("esmEffectShowActorRelocationList"); plData.menuIcon = QIcon(QLatin1String("icon:reloc_vehicle.svg")); plData.operatorRight = OperatorRights::RelocationsEdit; plData.exercisePart = LtsWidgets::ExercisePart::eExecution; plData.createWidgetFunc = [this](QWidget * parent) { return onShowEffectShowActorRelocations(parent); }; ret.append(plData); plData.menuGroup = menuGroup(); plData.menuText = tr("Effect Actors"); plData.identifier = QLatin1String("esmEffectShowActorList"); plData.menuIcon = QIcon(QLatin1String("icon:visible_teams.svg")); plData.operatorRight = OperatorRights::ActorEdit; plData.exercisePart = LtsWidgets::ExercisePart::eExecution; plData.createWidgetFunc = [this](QWidget * parent) { return onShowEffectShowActors(parent); }; ret.append(plData); } return ret; } LtsWidgets::LtsDialog *InterfaceImpl::onShowEffectShows(QWidget *parent) { return LtsWidgets::initDialog(new EffectShowList(menuGroup(), parent), m_session); } LtsWidgets::LtsDialog *InterfaceImpl::onShowEffectShowActorRelocations(QWidget *parent) { return LtsWidgets::initDialog(new EffectShowActorRelocationList(menuGroup(), parent), m_session); } LtsWidgets::LtsDialog *InterfaceImpl::onShowEffectShowActors(QWidget *parent) { return LtsWidgets::initDialog(new EffectShowActorList(parent), m_session); } } // namespace EffectShowManagement