Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,41 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
# Created by Malte Diers, SLSE, 2017-08-22
|
||||
#
|
||||
|
||||
SET(opm_overview_gui_SRCS
|
||||
opm_overview_gui_plugin.cpp
|
||||
opm_overview_gui_plugin.h
|
||||
|
||||
CustomViews/opm_operator.cpp
|
||||
CustomViews/opm_operator.h
|
||||
|
||||
operator_overview_dialog.cpp
|
||||
operator_overview_dialog.h
|
||||
)
|
||||
|
||||
NGL_WRAP_UI(opm_overview_gui_SRCS
|
||||
operator_overview_dialog.ui
|
||||
CustomViews/opm_operator.ui
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(WS OpmOverviewGuiPlugin MODULE ${opm_overview_gui_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(OpmOverviewGuiPlugin
|
||||
NGLLogger
|
||||
OpmDataPluginInterface
|
||||
OpmGuiPluginInterface
|
||||
OpmChangePasswordGui
|
||||
Qt5::Widgets
|
||||
LtsPrinting
|
||||
LtsWidgets
|
||||
LtsSession
|
||||
LtsSessionData
|
||||
LtsDataView
|
||||
LtsUtilsGuiDds
|
||||
)
|
||||
|
||||
NGL_INSTALL_TARGET(OpmOverviewGuiPlugin)
|
||||
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* CustomView for OPM Operator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, SLSE, 2016-04-08
|
||||
*/
|
||||
|
||||
#include "opm_operator.h"
|
||||
#include "ui_opm_operator.h"
|
||||
|
||||
#include <OperatorManagement/Gui/Common/operator_dialog_model.h>
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
CustomViewOperator::CustomViewOperator(QWidget *parent)
|
||||
: AbstractDisplayWidget(parent)
|
||||
, m_ui(new Ui::CustomViewOperator)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
CustomViewOperator::~CustomViewOperator()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
bool CustomViewOperator::init(const QModelIndex &idx)
|
||||
{
|
||||
if (!idx.isValid())
|
||||
return false;
|
||||
|
||||
m_ui->lbName->setText(rowData(idx, OperatorManagement::OperatorManagementDialogModel::Name).toString());
|
||||
m_ui->lbInfo->setText(rowData(idx, OperatorManagement::OperatorManagementDialogModel::Description).toString());
|
||||
return true;
|
||||
}
|
||||
} // namespace OperatorManagement
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* CustomView for OPM Operator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, SLSE, 2016-04-08
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Viewer/LtsDataView/abstract_display_widget.h>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class CustomViewOperator;
|
||||
}
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
class CustomViewOperator final : public LtsDataView::AbstractDisplayWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CustomViewOperator(QWidget *parent = nullptr);
|
||||
~CustomViewOperator();
|
||||
bool init(const QModelIndex &idx) override;
|
||||
|
||||
private:
|
||||
Ui::CustomViewOperator* m_ui;
|
||||
|
||||
};
|
||||
} // namespace OperatorManagement
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CustomViewOperator</class>
|
||||
<widget class="QWidget" name="CustomViewOperator">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>300</width>
|
||||
<height>74</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="lbName">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbInfo">
|
||||
<property name="text">
|
||||
<string notr="true">Info</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for OperatorManagement - Operator/User Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
|
||||
#include "operator_overview_dialog.h"
|
||||
#include "ui_operator_overview_dialog.h"
|
||||
|
||||
#include "operator_overview_dialog.h"
|
||||
#include "CustomViews/opm_operator.h"
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <Plugins/OperatorManagement/opm_data_plugin_interface.h>
|
||||
|
||||
#include <LtsPrinting/printing.h>
|
||||
#include <QTreeView>
|
||||
namespace OperatorManagement
|
||||
{
|
||||
OperatorOverviewDialog::OperatorOverviewDialog(const QString &windowTitle, QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||
, m_windowTitle(windowTitle)
|
||||
, m_model(nullptr)
|
||||
, m_ui(new Ui::OperatorOverviewDialog)
|
||||
, m_ftc(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(getLogger("OperatorDialog"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Print, this, &OperatorOverviewDialog::onPrint);
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Situation-Function_Group_User_Management"));
|
||||
}
|
||||
|
||||
OperatorOverviewDialog::~OperatorOverviewDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void OperatorOverviewDialog::retranslate()
|
||||
{
|
||||
translate(m_ui, m_windowTitle);
|
||||
}
|
||||
|
||||
void OperatorOverviewDialog::tableColumnOrganiserSetting()
|
||||
{
|
||||
//LtsColumnOrganiser
|
||||
m_ui->widget->setColumnsOrganiserEnabled(identifier(), true);
|
||||
}
|
||||
|
||||
bool OperatorOverviewDialog::init(LtsSession::LtsSession *session)
|
||||
{
|
||||
m_session = session;
|
||||
|
||||
std::shared_ptr<OperatorManagement::Interface::Dtc> dtc;
|
||||
if (!m_session->getDtc<OperatorManagement::DataInterface>(dtc))
|
||||
return false;
|
||||
if (!m_session->getFtc<OperatorManagement::DataInterface>(m_ftc))
|
||||
return false;
|
||||
|
||||
m_model = new OperatorManagementDialogModel(this, m_session->exerciseId());
|
||||
m_model->initModel(m_session, dtc);
|
||||
m_ui->widget->setModel(m_model, [this]() { return new CustomViewOperator(this); });
|
||||
|
||||
#ifndef LTS_DEBUG
|
||||
m_ui->widget->hideColumn(OperatorManagementDialogModel::Columns::Id);
|
||||
m_ui->widget->hideColumn(OperatorManagementDialogModel::Columns::EffectiveAcls);
|
||||
m_ui->widget->hideColumn(OperatorManagementDialogModel::Columns::PrimaryGroupId);
|
||||
m_ui->widget->hideColumn(OperatorManagementDialogModel::Columns::Image);
|
||||
m_ui->widget->hideColumn(OperatorManagementDialogModel::Columns::Workstation);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OperatorOverviewDialog::onPrint()
|
||||
{
|
||||
LtsPrinting::printView(m_session, this, m_ui->widget->treeView() );
|
||||
}
|
||||
|
||||
} // namespace OperatorManagement
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for OpeartorManagement - Operator/User Overview Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <OperatorManagement/Gui/Common/operator_dialog_model.h>
|
||||
#include <OperatorManagement/opm_ftc.h>
|
||||
#include <OperatorManagement/opm_dtc.h>
|
||||
#include <OperatorManagement/logger.h>
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OperatorOverviewDialog;
|
||||
}
|
||||
namespace LtsSession
|
||||
{
|
||||
class LtsSession;
|
||||
}
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
|
||||
class OperatorOverviewDialog : public LtsWidgets::LtsDialog
|
||||
, protected OperatorManagement::Interface::Ftc::OperatorRemoveReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OperatorOverviewDialog(const QString &windowTitle, QWidget *parent = nullptr);
|
||||
~OperatorOverviewDialog();
|
||||
bool init(LtsSession::LtsSession *session);
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
void onOperatorRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
void tableColumnOrganiserSetting() override;
|
||||
|
||||
QString m_windowTitle;
|
||||
OperatorManagementDialogModel *m_model;
|
||||
Ui::OperatorOverviewDialog *m_ui;
|
||||
|
||||
LtsSession::LtsSession *m_session;
|
||||
std::shared_ptr<OperatorManagement::Interface::Ftc> m_ftc;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
|
||||
private Q_SLOTS:
|
||||
void onPrint();
|
||||
|
||||
};
|
||||
|
||||
} // namespace OperatorManagement
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OperatorOverviewDialog</class>
|
||||
<widget class="QWidget" name="OperatorOverviewDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>674</width>
|
||||
<height>328</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Operator Overview</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="LtsDataView::LtsDataView" name="widget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsDataView::LtsDataView</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsDataView/lts_data_view.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* GUI Plugin for OperatorManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#include "opm_overview_gui_plugin.h"
|
||||
|
||||
#include <Plugins/OperatorManagement/opm_data_plugin_interface.h>
|
||||
#include "operator_overview_dialog.h"
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <Services/OperatorManagement/opm_operator_rights.h>
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
|
||||
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.Opm.Overview"))
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
{}
|
||||
|
||||
|
||||
bool InterfaceImpl::fetchInterfaces()
|
||||
{
|
||||
if (!m_session->getDtc<OperatorManagement::DataInterface>(m_dtc))
|
||||
return false;
|
||||
if (!m_session->getFtc<OperatorManagement::DataInterface>(m_ftc))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void InterfaceImpl::clearInterfaces()
|
||||
{
|
||||
m_ftc = nullptr;
|
||||
m_dtc = nullptr;
|
||||
}
|
||||
|
||||
void InterfaceImpl::showOperators(const QString &windowTitle)
|
||||
{
|
||||
m_session->addWidget(LtsWidgets::initDialog(new OperatorOverviewDialog(windowTitle),
|
||||
m_session),
|
||||
menuGroup(), QStringLiteral("OperatorOverview"));
|
||||
DEBUG_LOG(m_logger)<<"showOperators";
|
||||
}
|
||||
|
||||
|
||||
QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
|
||||
{
|
||||
QVector<LtsWidgets::PluginData> ret;
|
||||
|
||||
LtsWidgets::PluginData plData;
|
||||
plData.menuGroup = menuGroup();
|
||||
plData.menuText = tr("Overview");
|
||||
plData.identifier = QLatin1String("_OpmShowOperatorOveriew");
|
||||
plData.menuIcon = QIcon(QLatin1String("icon:operator.svg"));
|
||||
plData.operatorRight = OperatorRights::OperatorSettingsRead;
|
||||
plData.exercisePart = LtsWidgets::ExercisePart::eSpecial;
|
||||
plData.createWidgetFunc = [this](QWidget *parent)
|
||||
{
|
||||
return onShowOperatorOverviewDialog(parent);
|
||||
};
|
||||
ret.append(plData);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
//private
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowOperatorOverviewDialog(QWidget *parent)
|
||||
{
|
||||
return LtsWidgets::initDialog(new OperatorOverviewDialog(tr("Overview"), parent), m_session);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} //namespace OperatorManagement
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Gui Plugin for OperatorManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <OperatorManagement/logger.h>
|
||||
#include <OperatorManagement/opm_ftc.h>
|
||||
#include <OperatorManagement/opm_dtc.h>
|
||||
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <Plugins/OperatorManagement/opm_overview_gui_plugin_interface.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
|
||||
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
|
||||
{
|
||||
Q_PLUGIN_METADATA(IID "gui:3:opm.overview")
|
||||
Q_INTERFACES(GuiPluginBase::Plugin)
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
GuiPlugin() = default;
|
||||
~GuiPlugin() = default;
|
||||
|
||||
QString pluginName() override { return QLatin1String("OperatorOverviewGuiPlugin"); }
|
||||
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
|
||||
bool availableInPartition(IDL::PartitionType partition) const override
|
||||
{
|
||||
return (partition == IDL::PartitionType::Exercise);
|
||||
}
|
||||
};
|
||||
|
||||
class InterfaceImpl final : public QObject, public GuiPluginBase::Interface, public OperatorManagement::OverviewForeignGuiInterface
|
||||
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
||||
|
||||
bool fetchInterfaces() override;
|
||||
void clearInterfaces() override;
|
||||
QString menuGroup() const override { return tr("Operators"); }
|
||||
QVector<LtsWidgets::PluginData> getActions() override;
|
||||
bool availableInPartition(IDL::PartitionType partition) const override {return ( partition == IDL::PartitionType::Exercise );}
|
||||
|
||||
void showOperators(const QString &windowTitle) override final;
|
||||
|
||||
private:
|
||||
LtsWidgets::LtsDialog *onShowOperatorOverviewDialog(QWidget *parent);
|
||||
|
||||
std::shared_ptr<OperatorManagement::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<OperatorManagement::Interface::Ftc> m_ftc;
|
||||
|
||||
};
|
||||
|
||||
} // namespace OperatorManagement
|
||||
Reference in new issue
Block a user