Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,50 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
# Created by Malte Diers, SLSE, 2017-08-22
|
||||
#
|
||||
|
||||
SET(opm_settings_gui_SRCS
|
||||
operator_settings_dialog.cpp
|
||||
operator_settings_dialog.h
|
||||
|
||||
operator_settings_create_new_dialog.cpp
|
||||
operator_settings_create_new_dialog.h
|
||||
|
||||
opm_settings_gui_plugin.cpp
|
||||
opm_settings_gui_plugin.h
|
||||
|
||||
SettingsGroup/opm_settings_group.cpp
|
||||
SettingsGroup/opm_settings_group.h
|
||||
|
||||
)
|
||||
|
||||
NGL_WRAP_UI(opm_settings_gui_SRCS
|
||||
operator_settings_dialog.ui
|
||||
operator_settings_create_new_dialog.ui
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(WS OpmSettingsGuiPlugin MODULE ${opm_settings_gui_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(OpmSettingsGuiPlugin
|
||||
NGLLogger
|
||||
OpmDataPluginInterface
|
||||
OpmGuiPluginInterface
|
||||
OpmChangePasswordGui
|
||||
FltDataPluginInterface
|
||||
Qt5::Widgets
|
||||
LtsWidgets
|
||||
LtsSession
|
||||
LtsSessionData
|
||||
LtsDataView
|
||||
LtsUtilsSettings
|
||||
LtsUtilsGuiDds
|
||||
nglwidgets
|
||||
ngltools
|
||||
FltAesGuiCommon
|
||||
LtsProjectionWorkstation
|
||||
)
|
||||
|
||||
NGL_INSTALL_TARGET(OpmSettingsGuiPlugin)
|
||||
|
||||
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* GUI Plugin for OperatorManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "opm_settings_group.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonParseError>
|
||||
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
|
||||
SettingsGroup::SettingsGroup(const QString &group, const QString &id, SubSetHandler *handler, LtsUtils::OperatorSettings *opSettings)
|
||||
: m_group(group)
|
||||
, m_id(id)
|
||||
, m_subSetHandler(handler)
|
||||
, m_opSettings(opSettings)
|
||||
, m_logger(getLogger("SettingsGroup"))
|
||||
{
|
||||
m_logger.setNoSpace(false);
|
||||
}
|
||||
|
||||
bool SettingsGroup::init()
|
||||
{
|
||||
if (!m_subSetHandler || !m_opSettings)
|
||||
{
|
||||
// MQS-474 Crash beim Öffnen des Script-Editors:
|
||||
ERROR_LOG(m_logger) << " SettingsGroup::init() failed. this=" << this
|
||||
<< ", typeid.name='" << typeid(*this).name()
|
||||
<< ", m_id='" << m_id
|
||||
<< ", m_group='" << m_group;
|
||||
#ifdef LTS_DEBUG
|
||||
abort(); // Bitte Hinweis an Norbert
|
||||
#else
|
||||
return false;
|
||||
#endif // LTS_DEBUG
|
||||
}
|
||||
|
||||
m_data = jsonObjectFromSettings(m_group, m_id);
|
||||
return !m_data.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
QJsonValue SettingsGroup::value(const QString &key)
|
||||
{
|
||||
return m_data.value(key);
|
||||
}
|
||||
|
||||
|
||||
void SettingsGroup::setValue(const QString &key, const QJsonValue &value)
|
||||
{
|
||||
m_data.insert(key, value);
|
||||
}
|
||||
|
||||
|
||||
void SettingsGroup::registerSubset(const SubSet &subset)
|
||||
{
|
||||
m_subsets.append(subset);
|
||||
}
|
||||
|
||||
|
||||
void SettingsGroup::startLoad()
|
||||
{
|
||||
if (!aboutToLoad())
|
||||
return;
|
||||
|
||||
#ifdef LTS_DEBUG
|
||||
// MQS-474 Crash beim Öffnen des Script-Editors:
|
||||
if (!m_subSetHandler)
|
||||
abort(); // Bitte Hinweis an Norbert
|
||||
#else
|
||||
if (!m_subSetHandler)
|
||||
{
|
||||
ERROR_LOG(m_logger) << " SettingsGroup::startLoad() : no m_subSetHandler. this=" << this
|
||||
<< ", typeid.name='" << typeid(*this).name()
|
||||
<< ", m_id='" << m_id
|
||||
<< ", m_group='" << m_group;
|
||||
return;
|
||||
}
|
||||
#endif // LTS_DEBUG
|
||||
|
||||
for (SubSet &subset : m_subsets)
|
||||
{
|
||||
subset.data = m_data.value(subset.name); //.toObject();
|
||||
m_subSetHandler->loadSubSet(subset);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SettingsGroup::startSave() // NOTE: saves settings from the workspaceId it gets from m_session->workspaceId, not the workspaceId it was given in the constructor !
|
||||
{
|
||||
if (!aboutToSave())
|
||||
return;
|
||||
for (SubSet &subset : m_subsets)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "saving11 subset for group: " << m_group
|
||||
<< ", id:" << m_id
|
||||
<< ", subset.name=" << subset.name
|
||||
<< ", subset.data=" << subset.data.toString();
|
||||
|
||||
bool saveSubSetOk = m_subSetHandler->saveSubSet(subset); // saveSubSet fills .data
|
||||
if (!saveSubSetOk)
|
||||
WARNING_LOG(m_logger) << "saving22 subset failed for group: " << m_group
|
||||
<< ", id:" << m_id
|
||||
<< ", subset.name=" << subset.name
|
||||
<< ", subset.data=" << subset.data.toString();
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "saving22 subset for group: " << m_group
|
||||
<< ", id:" << m_id
|
||||
<< ", subset.name=" << subset.name
|
||||
<< ", subset.data=" << subset.data.toString();
|
||||
|
||||
m_data.insert(subset.name, subset.data);
|
||||
}
|
||||
m_opSettings->setValue(m_group, m_id, QJsonDocument(m_data).toJson(QJsonDocument::Compact));
|
||||
}
|
||||
|
||||
|
||||
void SettingsGroup::startDelete()
|
||||
{
|
||||
if (!aboutToDelete())
|
||||
return;
|
||||
m_opSettings->removeValue(m_group, m_id);
|
||||
}
|
||||
|
||||
|
||||
QJsonObject SettingsGroup::jsonObjectFromSettings(const QString &group, const QString &id) const
|
||||
{
|
||||
QString settingsString = m_opSettings->value(group, id, QString()).toString();
|
||||
if (settingsString.isEmpty())
|
||||
return QJsonObject();
|
||||
|
||||
QJsonParseError err;
|
||||
QJsonDocument doc(QJsonDocument::fromJson(settingsString.toUtf8(), &err));
|
||||
|
||||
if (err.error != QJsonParseError::NoError)
|
||||
return QJsonObject();
|
||||
|
||||
return doc.object();
|
||||
}
|
||||
|
||||
|
||||
} //namespace OperatorManagement
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Gui Plugin for OperatorManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QVector>
|
||||
#include <OperatorManagement/logger.h>
|
||||
|
||||
namespace LtsUtils { class OperatorSettings; }
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
|
||||
|
||||
enum class SubSetType
|
||||
{
|
||||
SS_UNKNOWN = -1,
|
||||
SS_MAP_SETTINGS,
|
||||
SS_FUNCTION_BARS,
|
||||
SS_FUNCTION_KEYS,
|
||||
SS_SYMBOL_FILTER,
|
||||
SS_BUILDING_COMPONENT_FILTER,
|
||||
SS_AES_FILTER
|
||||
};
|
||||
|
||||
|
||||
struct SubSet final
|
||||
{
|
||||
SubSet() = default;
|
||||
SubSet(const QString &_name, SubSetType _type = SubSetType::SS_UNKNOWN)
|
||||
: name(_name), type(_type), bIsSystemDefault(false) {}
|
||||
|
||||
void markAsSystemDefault(bool mark = true) { bIsSystemDefault = mark; }
|
||||
bool isMarkedAsSystemDefault() const { return bIsSystemDefault; }
|
||||
|
||||
QString name;
|
||||
SubSetType type = SubSetType::SS_UNKNOWN;
|
||||
QJsonValue data;
|
||||
bool bIsSystemDefault;
|
||||
};
|
||||
|
||||
|
||||
class SubSetHandler // OPM Setting's InterfaceImpl, which is a QObject, inherites this
|
||||
{
|
||||
public:
|
||||
SubSetHandler() = default;
|
||||
virtual ~SubSetHandler() = default;
|
||||
|
||||
virtual bool saveSubSet(SubSet &subset) = 0;
|
||||
virtual bool loadSubSet(SubSet &subset) = 0;
|
||||
};
|
||||
|
||||
|
||||
class SettingsGroup
|
||||
{
|
||||
public:
|
||||
SettingsGroup(const QString &group, const QString &id, SubSetHandler *handler, LtsUtils::OperatorSettings *opSettings);
|
||||
virtual ~SettingsGroup() = default;
|
||||
|
||||
bool init();
|
||||
|
||||
const QString &id() const { return m_id; }
|
||||
const QJsonObject &data() const { return m_data; }
|
||||
const QString &group() const { return m_group; }
|
||||
|
||||
void markSubsetAsSystemDefault(bool mark = true)
|
||||
{
|
||||
for (SubSet &itemRef : m_subsets)
|
||||
itemRef.markAsSystemDefault(mark);
|
||||
}
|
||||
bool isSubsetMarkedAsSystemDefault()
|
||||
{
|
||||
if (m_subsets.isEmpty())
|
||||
return false;
|
||||
return m_subsets.first().isMarkedAsSystemDefault();
|
||||
}
|
||||
|
||||
|
||||
QJsonValue value(const QString &key);
|
||||
void setValue(const QString &key, const QJsonValue &value);
|
||||
|
||||
void startLoad();
|
||||
void startSave();
|
||||
void startDelete();
|
||||
void registerSubset(const SubSet &subset);
|
||||
|
||||
protected:
|
||||
|
||||
virtual bool aboutToLoad() { return true; }
|
||||
virtual bool aboutToSave() { return true; }
|
||||
virtual bool aboutToDelete() { return true; }
|
||||
|
||||
QJsonObject jsonObjectFromSettings(const QString &group, const QString &id) const;
|
||||
|
||||
QString m_group;
|
||||
QString m_id;
|
||||
SubSetHandler *m_subSetHandler; //not owning
|
||||
QJsonObject m_data;
|
||||
QVector<SubSet> m_subsets;
|
||||
LtsUtils::OperatorSettings *m_opSettings; //not owning
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
|
||||
} // namespace OperatorManagement
|
||||
Executable
+106
@@ -0,0 +1,106 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* OperatorManagement - Create a new preset entry
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#include "operator_settings_create_new_dialog.h"
|
||||
#include "ui_operator_settings_create_new_dialog.h"
|
||||
#include <LtsWidgets/lts_message_dialog.h>
|
||||
#include <QComboBox>
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
|
||||
OperatorSettingsCreateNewDialog::OperatorSettingsCreateNewDialog(CreationType type,
|
||||
QComboBox *cbxNames,
|
||||
QWidget *parent)
|
||||
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal)
|
||||
, m_ui(new Ui::OperatorSettingsCreateNewDialog)
|
||||
, m_type(type)
|
||||
, m_cbxNames(cbxNames)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
||||
m_ui->setupUi(this);
|
||||
|
||||
// hmpf
|
||||
connect(m_ui->ltsDialogButtonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked,
|
||||
this, &OperatorSettingsCreateNewDialog::apply);
|
||||
connect(m_ui->ltsDialogButtonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked,
|
||||
this, &OperatorSettingsCreateNewDialog::close);
|
||||
connect(m_ui->cbAsDefault, &QCheckBox::toggled,
|
||||
this, &OperatorSettingsCreateNewDialog::onToggled);
|
||||
|
||||
QString title;
|
||||
QString label;
|
||||
switch (m_type)
|
||||
{
|
||||
case CreationType::Workspace:
|
||||
title = tr("Workspace");
|
||||
label = tr("Workspace Name:");
|
||||
break;
|
||||
case CreationType::FilterPreset:
|
||||
title = tr("Filter Preset");
|
||||
label = tr("Filter Preset Name:");
|
||||
}
|
||||
m_ui->lbxName->setText(label);
|
||||
setWindowTitle(tr("Create New %1").arg(title));
|
||||
|
||||
// how is this done for LtsFramelessDialog?
|
||||
//setOnlineHelpFilename(QStringLiteral("Situation-Settings"));
|
||||
}
|
||||
|
||||
OperatorSettingsCreateNewDialog::~OperatorSettingsCreateNewDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void OperatorSettingsCreateNewDialog::onToggled(bool toggled)
|
||||
{
|
||||
if (toggled)
|
||||
{
|
||||
m_previousName = m_ui->leName->text();
|
||||
m_ui->leName->setText(QStringLiteral("default"));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->leName->setText(m_previousName);
|
||||
}
|
||||
m_ui->leName->setEnabled(!toggled);
|
||||
}
|
||||
|
||||
void OperatorSettingsCreateNewDialog::apply()
|
||||
{
|
||||
const QString name = m_ui->leName->text();
|
||||
if (name.isEmpty())
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Please fill the Name Field."), tr("Error"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (nameAlreadyInUse(name))
|
||||
{
|
||||
switch (m_type)
|
||||
{
|
||||
case CreationType::Workspace:
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Workspace name is already in use."), tr("Error"));
|
||||
return;
|
||||
case CreationType::FilterPreset:
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Filter-Preset name is already in use."), tr("Error"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
close();
|
||||
emit resultReady(name);
|
||||
}
|
||||
|
||||
bool OperatorSettingsCreateNewDialog::nameAlreadyInUse(const QString &name) const
|
||||
{
|
||||
return m_cbxNames->findText(name) >= 0;
|
||||
}
|
||||
|
||||
} // OperatorManagement
|
||||
Executable
+57
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* OperatorManagement - Create a new preset entry
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <OperatorManagement/logger.h>
|
||||
#include <LtsWidgets/lts_frameless_dialog.h>
|
||||
|
||||
class QComboBox;
|
||||
namespace Ui
|
||||
{
|
||||
class OperatorSettingsCreateNewDialog;
|
||||
}
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
|
||||
enum class CreationType
|
||||
{
|
||||
Workspace,
|
||||
FilterPreset
|
||||
};
|
||||
|
||||
class OperatorSettingsCreateNewDialog final : public LtsWidgets::LtsFramelessDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OperatorSettingsCreateNewDialog(CreationType type,
|
||||
QComboBox *cbxNames,
|
||||
QWidget *parent = nullptr);
|
||||
~OperatorSettingsCreateNewDialog();
|
||||
|
||||
signals:
|
||||
void resultReady(const QString &result);
|
||||
|
||||
private slots:
|
||||
void onToggled(bool toggled);
|
||||
|
||||
private:
|
||||
void apply();
|
||||
bool nameAlreadyInUse(const QString &name) const;
|
||||
|
||||
private:
|
||||
Ui::OperatorSettingsCreateNewDialog *m_ui;
|
||||
CreationType m_type;
|
||||
QComboBox *m_cbxNames;
|
||||
QString m_previousName;
|
||||
};
|
||||
|
||||
} // OperatorManagement
|
||||
Executable
+82
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OperatorSettingsCreateNewDialog</class>
|
||||
<widget class="QWidget" name="OperatorSettingsCreateNewDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>348</width>
|
||||
<height>79</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="lbxName">
|
||||
<property name="text">
|
||||
<string notr="true"><Name>:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leName">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Workspace Name</string>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbAsDefault">
|
||||
<property name="toolTip">
|
||||
<string>If a new Workspace is saved as the default Workspace it will be saved with name 'default' and is loaded if a new app is started.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save as default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="vs">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="LtsWidgets::LtsDialogButtonBox" name="ltsDialogButtonBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsWidgets::LtsDialogButtonBox</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsWidgets/lts_dialog_button_box.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+1086
File diff suppressed because it is too large.
Load diff
+231
@@ -0,0 +1,231 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* OperatorManangement - Operator Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SettingsGroup/opm_settings_group.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>
|
||||
|
||||
#include <QBasicTimer>
|
||||
#include <QPointer>
|
||||
#include <QLabel>
|
||||
|
||||
enum LtsDate
|
||||
{
|
||||
DtgShort,
|
||||
DtgLong,
|
||||
Iso
|
||||
};
|
||||
|
||||
|
||||
namespace Ui { class OperatorSettingsDialog; }
|
||||
namespace LtsSession { class LtsSession; }
|
||||
namespace LtsUtils
|
||||
{
|
||||
class OperatorSettings;
|
||||
class ProjectSettings;
|
||||
}
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
// --------------------------------------------------------
|
||||
// OperatorManagementEditDialog
|
||||
// --------------------------------------------------------
|
||||
class OperatorSettingsDialog : public LtsWidgets::LtsDialog
|
||||
, protected OperatorManagement::Interface::Ftc::OperatorCreateModifyReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OperatorSettingsDialog(LtsSession::LtsSession *session, QWidget *parent = nullptr);
|
||||
~OperatorSettingsDialog();
|
||||
|
||||
//OperatorCreateModifyReplyHandler interface
|
||||
void onOperatorCreateModifyReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
bool init(const QMap<QString, SettingsGroup *> *workspaceMap,
|
||||
const QMap<QString, SettingsGroup *> *filterMap,
|
||||
bool enaDisaFilterPresets,
|
||||
bool enaDisaOpsettings);
|
||||
|
||||
void updateWorkspaceCombobox(const QString &preselectWorkspaceId = QString());
|
||||
void updateFilterPresetCombobox(const QString &preselectFilterId = QString());
|
||||
|
||||
signals:
|
||||
void signalCreateNewWorkspace(const QString &names);
|
||||
void signalCreateNewFilterPreset(const QString &name);
|
||||
|
||||
void signalOverwriteWorkspace(const QString &id, const QString &name, const QString &filterPresetId);
|
||||
void signalOverwriteFilterPreset(const QString &id, const QString &name);
|
||||
|
||||
void signalLoadWorkspace(const QString &id, bool loadFilterPreset);
|
||||
void signalLoadFilterPreset(const QString &id);
|
||||
|
||||
void signalDeleteWorkspace(const QString &id);
|
||||
void signalDeleteFilterPreset(const QString &id);
|
||||
|
||||
private slots:
|
||||
|
||||
void onWorkspaceLoad();
|
||||
void onFilterPresetLoad();
|
||||
|
||||
void onWorkspaceOverwrite();
|
||||
void onFilterPresetOverwrite();
|
||||
|
||||
void onWorkspaceCreateNew();
|
||||
void onFilterPresetCreateNew();
|
||||
|
||||
void onWorkspaceDelete();
|
||||
void onFilterPresetDelete();
|
||||
void onFilterPresetsComboboxIndexChanged(int index);
|
||||
|
||||
void onWorkspacesComboboxIndexChanged(int index);
|
||||
|
||||
void onChangePassword();
|
||||
void onChangeProfilePicture();
|
||||
|
||||
void onMineAreaInputModeChanged();
|
||||
|
||||
void onTimerTimeout();
|
||||
void onTempActions();
|
||||
|
||||
private:
|
||||
void enaDisaOpsettings(bool enabled);
|
||||
void enaDisaFilterPresets(bool enabled);
|
||||
|
||||
void retranslate() override;
|
||||
bool apply() override final;
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
void setFilterPresetComboboxIndexById(const QString &filterPresetId);
|
||||
void setWorkspaceComboboxIndexById(const QString &workspaceId);
|
||||
|
||||
void updateCombobox(QComboBox *cbx,
|
||||
const QMap<QString, SettingsGroup *> *items,
|
||||
const QPair<QString, QString> &defaultItem,
|
||||
const QString &preselectId);
|
||||
|
||||
QString selectedFilterId() const;
|
||||
QString selectedWorkspaceId() const;
|
||||
|
||||
QString currentWorkspaceId() const;
|
||||
|
||||
std::shared_ptr<OperatorManagement::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<OperatorManagement::Interface::Ftc> m_ftc;
|
||||
LtsUtils::OperatorSettings *m_opSettings;
|
||||
QTimer *m_timer;
|
||||
Ui::OperatorSettingsDialog *m_ui;
|
||||
LOGGER_T m_logger;
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
LtsSession::LtsSession *m_session;
|
||||
QPixmap m_operatorPixmap;
|
||||
QString m_keyCache;
|
||||
|
||||
const QMap<QString /*workspaceId*/, SettingsGroup *> *m_workspaceMap; // not owning
|
||||
const QMap<QString /*filterId*/, SettingsGroup *> *m_filterMap; // not owning
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/*************** Tetra **************/
|
||||
|
||||
enum TetraShape { NoShape = 0, ZShape, SShape, LineShape, TShape, SquareShape,
|
||||
LShape, MirroredLShape
|
||||
};
|
||||
class TetraPiece
|
||||
{
|
||||
public:
|
||||
TetraPiece() { setShape(NoShape); }
|
||||
|
||||
void setRandomShape();
|
||||
void setShape(TetraShape shape);
|
||||
|
||||
TetraShape shape() const { return pieceShape; }
|
||||
int x(int index) const { return coords[index][0]; }
|
||||
int y(int index) const { return coords[index][1]; }
|
||||
int minX() const;
|
||||
int maxX() const;
|
||||
int minY() const;
|
||||
int maxY() const;
|
||||
TetraPiece rotatedLeft() const;
|
||||
TetraPiece rotatedRight() const;
|
||||
|
||||
private:
|
||||
void setX(int index, int x) { coords[index][0] = x; }
|
||||
void setY(int index, int y) { coords[index][1] = y; }
|
||||
|
||||
TetraShape pieceShape;
|
||||
int coords[4][2];
|
||||
};
|
||||
|
||||
class TetraBoard : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TetraBoard(QWidget *parent = nullptr);
|
||||
|
||||
void setNextPieceLabel(QLabel *label);
|
||||
QSize sizeHint() const override;
|
||||
QSize minimumSizeHint() const override;
|
||||
|
||||
public slots:
|
||||
void start();
|
||||
void pause();
|
||||
|
||||
signals:
|
||||
void scoreChanged(int score);
|
||||
void levelChanged(int level);
|
||||
void linesRemovedChanged(int numLines);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
void timerEvent(QTimerEvent *event) override;
|
||||
|
||||
private:
|
||||
enum { BoardWidth = 10, BoardHeight = 22 };
|
||||
|
||||
TetraShape &shapeAt(int x, int y) { return board[(y * BoardWidth) + x]; }
|
||||
int timeoutTime() { return 1000 / (1 + level); }
|
||||
int squareWidth() { return contentsRect().width() / BoardWidth; }
|
||||
int squareHeight() { return contentsRect().height() / BoardHeight; }
|
||||
void clearBoard();
|
||||
void dropDown();
|
||||
void oneLineDown();
|
||||
void pieceDropped(int dropHeight);
|
||||
void removeFullLines();
|
||||
void newPiece();
|
||||
void showNextPiece();
|
||||
bool tryMove(const TetraPiece &newPiece, int newX, int newY);
|
||||
void drawSquare(QPainter &painter, int x, int y, TetraShape shape);
|
||||
|
||||
QBasicTimer timer;
|
||||
QPointer<QLabel> nextPieceLabel;
|
||||
bool isStarted;
|
||||
bool isPaused;
|
||||
bool isWaitingAfterLine;
|
||||
TetraPiece curPiece;
|
||||
TetraPiece nextPiece;
|
||||
int curX;
|
||||
int curY;
|
||||
int numLinesRemoved;
|
||||
int numPiecesDropped;
|
||||
int score;
|
||||
int level;
|
||||
TetraShape board[BoardWidth * BoardHeight];
|
||||
};
|
||||
|
||||
}
|
||||
+557
@@ -0,0 +1,557 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OperatorSettingsDialog</class>
|
||||
<widget class="QWidget" name="OperatorSettingsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1133</width>
|
||||
<height>417</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="9" column="0" colspan="3">
|
||||
<spacer name="vspacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="cbScriptsHideOnDrag">
|
||||
<property name="text">
|
||||
<string>Hide detail area when draging topics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gbWorkspaces">
|
||||
<property name="title">
|
||||
<string>Workspace</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="verticalSpacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbWorkspaces">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentText">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="7">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="8" rowspan="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="pbLoadWorkspace">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="pbOverwriteWorkspace">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QPushButton" name="pbDeleteWorkspace">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QPushButton" name="pbCreateNewWorkspace">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save As</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QPushButton" name="pbDEBUGNewWsID">
|
||||
<property name="text">
|
||||
<string notr="true">[Generate New WsID]</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gbFilterPresets">
|
||||
<property name="title">
|
||||
<string>Filter Presets</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="5">
|
||||
<spacer name="hsFilterPresets">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>81</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pbLoadFilterPreset">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="pbOverwriteFilterPreset">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="pbCreateNewFilterPreset">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save As</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbFilterPresets">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentText">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="pbDeleteFilterPreset">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gbOperator">
|
||||
<property name="title">
|
||||
<string>Operator</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="LtsWidgets::LtsProfileButton" name="ltsProfileButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="pbChangePassword">
|
||||
<property name="text">
|
||||
<string>Change Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<spacer name="hsOperator">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="pbTempActions">
|
||||
<property name="text">
|
||||
<string>Temporary Actions</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gbTime">
|
||||
<property name="title">
|
||||
<string>Time</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="3" column="1">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbTimeZone">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbxTimeZone">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Time Zone:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbxFixTime">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Fix Time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbxTimeOffset">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Time Offset:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QTimeEdit" name="teTimeOffset">
|
||||
<property name="displayFormat">
|
||||
<string notr="true">mm:ss</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="LtsWidgets::LtsDateTimeEdit" name="ltsDateTimeEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbTimeDisplay">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lbxTimeDisplay">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Time Display:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" rowspan="5">
|
||||
<spacer name="hsTime">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gbMineArea">
|
||||
<property name="title">
|
||||
<string>Mine Area</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="2">
|
||||
<spacer name="hsMineArea">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbxInputMode">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Input Mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="LtsWidgets::LtsComboBox" name="cbMineAreaInputMode"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Scripts:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LtsWidgets::LtsProfileButton</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsWidgets/lts_profile_button.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>LtsWidgets::LtsComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>LtsWidgets/lts_combo_box.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>LtsWidgets::LtsDateTimeEdit</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>LtsWidgets/lts_date_time_edit.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>cbWorkspaces</tabstop>
|
||||
<tabstop>pbLoadWorkspace</tabstop>
|
||||
<tabstop>pbOverwriteWorkspace</tabstop>
|
||||
<tabstop>pbCreateNewWorkspace</tabstop>
|
||||
<tabstop>pbDeleteWorkspace</tabstop>
|
||||
<tabstop>pbDEBUGNewWsID</tabstop>
|
||||
<tabstop>cbFilterPresets</tabstop>
|
||||
<tabstop>pbLoadFilterPreset</tabstop>
|
||||
<tabstop>pbOverwriteFilterPreset</tabstop>
|
||||
<tabstop>pbCreateNewFilterPreset</tabstop>
|
||||
<tabstop>pbDeleteFilterPreset</tabstop>
|
||||
<tabstop>pbChangePassword</tabstop>
|
||||
<tabstop>pbTempActions</tabstop>
|
||||
<tabstop>ltsDateTimeEdit</tabstop>
|
||||
<tabstop>teTimeOffset</tabstop>
|
||||
<tabstop>cbTimeZone</tabstop>
|
||||
<tabstop>cbTimeDisplay</tabstop>
|
||||
<tabstop>cbMineAreaInputMode</tabstop>
|
||||
<tabstop>cbScriptsHideOnDrag</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+1110
File diff suppressed because it is too large.
Load diff
+178
@@ -0,0 +1,178 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Gui Plugin for OperatorManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <OperatorManagement/logger.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <Plugins/OperatorManagement/opm_gui_plugin_interface.h>
|
||||
#include <Plugins/OperatorManagement/opm_data_plugin_interface.h>
|
||||
#include <Plugins/OperatorManagement/opm_settings_gui_plugin_interface.h>
|
||||
#include <FilterManagement/flt_participant_plugin_interface.h>
|
||||
#include <FilterManagement/flt_aes_plugin_interface.h>
|
||||
#include <FilterManagement/flt_building_cmpnt_plugin_interface.h>
|
||||
#include <FilterManagement/flt_ftc.h>
|
||||
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
||||
|
||||
#include "SettingsGroup/opm_settings_group.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace LtsUtils
|
||||
{
|
||||
class OperatorSettings;
|
||||
class ProjectSettings;
|
||||
class RequestHelper;
|
||||
}
|
||||
|
||||
namespace OperatorManagement
|
||||
{
|
||||
class OperatorSettingsDialog;
|
||||
|
||||
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
|
||||
{
|
||||
Q_PLUGIN_METADATA(IID "gui:3:opm.settings")
|
||||
Q_INTERFACES(GuiPluginBase::Plugin)
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
GuiPlugin() = default;
|
||||
~GuiPlugin() = default;
|
||||
|
||||
QString pluginName() override { return QLatin1String("OperatorSettingsGuiPlugin"); }
|
||||
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
|
||||
bool availableInPartition(IDL::PartitionType ) const override { return true; }
|
||||
};
|
||||
|
||||
class InterfaceImpl final
|
||||
: public QObject
|
||||
, public ForeignSettingsGuiInterface
|
||||
, public GuiPluginBase::Interface
|
||||
, public FilterManagement::Interface::Ftc::SymbolAppearanceUpdateReplyHandler
|
||||
, public FilterManagement::Interface::Ftc::AesFilterUpdateReplyHandler
|
||||
, public FilterManagement::Interface::Ftc::BuildingComponentFilterUpdateReplyHandler
|
||||
|
||||
, public SubSetHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
||||
|
||||
~InterfaceImpl();
|
||||
|
||||
bool fetchInterfaces() override;
|
||||
void clearInterfaces() override;
|
||||
QString menuGroup() const override { return tr("Operators"); }
|
||||
QVector<LtsWidgets::PluginData> getActions() override;
|
||||
bool availableInPartition(IDL::PartitionType ) const override { return true; }
|
||||
|
||||
// load workspace after the settings were initialized by opm login
|
||||
int executionPriority() const override { return 1; /* after opm login (0) */ }
|
||||
void executePayload(LtsWidgets::LtsBackgroundWidget *mainBackground) override;
|
||||
|
||||
private:
|
||||
// AesFilterUpdateReplyHandler interface
|
||||
void onAesFilterUpdateReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
// SymbolAppearanceUpdateReplyHandler interface
|
||||
void onSymbolAppearanceUpdateReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
// BuildingComponentFilterUpdateReplyHandler interface
|
||||
void onBuildingComponentFilterUpdateReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
|
||||
// ForeignSettingsGuiInterface interface
|
||||
void callWorkspaceSaveUnsaved(const QString &saveAsWorkspaceId) override final;
|
||||
|
||||
// SubSetHandler interface
|
||||
bool saveSubSet(SubSet &subset) override final;
|
||||
bool loadSubSet(SubSet &subset) override final;
|
||||
|
||||
signals:
|
||||
void signalWorkspaceSaveFinished(const QString &workspaceId);
|
||||
void signalFilterPresetSaveFinished(const QString &filterPresetId);
|
||||
|
||||
void signalWorkspaceLoadFinished(const QString &workspaceId);
|
||||
void signalFilterPresetLoadFinished(const QString &filterPresetId);
|
||||
|
||||
void signalWorkspaceDeleteFinished(const QString &workspaceId);
|
||||
void signalFilterPresetDeleteFinished(const QString &filterPresetId);
|
||||
|
||||
private slots:
|
||||
void slotOnSessionReady();
|
||||
void onOperatorSettingsValueChanged(const QString &group, const QString &identifier, const QVariant &value);
|
||||
void onOperatorSettingsValueRemoved(const QString &group, const QString &identifier);
|
||||
|
||||
private:
|
||||
void createNewWorkspace(const QString &workspaceName);
|
||||
void createNewFilterPreset(const QString &filterPresetName);
|
||||
|
||||
bool workspaceExists(const QString &workspaceId) const;
|
||||
QString defaultWorkspaceId() const;
|
||||
|
||||
bool workspaceLoad(const QString &workspaceId, bool loadFilterPreset = true);
|
||||
void workspaceSave(const QString &workspaceId, const QString &workspaceName, const QString &filterPresetId = QString());
|
||||
void workspaceDelete(const QString &workspaceId);
|
||||
void workspaceLoadUnsaved(const QString &workspaceId);
|
||||
void workspaceSaveUnsaved(const QString &workspaceId, const QString &filterPresetId);
|
||||
void workspaceDeleteUnsaved();
|
||||
void fillWorkspaceMapFromSettings();
|
||||
|
||||
QString defaultFilterPresetId() const;
|
||||
bool filterPresetLoad(const QString &filterPresetId);
|
||||
void filterPresetDelete(const QString &filterPresetId);
|
||||
void filterPresetLoadUnsaved(const QString &filterPresetId);
|
||||
void filterPresetSave(const QString &filterPresetId, const QString &filterPresetName);
|
||||
void filterPresetSaveUnsaved(const QString &filterPresetId);
|
||||
void filterPresetDeleteUnsaved();
|
||||
void fillFilterMapFromSettings();
|
||||
|
||||
LtsWidgets::LtsDialog *onShowOperatorSettingsDialog(QWidget *parent);
|
||||
|
||||
std::shared_ptr<OperatorManagement::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<OperatorManagement::Interface::Ftc> m_ftc;
|
||||
std::shared_ptr<FilterManagement::ForeignFltParticipantGuiInterface> m_fltParticipantIfc;
|
||||
std::shared_ptr<FilterManagement::ForeignAesGuiInterface> m_fltAesIfc;
|
||||
std::shared_ptr<FilterManagement::ForeignFltBuildingComponentGuiInterface> m_fltBuildingComponentIfc;
|
||||
std::shared_ptr<FilterManagement::Interface::Ftc> m_fltFtc;
|
||||
std::shared_ptr<SituationMap::ForeignGuiInterface> m_sitMapIfc;
|
||||
|
||||
|
||||
LtsUtils::OperatorSettings *m_opSettings;
|
||||
|
||||
QPointer<OperatorSettingsDialog> m_operatorSettingsDialog;
|
||||
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
|
||||
SettingsGroup *m_unsavedWorkspace;
|
||||
SettingsGroup *m_unsavedFilterPreset;
|
||||
bool m_validOperatorMapSettingsSent;
|
||||
|
||||
QMap<QString /*workspaceId*/, SettingsGroup *> m_workspaceMap;
|
||||
QMap<QString /*filterId*/, SettingsGroup *> m_filterMap;
|
||||
|
||||
};
|
||||
|
||||
|
||||
class Workspace final: public SettingsGroup
|
||||
{
|
||||
public:
|
||||
Workspace(const QString &id, SubSetHandler *handler, LtsUtils::OperatorSettings *opSettings);
|
||||
};
|
||||
|
||||
|
||||
class FilterPreset final : public SettingsGroup
|
||||
{
|
||||
public:
|
||||
FilterPreset(const QString &id, SubSetHandler *handler, LtsUtils::OperatorSettings *opSettings);
|
||||
};
|
||||
|
||||
|
||||
} // namespace OperatorManagement
|
||||
Reference in new issue
Block a user