Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set
new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
This commit is contained in:
1 parent
eb1d949edc
commit
815e16368e
1718 files changed
+126739
-18495
No files matched your search
+5
-5
@@ -83,11 +83,11 @@ void OperatorChangePassword::onOkay()
|
||||
}
|
||||
|
||||
OperatorManagement::OperatorChangePasswordRequest req;
|
||||
req.id(m_operatorId);
|
||||
|
||||
req.oldPassword(m_ui->leOldPassword->text().toStdString());
|
||||
req.password(m_ui->leNewPassword->text().toStdString());
|
||||
req.forceSet(m_ui->leOldPassword->isHidden());
|
||||
req.id = m_operatorId;
|
||||
|
||||
req.oldPassword = m_ui->leOldPassword->text().toStdString();
|
||||
req.password = m_ui->leNewPassword->text().toStdString();
|
||||
req.forceSet = m_ui->leOldPassword->isHidden();
|
||||
m_requestHelper->addRequest([this,req]()
|
||||
{
|
||||
return m_ftc->operatorChangePasswordRequest(req, this);
|
||||
|
||||
+29
-28
@@ -10,7 +10,7 @@
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_translation.h>
|
||||
#include <ExerciseManagement/exm_data_plugin_interface.h>
|
||||
#include <LtsUtils/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector_to_pixmap.h>
|
||||
|
||||
#include <QtGui/QIcon>
|
||||
|
||||
@@ -34,6 +34,7 @@ OperatorManagementDialogModel::OperatorManagementDialogModel(QObject *parent, in
|
||||
tr("Exercises"),
|
||||
tr("Preset Role")},
|
||||
parent)
|
||||
, m_logger(getLogger("OpeartorManagementDialogModel"))
|
||||
, m_dtc(nullptr)
|
||||
, m_ppmDtc(nullptr)
|
||||
#ifdef BUILD_RTI
|
||||
@@ -92,8 +93,8 @@ bool OperatorManagementDialogModel::initModel(LtsSession::LtsSession *session, c
|
||||
{
|
||||
auto cb = [this](const Group &group)
|
||||
{
|
||||
if (group.type() == GroupType::PresetGroup)
|
||||
m_roles[group.id()] = QString::fromStdString(group.name());
|
||||
if (group.type == GroupType::PresetGroup)
|
||||
m_roles[group.id] = QString::fromStdString(group.name);
|
||||
};
|
||||
dtc->groups(cb);
|
||||
}
|
||||
@@ -104,9 +105,9 @@ bool OperatorManagementDialogModel::initModel(LtsSession::LtsSession *session, c
|
||||
void OperatorManagementDialogModel::onPartyChanged(const ParticipantManagement::Party &data, DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
m_parties.remove(data.id());
|
||||
m_parties.remove(data.id);
|
||||
else
|
||||
m_parties[data.id()] = ParticipantManagement::trPartyName(data.name());
|
||||
m_parties[data.id] = ParticipantManagement::trPartyName(data.name);
|
||||
for (int row = 0; row < m_vecData.size(); ++row)
|
||||
{
|
||||
const QModelIndex idx(index(row, VisibleParties));
|
||||
@@ -118,9 +119,9 @@ void OperatorManagementDialogModel::onPartyChanged(const ParticipantManagement::
|
||||
void OperatorManagementDialogModel::onExerciseChanged(const ExerciseManagement::Exercise &data, DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
m_exercises.remove(data.id());
|
||||
m_exercises.remove(data.id);
|
||||
else
|
||||
m_exercises[data.id()] = QString::fromStdString(data.name());
|
||||
m_exercises[data.id] = QString::fromStdString(data.name);
|
||||
for (int row = 0; row < m_vecData.size(); ++row)
|
||||
{
|
||||
const QModelIndex idx(index(row, Exercises));
|
||||
@@ -143,33 +144,33 @@ QVariant OperatorManagementDialogModel::data(const QModelIndex &index, int role)
|
||||
if (role == Qt::DisplayRole)
|
||||
{
|
||||
const UserType &op = m_vecData.at(index.row());
|
||||
std::vector<OperatorManagement::PartiesByExercise> pbe = op.visiblePartiesByExercise();
|
||||
std::vector<OperatorManagement::PartiesByExercise> pbe = op.visiblePartiesByExercise;
|
||||
switch (index.column())
|
||||
{
|
||||
case Name:
|
||||
return QString::fromStdString(op.name());
|
||||
return QString::fromStdString(op.name);
|
||||
case Description:
|
||||
return QString::fromStdString(op.description());
|
||||
return QString::fromStdString(op.description);
|
||||
case VisibleParties:
|
||||
return hasVisibleParties(pbe);
|
||||
case RolePreset:
|
||||
return rolePreset(op.rolePresetId());
|
||||
return rolePreset(op.rolePresetId);
|
||||
case Id:
|
||||
return QString::number(op.id());
|
||||
return QString::number(op.id);
|
||||
case EffectiveAcls:
|
||||
return effectiveAcls(op.effectiveAcls());
|
||||
return effectiveAcls(op.effectiveAcls);
|
||||
case PrimaryGroupId:
|
||||
return QString::number(op.primaryGroupId());
|
||||
return QString::number(op.primaryGroupId);
|
||||
case ProjectionPriority:
|
||||
return priority(op.projectionPriority());
|
||||
return priority(op.projectionPriority);
|
||||
case AudioChannelPriority:
|
||||
return priority(op.audioChannelPriority());
|
||||
return priority(op.audioChannelPriority);
|
||||
case Image:
|
||||
return LtsUtils::getPixmap(op.image());
|
||||
return LtsUtils::getPixmap(op.image);
|
||||
case Workstation:
|
||||
return workstation(op.workstationId(), op.workstationIp());
|
||||
return workstation(op.workstationId, op.workstationIp);
|
||||
case Exercises:
|
||||
return exercises(op.exerciseIds());
|
||||
return exercises(op.exerciseIds);
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
@@ -191,12 +192,12 @@ QString OperatorManagementDialogModel::workstation(int wsId, int wsIp) const
|
||||
|
||||
}
|
||||
|
||||
QString OperatorManagementDialogModel::rolePreset(const dds::core::optional<int32_t> &rolePresetId) const
|
||||
QString OperatorManagementDialogModel::rolePreset(const omg::types::optional<int32_t> &rolePresetId) const
|
||||
{
|
||||
if (!rolePresetId.is_set())
|
||||
if (!rolePresetId.has_value())
|
||||
return tr("---");
|
||||
|
||||
int32_t id = rolePresetId.get();
|
||||
int32_t id = rolePresetId.value();
|
||||
|
||||
if (id <= 0)
|
||||
return tr("---");
|
||||
@@ -212,17 +213,17 @@ QString OperatorManagementDialogModel::hasVisibleParties(const std::vector<Opera
|
||||
|
||||
for (const auto &pbe : vpbe)
|
||||
{
|
||||
if (pbe.exerciseId() != exerciseId)
|
||||
if (pbe.exerciseId != exerciseId)
|
||||
continue;
|
||||
|
||||
std::vector<int32_t> hiddenParties = {};
|
||||
if (pbe.hiddenParties().is_set())
|
||||
hiddenParties = pbe.hiddenParties().get();
|
||||
if (pbe.hiddenParties.has_value())
|
||||
hiddenParties = pbe.hiddenParties.value();
|
||||
|
||||
if(!pbe.visibleParties().is_set())
|
||||
if(!pbe.visibleParties.has_value())
|
||||
return {};
|
||||
|
||||
for (const auto &partyId : pbe.visibleParties().get())
|
||||
for (const auto &partyId : pbe.visibleParties.value())
|
||||
{
|
||||
bool isHidden = false;
|
||||
for (const int &hiddenId : hiddenParties)
|
||||
@@ -284,7 +285,7 @@ bool OperatorManagementDialogModel::isFiltered(const UserType &data, DataModific
|
||||
|
||||
if (m_exerciseId == 0)
|
||||
return false;
|
||||
for (auto exId : data.exerciseIds())
|
||||
for (auto exId : data.exerciseIds)
|
||||
if (exId == m_exerciseId)
|
||||
return false;
|
||||
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
#ifdef BUILD_RTI
|
||||
|
||||
#include <OperatorManagement/opm_dtc.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ExerciseManagement/exm_dtc.h>
|
||||
#include <OperatorManagement/logger.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
@@ -57,7 +57,7 @@ NGL::INGLLogger &m_logger;
|
||||
QString effectiveAcls(std::vector<int32_t> acls) const;
|
||||
QString priority(int16_t prio) const;
|
||||
QString exercises(const std::vector<int32_t> &exercises) const;
|
||||
QString rolePreset(const dds::core::optional<int32_t> &rolePresetId) const;
|
||||
QString rolePreset(const omg::types::optional<int32_t> &rolePresetId) const;
|
||||
QString workstation(int wsId, int wsIp) const;
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
+3
-3
@@ -171,7 +171,7 @@ LoginWindow::LoginWindow(QWidget *parent, bool isAAR)
|
||||
m_ui->pbEn_GB->hide();
|
||||
m_ui->pbEn_US->hide();
|
||||
const QString languages = LtsUtils::ProjectSettings::getInstance()->value(QStringLiteral("pdm"), QStringLiteral("SystemLanguages")).toString();
|
||||
const QVector<QStringRef> slLang = languages.splitRef(QLatin1Char(','), QString::SkipEmptyParts);
|
||||
const QVector<QString> slLang = languages.split(QLatin1Char(','), Qt::SkipEmptyParts);
|
||||
|
||||
if (slLang.isEmpty())
|
||||
{
|
||||
@@ -181,7 +181,7 @@ LoginWindow::LoginWindow(QWidget *parent, bool isAAR)
|
||||
{
|
||||
if (slLang.size() > 1)
|
||||
{
|
||||
for (QStringRef lang : slLang)
|
||||
for (QString lang : slLang)
|
||||
{
|
||||
lang = lang.trimmed();
|
||||
|
||||
@@ -202,7 +202,7 @@ LoginWindow::LoginWindow(QWidget *parent, bool isAAR)
|
||||
}
|
||||
else
|
||||
{
|
||||
QString lang = slLang.at(0).toString().trimmed();
|
||||
QString lang = slLang.at(0).trimmed();
|
||||
|
||||
if (lang.toLatin1() == "de_DE")
|
||||
m_ui->pbDe_DE->click();
|
||||
|
||||
+48
-48
@@ -14,7 +14,7 @@
|
||||
#include <LtsWidgets/lts_splash.h>
|
||||
#include <LtsWidgets/lts_message_dialog.h>
|
||||
#include <LtsWidgets/lts_wait_dialog.h>
|
||||
#include <LtsUtils/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
#include <ConnectDialog/connect_dialog_nt.h>
|
||||
@@ -33,8 +33,8 @@
|
||||
|
||||
#include <OperatorManagement/logger.h>
|
||||
#include <OperatorManagement/opm_operator_rights.h>
|
||||
#include <OperatorManagement/opm_data_plugin.h>
|
||||
#include <AssetManagement/asm_data_plugin.h>
|
||||
#include <OperatorManagement/opm_data_plugin_interface.h>
|
||||
#include <AssetManagement/asm_data_plugin_interface.h>
|
||||
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtCore/QProcess>
|
||||
@@ -172,11 +172,11 @@ AssetManagement::Asset InterfaceImpl::findWorkstation(const QString &wsName)
|
||||
|
||||
auto it = std::find_if(assets.constBegin(), assets.constEnd(), [wsName](const AssetManagement::Asset &as)
|
||||
{
|
||||
return ((as.assetTypeId() == AssetManagement::AssetType::Workstation ||
|
||||
as.assetTypeId() == AssetManagement::AssetType::ProjectionWorkstation ||
|
||||
as.assetTypeId() == AssetManagement::AssetType::MobileAfterActionVehicle)
|
||||
return ((as.assetTypeId == AssetManagement::AssetType::Workstation ||
|
||||
as.assetTypeId == AssetManagement::AssetType::ProjectionWorkstation ||
|
||||
as.assetTypeId == AssetManagement::AssetType::MobileAfterActionVehicle)
|
||||
#if !defined(QUICK_DEBUG) || !defined(LTS_DEBUG)
|
||||
&& QString::fromStdString(as.name()).toUpper() == wsName.toUpper()
|
||||
&& QString::fromStdString(as.name).toUpper() == wsName.toUpper()
|
||||
#endif
|
||||
);
|
||||
});
|
||||
@@ -220,8 +220,8 @@ void InterfaceImpl::slotLogin(int operatorId, const QString &password, bool forc
|
||||
|
||||
|
||||
|
||||
const OperatorManagement::User op = m_dtc->user(operatorId);
|
||||
if (op.id() != operatorId)
|
||||
const OperatorManagement::User op = m_dtc->user(operatorId);
|
||||
if (op.id != operatorId)
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(m_mainBackground, tr("Operator does not exist anymore."), tr("Login failed"));
|
||||
m_loginOperatorName->show();
|
||||
@@ -231,14 +231,14 @@ void InterfaceImpl::slotLogin(int operatorId, const QString &password, bool forc
|
||||
|
||||
|
||||
|
||||
if (op.workstationId() > 0 && op.workstationIp() != LtsSession::LtsSession::workstationIp())
|
||||
if (op.workstationId > 0 && op.workstationIp != LtsSession::LtsSession::workstationIp())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "WsID :" << op.workstationId()
|
||||
<< "ip: " << QString::number(op.workstationIp(), 16)
|
||||
DEBUG_LOG(m_logger) << "WsID :" << op.workstationId
|
||||
<< "ip: " << QString::number(op.workstationIp, 16)
|
||||
<< ", own: " << QString::number(LtsSession::LtsSession::workstationIp(), 16);
|
||||
const auto ws = m_asmDtc->asset(op.workstationId());
|
||||
const auto ws = m_asmDtc->asset(op.workstationId);
|
||||
LtsWidgets::LtsMessageDialog::showMessage(m_mainBackground,
|
||||
tr("Operator already logged in on workstation %1.").arg(QString::fromStdString(ws.name())),
|
||||
tr("Operator already logged in on workstation %1.").arg(QString::fromStdString(ws.name)),
|
||||
tr("Login failed"));
|
||||
m_loginOperatorName->show();
|
||||
m_loginOperatorName->raise();
|
||||
@@ -254,8 +254,8 @@ void InterfaceImpl::slotLogin(int operatorId, const QString &password, bool forc
|
||||
try
|
||||
{
|
||||
AssetManagement::Asset asset(findWorkstation(wsName));
|
||||
m_workstationId = asset.id();
|
||||
certificate = asset.certificate();
|
||||
m_workstationId = asset.id;
|
||||
certificate = asset.certificate;
|
||||
|
||||
DEBUG_LOG(m_logger) << "ws id: " << m_workstationId;
|
||||
|
||||
@@ -348,14 +348,14 @@ void InterfaceImpl::slotLogin(int operatorId, const QString &password, bool forc
|
||||
|
||||
|
||||
OperatorManagement::OperatorLoginRequest req;
|
||||
req.id(op.id());
|
||||
req.password(password.toUtf8().data());
|
||||
req.workstationId(m_workstationId);
|
||||
req.workstationIp(LtsSession::LtsSession::workstationIp());
|
||||
req.id = op.id;
|
||||
req.password = password.toUtf8().data();
|
||||
req.workstationId = m_workstationId;
|
||||
req.workstationIp = LtsSession::LtsSession::workstationIp();
|
||||
#if defined(QUICK_DEBUG) && defined(LTS_DEBUG)
|
||||
force = true;
|
||||
#endif
|
||||
req.force(force);
|
||||
req.force = force;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -392,19 +392,19 @@ void InterfaceImpl::slotLogin(int operatorId, const QString &password, bool forc
|
||||
|
||||
LtsSessionData::LtsSessionData *sessionData = LtsSessionData::LtsSessionData::getInstance();
|
||||
sessionData->setWorkstationId(m_workstationId);
|
||||
sessionData->setOperatorId(op.id());
|
||||
sessionData->setOperatorName(QString::fromStdString(op.name()));
|
||||
sessionData->setOperatorRights(convert<QSet<int>>(op.effectiveAcls()));
|
||||
sessionData->setOperatorId(op.id);
|
||||
sessionData->setOperatorName(QString::fromStdString(op.name));
|
||||
sessionData->setOperatorRights(convert<QSet<int>>(op.effectiveAcls));
|
||||
sessionData->setShowTerminalWindow(sessionData->hasOperatorRight(OperatorRights::TerminalWindowOpen));
|
||||
sessionData->setProfilePicture(LtsUtils::getPixmap(op.image()));
|
||||
sessionData->setProfilePicture(LtsUtils::getPixmap(op.image));
|
||||
|
||||
QVector<LtsSessionData::PartiesByExercise> qVec;
|
||||
for (const auto &pbe : op.visiblePartiesByExercise())
|
||||
for (const auto &pbe : op.visiblePartiesByExercise)
|
||||
{
|
||||
LtsSessionData::PartiesByExercise value;
|
||||
value.exerciseId = pbe.exerciseId();
|
||||
if (pbe.visibleParties().is_set())
|
||||
value.visibleParties = QVector<int>(pbe.visibleParties().get().begin(), pbe.visibleParties().get().end());
|
||||
value.exerciseId = pbe.exerciseId;
|
||||
if (pbe.visibleParties.has_value())
|
||||
value.visibleParties = QVector<int>(pbe.visibleParties.value().begin(), pbe.visibleParties.value().end());
|
||||
qVec.push_back(value);
|
||||
}
|
||||
sessionData->setVisibleParties(qVec);
|
||||
@@ -442,16 +442,16 @@ void InterfaceImpl::slotLogin(int operatorId, const QString &password, bool forc
|
||||
{
|
||||
if (!m_requestHelper->startSingleRequest([this]()
|
||||
{
|
||||
return m_ftc->operatorGetSetSettingsRequest(OperatorGetSetSettingsRequest(m_operatorId, dds::core::optional<std::vector<uint8_t> >()), this);
|
||||
return m_ftc->operatorGetSetSettingsRequest(OperatorGetSetSettingsRequest(m_operatorId, omg::types::optional<std::vector<uint8_t> >()), this);
|
||||
}, [this](const Core::FunctionReply &baseReply)
|
||||
{
|
||||
const OperatorGetSetSettingsReply &reply = static_cast<const OperatorGetSetSettingsReply &>(baseReply);
|
||||
|
||||
if (reply.settings().is_set())
|
||||
if (reply.settings.has_value())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Operator settings loaded, size=" << reply.settings().get().size();
|
||||
DEBUG_LOG(m_logger) << "Operator settings loaded, size=" << reply.settings.value().size();
|
||||
LtsUtils::OperatorSettings* opSettings = LtsUtils::OperatorSettings::getInstance();
|
||||
opSettings->init(LtsUtils::toQByteArray(reply.settings().get()));
|
||||
opSettings->init(LtsUtils::toQByteArray(reply.settings.value()));
|
||||
|
||||
if (m_logger.isDebugEnabled())
|
||||
opSettings->dump();
|
||||
@@ -576,7 +576,7 @@ bool LastStateLoader::go(LastStateLoaderApp &xapp)
|
||||
|
||||
case IDL::PartitionType::Exercise:
|
||||
{
|
||||
if (m_exmDtc->exercise(exerciseId).id() != exerciseId)
|
||||
if (m_exmDtc->exercise(exerciseId).id != exerciseId)
|
||||
{
|
||||
m_errorList.append(tr("App %1 was started inside exercise %2 that does not exist anymore.")
|
||||
.arg(m_session->appToString(xapp.m_appId))
|
||||
@@ -801,20 +801,20 @@ void InterfaceImpl::onOperatorChanged(const User &data, DataModification modType
|
||||
|
||||
LtsSessionData::LtsSessionData *sessionData = LtsSessionData::LtsSessionData::getInstance();
|
||||
|
||||
if (sessionData->getOperatorId() != data.id())
|
||||
if (sessionData->getOperatorId() != data.id)
|
||||
return;
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
return;
|
||||
|
||||
sessionData->setOperatorRights(convert<QSet<int>>(data.effectiveAcls()));
|
||||
sessionData->setOperatorRights(convert<QSet<int>>(data.effectiveAcls));
|
||||
QVector<LtsSessionData::PartiesByExercise> qVec;
|
||||
for (const auto &pbe : data.visiblePartiesByExercise())
|
||||
for (const auto &pbe : data.visiblePartiesByExercise)
|
||||
{
|
||||
LtsSessionData::PartiesByExercise value;
|
||||
value.exerciseId = pbe.exerciseId();
|
||||
if(pbe.visibleParties().is_set())
|
||||
value.visibleParties = QVector<int>(pbe.visibleParties().get().begin(), pbe.visibleParties().get().end());
|
||||
value.exerciseId = pbe.exerciseId;
|
||||
if(pbe.visibleParties.has_value())
|
||||
value.visibleParties = QVector<int>(pbe.visibleParties.value().begin(), pbe.visibleParties.value().end());
|
||||
qVec.push_back(value);
|
||||
}
|
||||
sessionData->setVisibleParties(qVec);
|
||||
@@ -829,16 +829,16 @@ int InterfaceImpl::getOperatorId(const QString &operatorName)
|
||||
for (auto operatorIt = operatorMap.constBegin(); operatorIt != operatorMap.constEnd(); ++operatorIt)
|
||||
{
|
||||
const OperatorManagement::User &op = (*operatorIt);
|
||||
QString realOperatorName = QString::fromStdString(op.name());
|
||||
QString realOperatorName = QString::fromStdString(op.name);
|
||||
|
||||
if (operatorName.compare(realOperatorName, Qt::CaseInsensitive) == 0)
|
||||
if (operatorName.compare(realOperatorName, Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
|
||||
|
||||
m_loginPassword->setOperatorData(op.id(), realOperatorName);
|
||||
m_loginPassword->setProfilePicture(LtsUtils::getPixmap(op.image()));
|
||||
|
||||
return op.id();
|
||||
|
||||
m_loginPassword->setOperatorData(op.id, realOperatorName);
|
||||
m_loginPassword->setProfilePicture(LtsUtils::getPixmap(op.image));
|
||||
|
||||
return op.id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-7
@@ -15,6 +15,7 @@ namespace OperatorManagement
|
||||
RemoteShutdownDialog::RemoteShutdownDialog(QWidget *parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||
, m_ui(new Ui::RemoteShutdownDialog)
|
||||
, m_logger(getLogger("ShutdownDialog"))
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_trvWorkstations(nullptr)
|
||||
, m_trvModel(nullptr)
|
||||
@@ -53,10 +54,10 @@ bool RemoteShutdownDialog::init(const std::shared_ptr<AssetManagement::Interface
|
||||
|
||||
asmDtc->assets([this, &asmDtc, &wsMap](const AssetManagement::Asset & data)
|
||||
{
|
||||
if (data.assetTypeId() == AssetManagement::AssetType::Workstation && m_thisWsId != data.id())
|
||||
if (data.assetTypeId == AssetManagement::AssetType::Workstation && m_thisWsId != data.id)
|
||||
{
|
||||
wsMap.insert(QString::fromStdString(asmDtc->location(data.locationId()).description()),
|
||||
WorkstationModel::WorkstationInfo(data.id(), QString::fromStdString(data.name()), data.subLocation()));
|
||||
wsMap.insert(QString::fromStdString(asmDtc->location(data.locationId).description),
|
||||
WorkstationModel::WorkstationInfo(data.id, QString::fromStdString(data.name), data.subLocation));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -180,10 +181,10 @@ void RemoteShutdownDialog::onConfirmActionClicked()
|
||||
m_requestHelper->startSingleRequest([this, &shutdownAction, &idVector]()
|
||||
{
|
||||
AssetManagement::WorkstationLogout logout;
|
||||
logout.shutdownAction(shutdownAction);
|
||||
logout.ids(idVector);
|
||||
logout.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
logout.originatorId(m_thisWsId);
|
||||
logout.shutdownAction = shutdownAction;
|
||||
logout.ids = idVector;
|
||||
logout.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
logout.originatorId = m_thisWsId;
|
||||
|
||||
return m_asmFtc->workstationLogoutRequest(logout, this);
|
||||
});
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
#include <QtCore/QObject>
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <OperatorManagement/logger.h>
|
||||
#include <AssetManagement/asm_data_plugin.h>
|
||||
#include <AssetManagement/asm_data_plugin_interface.h>
|
||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
class QTreeView;
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "acl_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_acl_dialog.h"
|
||||
|
||||
|
||||
@@ -13,6 +14,7 @@ AclDialog::AclDialog(QWidget *parent)
|
||||
, m_ui(new Ui::AclDialog)
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
|
||||
+4
-2
@@ -3,6 +3,7 @@
|
||||
|
||||
|
||||
#include "acl_dialog_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
|
||||
@@ -17,6 +18,7 @@ AclDialogModel::AclDialogModel(QObject *parent)
|
||||
parent)
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{}
|
||||
|
||||
AclDialogModel::~AclDialogModel()
|
||||
@@ -44,9 +46,9 @@ QVariant AclDialogModel::data(const QModelIndex &index, int role) const
|
||||
switch (index.column())
|
||||
{
|
||||
case 0:
|
||||
return QString::fromStdString(acl.name());
|
||||
return QString::fromStdString(acl.name);
|
||||
case 1:
|
||||
return QString::fromStdString(acl.description());
|
||||
return QString::fromStdString(acl.description);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
+24
-22
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "group_edit_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_group_edit_dialog.h"
|
||||
|
||||
#include "group_edit_member_of_model.h"
|
||||
@@ -21,6 +22,7 @@ GroupEditDialog::GroupEditDialog(QWidget *parent)
|
||||
, m_ftc(nullptr)
|
||||
, m_model(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
@@ -35,35 +37,35 @@ void GroupEditDialog::init(const Group &group,
|
||||
m_ftc = ftc;
|
||||
m_operatorId = operatorId;
|
||||
|
||||
m_ui->leName->setText(QString::fromStdString(group.name()));
|
||||
m_ui->leDescription->setText(QString::fromStdString(group.description()));
|
||||
m_ui->leName->setText(QString::fromStdString(group.name));
|
||||
m_ui->leDescription->setText(QString::fromStdString(group.description));
|
||||
|
||||
m_ui->cbRoles->addItem(tr("---"), 0);
|
||||
auto cbGroup = [this](const Group &group)
|
||||
{
|
||||
if (group.type() == GroupType::PresetGroup)
|
||||
m_ui->cbRoles->addItem(OperatorManagement::trGroupName(group.name()), group.id());
|
||||
if (group.type == GroupType::PresetGroup)
|
||||
m_ui->cbRoles->addItem(OperatorManagement::trGroupName(group.name), group.id);
|
||||
};
|
||||
dtc->groups(cbGroup);
|
||||
|
||||
User user(m_dtc->user(m_operatorId));
|
||||
int rolePresetId = user.rolePresetId().is_set() ? user.rolePresetId().get() : m_rolePresetId;
|
||||
int rolePresetId = user.rolePresetId.has_value() ? user.rolePresetId.get() : m_rolePresetId;
|
||||
m_ui->cbRoles->setCurrentIndex(m_ui->cbRoles->findData(rolePresetId));
|
||||
|
||||
if (m_group.type() == GroupType::OperatorGroup)
|
||||
if (m_group.type == GroupType::OperatorGroup)
|
||||
{
|
||||
m_ui->leName->setEnabled(false);
|
||||
m_ui->leDescription->setEnabled(false);
|
||||
}
|
||||
|
||||
if (m_group.type() == GroupType::PresetGroup && m_group.id() != 0)
|
||||
if (m_group.type == GroupType::PresetGroup && m_group.id != 0)
|
||||
m_ui->leName->setEnabled(false);
|
||||
|
||||
connect(m_ui->pbLoadPreset, &QPushButton::clicked, this, &GroupEditDialog::onPbPresetClicked);
|
||||
|
||||
|
||||
m_model = new MembershipModel(this, m_dtc);
|
||||
m_model->init(group.isMemberOf());
|
||||
m_model->init(group.isMemberOf);
|
||||
connect(m_model, &MembershipModel::dataChanged, this, &GroupEditDialog::slotChangesMade);
|
||||
m_ui->dvMemberOf->setModel(m_model);
|
||||
|
||||
@@ -73,9 +75,9 @@ void GroupEditDialog::init(const Group &group,
|
||||
connect(m_ui->dvMemberOf, &LtsDataView::LtsDataView::customContextMenuRequested, this, &GroupEditDialog::onContextMenuRequested);
|
||||
#endif
|
||||
|
||||
if (m_group.type() == GroupType::PresetGroup)
|
||||
if (m_group.type == GroupType::PresetGroup)
|
||||
setOnlineHelpFilename(QStringLiteral("Administrator-Presets"));
|
||||
else if (m_group.type() == GroupType::OperatorGroup)
|
||||
else if (m_group.type == GroupType::OperatorGroup)
|
||||
setOnlineHelpFilename(QStringLiteral("Administrator-Operators"));
|
||||
}
|
||||
|
||||
@@ -103,10 +105,10 @@ GroupEditDialog::~GroupEditDialog() { delete m_ui; }
|
||||
|
||||
void GroupEditDialog::retranslate()
|
||||
{
|
||||
if (m_group.type() == GroupType::PresetGroup)
|
||||
translate(m_ui, OperatorManagement::trGroupName(m_group.name()), m_group.id() < 1, tr("Preset"));
|
||||
else if (m_group.type() == GroupType::OperatorGroup)
|
||||
translate(m_ui, OperatorManagement::trGroupName(m_group.name()), m_group.id() < 1, tr("Privileges"));
|
||||
if (m_group.type == GroupType::PresetGroup)
|
||||
translate(m_ui, OperatorManagement::trGroupName(m_group.name), m_group.id < 1, tr("Preset"));
|
||||
else if (m_group.type == GroupType::OperatorGroup)
|
||||
translate(m_ui, OperatorManagement::trGroupName(m_group.name), m_group.id < 1, tr("Privileges"));
|
||||
}
|
||||
|
||||
|
||||
@@ -122,18 +124,18 @@ bool GroupEditDialog::apply()
|
||||
|
||||
std::sort(memberOf.begin(), memberOf.end());
|
||||
|
||||
std::vector<int> oldGroups = m_group.isMemberOf();
|
||||
std::vector<int> oldGroups = m_group.isMemberOf;
|
||||
std::sort(oldGroups.begin(), oldGroups.end());
|
||||
|
||||
const User &user(m_dtc->user(m_operatorId));
|
||||
const int rolePresetId = user.rolePresetId().is_set() ? user.rolePresetId().get() : 0;
|
||||
const int rolePresetId = user.rolePresetId.has_value() ? user.rolePresetId.get() : 0;
|
||||
|
||||
if (oldGroups == memberOf && m_ui->cbRoles->currentData().toInt() == rolePresetId)
|
||||
return true;
|
||||
|
||||
if (m_group.id() == 0)
|
||||
if (m_group.id == 0)
|
||||
{
|
||||
if (m_group.type() == GroupType::OperatorGroup)
|
||||
if (m_group.type == GroupType::OperatorGroup)
|
||||
{
|
||||
emit newGroups(memberOf, m_ui->cbRoles->currentData().toInt());
|
||||
return true;
|
||||
@@ -148,19 +150,19 @@ bool GroupEditDialog::apply()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_group.description() != m_ui->leDescription->text().toStdString())
|
||||
if (m_group.description != m_ui->leDescription->text().toStdString())
|
||||
{
|
||||
m_requestHelper->addRequest(
|
||||
[this]()
|
||||
{
|
||||
const std::string name = m_ui->leName->text().toStdString();
|
||||
const std::string description = m_ui->leDescription->text().toStdString();
|
||||
GroupChangeNameRequest req(m_group.id(), name, description);
|
||||
GroupChangeNameRequest req(m_group.id, name, description);
|
||||
return m_ftc->groupChangeNameRequest(req, this);
|
||||
});
|
||||
}
|
||||
const int rolePresetId = m_operatorId ? m_ui->cbRoles->currentData().toInt() : 0;
|
||||
GroupChangeMembersRequest req(m_group.id(), memberOf, LtsUtils::toOptional(rolePresetId), LtsUtils::toOptional(m_operatorId));
|
||||
GroupChangeMembersRequest req(m_group.id, memberOf, LtsUtils::toOptional(rolePresetId), LtsUtils::toOptional(m_operatorId));
|
||||
|
||||
m_requestHelper->addRequest([this, req]() { return m_ftc->groupChangeMembershipsRequest(req, this); });
|
||||
}
|
||||
@@ -170,7 +172,7 @@ bool GroupEditDialog::apply()
|
||||
void GroupEditDialog::onPbPresetClicked()
|
||||
{
|
||||
int contextGroupId = m_ui->cbRoles->currentData().toInt();
|
||||
m_model->setCheckStateForGroups(m_dtc->group(contextGroupId).isMemberOf());
|
||||
m_model->setCheckStateForGroups(m_dtc->group(contextGroupId).isMemberOf);
|
||||
}
|
||||
|
||||
void GroupEditDialog::onContextMenuRequested(const QPoint &position)
|
||||
|
||||
+31
-31
@@ -14,15 +14,15 @@ namespace OperatorManagement
|
||||
|
||||
QDataStream &operator<<(QDataStream &ds, const Group &gp)
|
||||
{
|
||||
ds << gp.id()
|
||||
<< QString::fromStdString(gp.name())
|
||||
<< QString::fromStdString(gp.description())
|
||||
<< LtsUtils::convert<QVector<int32_t>>(gp.aclAllow())
|
||||
<< LtsUtils::convert<QVector<int32_t>>(gp.aclDeny())
|
||||
<< gp.type().underlying()
|
||||
<< gp.isDeleted()
|
||||
<< gp.isHidden()
|
||||
<< LtsUtils::convert<QVector<int32_t>>(gp.isMemberOf());
|
||||
ds << gp.id
|
||||
<< QString::fromStdString(gp.name)
|
||||
<< QString::fromStdString(gp.description)
|
||||
<< LtsUtils::convert<QVector<int32_t>>(gp.aclAllow)
|
||||
<< LtsUtils::convert<QVector<int32_t>>(gp.aclDeny)
|
||||
<< gp.type
|
||||
<< gp.isDeleted
|
||||
<< gp.isHidden
|
||||
<< LtsUtils::convert<QVector<int32_t>>(gp.isMemberOf);
|
||||
|
||||
return ds;
|
||||
}
|
||||
@@ -45,15 +45,15 @@ QDataStream &operator>>(QDataStream &ds, Group &gp)
|
||||
>> isMemberOf
|
||||
>> isOperatorGroup;
|
||||
|
||||
gp.id(id);
|
||||
gp.name(name.toStdString());
|
||||
gp.description(description.toStdString());
|
||||
LtsUtils::convert(aclAllow, gp.aclAllow());
|
||||
LtsUtils::convert(aclDeny, gp.aclDeny());
|
||||
gp.type(static_cast<GroupType>(type));
|
||||
gp.isDeleted(isDeleted);
|
||||
gp.isHidden(isHidden);
|
||||
LtsUtils::convert(isMemberOf, gp.isMemberOf());
|
||||
gp.id = id;
|
||||
gp.name = name.toStdString();
|
||||
gp.description = description.toStdString();
|
||||
LtsUtils::convert(aclAllow, gp.aclAllow);
|
||||
LtsUtils::convert(aclDeny, gp.aclDeny);
|
||||
gp.type = static_cast<GroupType>(type);
|
||||
gp.isDeleted = isDeleted;
|
||||
gp.isHidden = isHidden;
|
||||
LtsUtils::convert(isMemberOf, gp.isMemberOf);
|
||||
|
||||
return ds;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ MembershipModel::MembershipModel(QObject *parent,
|
||||
, m_dtc(dtc)
|
||||
, m_bRowsAreCheckable(true)
|
||||
{
|
||||
qRegisterMetaTypeStreamOperators<Group>();
|
||||
qRegisterMetaType<Group>();
|
||||
|
||||
QSet<int> disabledFunctionality;
|
||||
LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance();
|
||||
@@ -215,9 +215,9 @@ MembershipModel::MembershipModel(QObject *parent,
|
||||
|
||||
auto cbGroup = [this, disabledFunctionality](const Group &group)
|
||||
{
|
||||
if (group.type() == GroupType::StandardGroup)
|
||||
if (group.type == GroupType::StandardGroup)
|
||||
{
|
||||
if (disabledFunctionality.contains(group.id()) || group.isHidden())
|
||||
if (disabledFunctionality.contains(group.id) || group.isHidden)
|
||||
return;
|
||||
CheckedTreeItem *item = static_cast<CheckedTreeItem *>(createItem(QVariant::fromValue(group), QIcon()));
|
||||
getRootItem()->appendChild(item);
|
||||
@@ -229,10 +229,10 @@ MembershipModel::MembershipModel(QObject *parent,
|
||||
const auto children = getRootItem()->children();
|
||||
for (NGLTreeItem *opGroupItem : children)
|
||||
{
|
||||
const std::vector<int32_t> isMemberOf = opGroupItem->data().value<Group>().isMemberOf();
|
||||
const std::vector<int32_t> isMemberOf = opGroupItem->data().value<Group>().isMemberOf;
|
||||
auto cbGroup2 = [this, &isMemberOf, opGroupItem] (const Group &group)
|
||||
{
|
||||
if (group.type() == GroupType::AclGroup && contains(isMemberOf, group.id()))
|
||||
if (group.type == GroupType::AclGroup && contains(isMemberOf, group.id))
|
||||
opGroupItem->appendChild(createItem(QVariant::fromValue(group), QIcon()));
|
||||
};
|
||||
dtc->groups(cbGroup2);
|
||||
@@ -261,7 +261,7 @@ QVariant MembershipModel::data(const QModelIndex &index, int role) const
|
||||
if (role == Qt::CheckStateRole)
|
||||
{
|
||||
Group group = getGroupData(index);
|
||||
if (!m_bRowsAreCheckable || index.column() != 0 || group.type() != GroupType::StandardGroup)
|
||||
if (!m_bRowsAreCheckable || index.column() != 0 || group.type != GroupType::StandardGroup)
|
||||
return NGLTreeModel::data(index, role);
|
||||
|
||||
return item->bIsChecked ? Qt::Checked : Qt::Unchecked;
|
||||
@@ -273,13 +273,13 @@ QVariant MembershipModel::data(const QModelIndex &index, int role) const
|
||||
switch (index.column())
|
||||
{
|
||||
case ColName:
|
||||
return QCoreApplication::translate("OperatorRights", grp.name().c_str());
|
||||
return QCoreApplication::translate("OperatorRights", grp.name.c_str());
|
||||
case ColDescription:
|
||||
return QCoreApplication::translate("OperatorRights", grp.description().c_str());
|
||||
return QCoreApplication::translate("OperatorRights", grp.description.c_str());
|
||||
case ColIsAclGroup:
|
||||
return grp.type().underlying();
|
||||
return static_cast<int>(grp.type);
|
||||
case ColIsHidden:
|
||||
return grp.isHidden() ? tr("Yes") : tr("No");
|
||||
return grp.isHidden ? tr("Yes") : tr("No");
|
||||
}
|
||||
}
|
||||
return NGLTreeModel::data(index, role);
|
||||
@@ -287,7 +287,7 @@ QVariant MembershipModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
void MembershipModel::init(int groupId)
|
||||
{
|
||||
init(m_dtc->group(groupId).isMemberOf());
|
||||
init(m_dtc->group(groupId).isMemberOf);
|
||||
}
|
||||
|
||||
void MembershipModel::init(const std::vector<int> &groupIds)
|
||||
@@ -314,7 +314,7 @@ Qt::ItemFlags MembershipModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
Group group = getGroupData(index);
|
||||
auto ret = NGLTreeModel::flags(index);
|
||||
if (m_bRowsAreCheckable && index.column() == 0 && group.type() == GroupType::StandardGroup)
|
||||
if (m_bRowsAreCheckable && index.column() == 0 && group.type == GroupType::StandardGroup)
|
||||
ret |= Qt::ItemIsUserCheckable;
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ void MembershipModel::setChecked(CheckedTreeItem *parentItem, const std::vector<
|
||||
|
||||
int MembershipModel::groupIdFromItem(NGLTreeItem *item) const
|
||||
{
|
||||
return item->data().value<Group>().id();
|
||||
return item->data().value<Group>().id;
|
||||
}
|
||||
|
||||
NGLTreeItem *MembershipModel::createItem(const QVariant &data, const QIcon &icon) const
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <OperatorManagement/opm_data_plugin.h>
|
||||
#include <Plugins/OperatorManagement/Data/opm_data_plugin.h>
|
||||
|
||||
#include <nglwidgets/ngltreemodel.h>
|
||||
|
||||
|
||||
+8
-6
@@ -3,6 +3,7 @@
|
||||
|
||||
|
||||
#include "group_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
#include <OperatorManagement/opm_translation.h>
|
||||
@@ -20,6 +21,7 @@ GroupModel::GroupModel(QObject *parent)
|
||||
parent)
|
||||
, m_dtc(nullptr)
|
||||
, m_hideHidden(false)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{}
|
||||
|
||||
GroupModel::~GroupModel()
|
||||
@@ -34,7 +36,7 @@ bool GroupModel::initModel(const std::shared_ptr<Interface::Dtc> &dtc,
|
||||
connect(m_dtc.get(), &OperatorManagement::Interface::Dtc::groupChanged,
|
||||
this, &GroupModel::onDataChanged);
|
||||
m_dtc->groups([this](const OperatorManagement::Group &group) {
|
||||
if (group.type() == GroupType::PresetGroup)
|
||||
if (group.type == GroupType::PresetGroup)
|
||||
insertRow(group);
|
||||
});
|
||||
return true;
|
||||
@@ -53,9 +55,9 @@ QVariant GroupModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
if (role == Qt::DecorationRole && index.column() == 0)
|
||||
{
|
||||
if (group.type() == GroupType::OperatorGroup)
|
||||
if (group.type == GroupType::OperatorGroup)
|
||||
return QIcon(QLatin1String("icon:list-add-user.svg"));
|
||||
if (group.type() == GroupType::AclGroup)
|
||||
if (group.type == GroupType::AclGroup)
|
||||
return QIcon(QLatin1String("icon:define_teams.svg"));
|
||||
return QIcon(QLatin1String("icon:display_oc_evaluations.svg"));
|
||||
}
|
||||
@@ -65,11 +67,11 @@ QVariant GroupModel::data(const QModelIndex &index, int role) const
|
||||
switch (index.column())
|
||||
{
|
||||
case Name:
|
||||
return OperatorManagement::trGroupName(group.name());
|
||||
return OperatorManagement::trGroupName(group.name);
|
||||
case Info:
|
||||
return OperatorManagement::trGroupDescription(group.description());
|
||||
return OperatorManagement::trGroupDescription(group.description);
|
||||
case Id:
|
||||
return group.id();
|
||||
return group.id;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool isFiltered(const Group &data, DataModification modType) const override
|
||||
{
|
||||
if (m_hideHidden && data.isHidden())
|
||||
if (m_hideHidden && data.isHidden)
|
||||
return true;
|
||||
return LtsWidgets::LtsAbstractTableModel<OperatorManagement::Group>::isFiltered(data, modType);
|
||||
}
|
||||
|
||||
+8
-6
@@ -3,6 +3,7 @@
|
||||
|
||||
|
||||
#include "operator_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_operator_dialog.h"
|
||||
|
||||
#include "operator_edit_dialog.h"
|
||||
@@ -23,6 +24,7 @@ OperatorDialog::OperatorDialog(const QString &menuGroup, QWidget *parent)
|
||||
, m_ui(new Ui::OperatorDialog)
|
||||
, m_ftc(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -99,7 +101,7 @@ void OperatorDialog::enaDisa()
|
||||
void OperatorDialog::onRemoveOperator()
|
||||
{
|
||||
QModelIndex idx = m_ui->widget->currentIndex();
|
||||
Core::RemoveElementRequest req(m_model->getRowData(idx.row()).id());
|
||||
Core::RemoveElementRequest req(m_model->getRowData(idx.row()).id);
|
||||
m_requestHelper->startSingleRequest([req, this]()
|
||||
{
|
||||
return m_ftc->operatorRemoveRequest(req, this);
|
||||
@@ -118,12 +120,12 @@ void OperatorDialog::onEditOperator()
|
||||
const QModelIndex idx = m_ui->widget->currentIndex();
|
||||
const OperatorManagement::User op = m_model->getRowData(idx.row());
|
||||
|
||||
if (op.id() <= 0)
|
||||
if (op.id <= 0)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << "current Operator Id: " << op.id();
|
||||
DEBUG_LOG(m_logger) << "current Operator Id: " << op.id;
|
||||
|
||||
OperatorEditDialog *dialog = new OperatorEditDialog(op.id(), m_session, m_menuGroup, this);
|
||||
const QString identifier = QLatin1String("EditOperator") + QString::number(op.id());
|
||||
OperatorEditDialog *dialog = new OperatorEditDialog(op.id, m_session, m_menuGroup, this);
|
||||
const QString identifier = QLatin1String("EditOperator") + QString::number(op.id);
|
||||
|
||||
addDialog(dialog, m_menuGroup, identifier, LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
@@ -139,7 +141,7 @@ void OperatorDialog::onTvItemClicked(const QModelIndex &idx)
|
||||
return;
|
||||
|
||||
auto user = m_model->getRowData(idx.row());
|
||||
if (user.id() == 99)
|
||||
if (user.id == 99)
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Remove)->setEnabled(false);
|
||||
else
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Remove)->setEnabled(true);
|
||||
|
||||
+54
-52
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "operator_edit_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_operator_edit_dialog.h"
|
||||
|
||||
#include <OperatorManagement/Gui/Common/operator_change_password.h>
|
||||
@@ -9,12 +10,12 @@
|
||||
|
||||
#include <LtsWidgets/lts_frameless_dialog.h>
|
||||
#include <LtsWidgets/lts_message_dialog.h>
|
||||
#include <LtsUtils/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtilsCore/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
|
||||
#include <ParticipantManagement/Data/ppm_data_plugin.h>
|
||||
#include <ExerciseManagement/exm_data_plugin.h>
|
||||
#include <Plugins/ExerciseManagement/Data/exm_data_plugin.h>
|
||||
|
||||
#include <QtWidgets/QListWidget>
|
||||
#include <QtGui/QImage>
|
||||
@@ -45,6 +46,7 @@ OperatorEditDialog::OperatorEditDialog(const int operatorId,
|
||||
, m_ftc(nullptr)
|
||||
, m_ui(new Ui::OperatorEditDialog)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_effectiveACls.clear();
|
||||
@@ -57,7 +59,7 @@ OperatorEditDialog::OperatorEditDialog(const int operatorId,
|
||||
|
||||
OperatorManagement::User op = m_dtc->user(m_operatorId);
|
||||
|
||||
m_effectiveACls = op.effectiveAcls();
|
||||
m_effectiveACls = op.effectiveAcls;
|
||||
|
||||
if (m_operatorId < 1)
|
||||
{
|
||||
@@ -73,8 +75,8 @@ OperatorEditDialog::OperatorEditDialog(const int operatorId,
|
||||
m_ui->pbDisplay->setVisible(false);
|
||||
}
|
||||
|
||||
m_ui->leOperator->setText(QString::fromStdString(op.name()));
|
||||
m_ui->leInfo->setText(QString::fromStdString(op.description()));
|
||||
m_ui->leOperator->setText(QString::fromStdString(op.name));
|
||||
m_ui->leInfo->setText(QString::fromStdString(op.description));
|
||||
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> ppmDtc;
|
||||
if (m_session->getDtc<ParticipantManagement::DataInterface>(ppmDtc))
|
||||
@@ -143,8 +145,8 @@ OperatorEditDialog::OperatorEditDialog(const int operatorId,
|
||||
m_ui->cbProjectionPriority->addItems(priorities.split(QLatin1Char(',')));
|
||||
m_ui->cbAudioChannelPriority->addItems(priorities.split(QLatin1Char(',')));
|
||||
|
||||
m_ui->cbProjectionPriority->setCurrentIndex(clamp(op.projectionPriority() - 1, 0, 4));
|
||||
m_ui->cbAudioChannelPriority->setCurrentIndex(clamp(op.audioChannelPriority() - 1, 0, 4));
|
||||
m_ui->cbProjectionPriority->setCurrentIndex(clamp(op.projectionPriority - 1, 0, 4));
|
||||
m_ui->cbAudioChannelPriority->setCurrentIndex(clamp(op.audioChannelPriority - 1, 0, 4));
|
||||
|
||||
connect<void(QComboBox::*)(int)>(m_ui->cbProjectionPriority, &QComboBox::currentIndexChanged,
|
||||
this, [this] () { m_projectionPriorityChanged = true; });
|
||||
@@ -164,13 +166,13 @@ bool OperatorEditDialog::operatorCreateModify(const OperatorCreateModifyRequest
|
||||
|
||||
|
||||
|
||||
if (req.operatorRights().is_set() && req.operatorRights().get().size() == 0)
|
||||
if (req.operatorRights.has_value() && req.operatorRights.get().size() == 0)
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("An operator must have at least one right"));
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "req.name: " << req.name();
|
||||
DEBUG_LOG(m_logger) << "req.name: " << req.name;
|
||||
return m_requestHelper->startSingleRequest([this, req]()
|
||||
{
|
||||
return m_ftc->operatorCreateModifyRequest(req, this);
|
||||
@@ -193,7 +195,7 @@ void OperatorEditDialog::onNewGroups(const std::vector<int> &groupIds, const int
|
||||
void OperatorEditDialog::getProfilePicture()
|
||||
{
|
||||
OperatorManagement::User op = m_dtc->user(m_operatorId);
|
||||
m_ui->profileButton->setPixmap(LtsUtils::getPixmap(op.image()));
|
||||
m_ui->profileButton->setPixmap(LtsUtils::getPixmap(op.image));
|
||||
}
|
||||
|
||||
void OperatorEditDialog::slotProfileButtonClicked()
|
||||
@@ -260,18 +262,18 @@ void OperatorEditDialog::showACLs()
|
||||
if (m_operatorId < 1)
|
||||
{
|
||||
Group grp;
|
||||
grp.id(0);
|
||||
grp.name(m_ui->leOperator->text().toStdString());
|
||||
grp.description(m_ui->leInfo->text().toStdString());
|
||||
grp.type(GroupType::OperatorGroup);
|
||||
grp.isMemberOf(m_groups);
|
||||
grp.id = 0;
|
||||
grp.name = m_ui->leOperator->text().toStdString();
|
||||
grp.description = m_ui->leInfo->text().toStdString();
|
||||
grp.type = GroupType::OperatorGroup;
|
||||
grp.isMemberOf = m_groups;
|
||||
connect(dlg, &GroupEditDialog::newGroups, this, &OperatorEditDialog::onNewGroups);
|
||||
dlg->init(grp, m_dtc, m_ftc);
|
||||
dlg->setRolePresetId(m_presetGroupId);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto grpInit = m_dtc->group(m_dtc->user(m_operatorId).primaryGroupId());
|
||||
auto grpInit = m_dtc->group(m_dtc->user(m_operatorId).primaryGroupId);
|
||||
dlg->init(grpInit, m_dtc, m_ftc, m_operatorId);
|
||||
}
|
||||
|
||||
@@ -289,7 +291,7 @@ void OperatorEditDialog::showExercises()
|
||||
|
||||
QLabel *lblTitle = new QLabel(tr("Exercises"),exercisesPopup);
|
||||
|
||||
std::vector<int> exercises = m_dtc->user(m_operatorId).exerciseIds();
|
||||
std::vector<int> exercises = m_dtc->user(m_operatorId).exerciseIds;
|
||||
|
||||
std::shared_ptr<ExerciseManagement::Interface::Dtc> exmDtc;
|
||||
m_session->getDtc<ExerciseManagement::DataInterface>(exmDtc);
|
||||
@@ -297,7 +299,7 @@ void OperatorEditDialog::showExercises()
|
||||
for (int exercise : exercises)
|
||||
{
|
||||
QListWidgetItem *item = new QListWidgetItem(wid);
|
||||
item->setData(Qt::DisplayRole, exmDtc ? QString::fromStdString(exmDtc->exercise(exercise).name()) : tr("Exercise Id: <%1> (name unknown)").arg(exercise));
|
||||
item->setData(Qt::DisplayRole, exmDtc ? QString::fromStdString(exmDtc->exercise(exercise).name) : tr("Exercise Id: <%1> (name unknown)").arg(exercise));
|
||||
item->setData(Qt::UserRole, exercise);
|
||||
wid->addItem(item);
|
||||
}
|
||||
@@ -339,24 +341,24 @@ bool OperatorEditDialog::apply()
|
||||
|
||||
bool bNeedUpdate = false;
|
||||
OperatorCreateModifyRequest req;
|
||||
req.id(m_operatorId);
|
||||
req.id = m_operatorId;
|
||||
|
||||
if (m_pictureChanged)
|
||||
{
|
||||
bNeedUpdate = true;
|
||||
req.image(LtsUtils::fromPixmap(m_ui->profileButton->pixmap()));
|
||||
req.image = LtsUtils::fromPixmap(m_ui->profileButton->pixmap());
|
||||
}
|
||||
|
||||
if (name != op.name())
|
||||
if (name != op.name)
|
||||
{
|
||||
bNeedUpdate = true;
|
||||
req.name(name);
|
||||
req.name = name;
|
||||
}
|
||||
|
||||
if (description != op.description())
|
||||
if (description != op.description)
|
||||
{
|
||||
bNeedUpdate = true;
|
||||
req.description(description);
|
||||
req.description = description;
|
||||
}
|
||||
|
||||
if (m_visiblePartiesChanged)
|
||||
@@ -366,23 +368,23 @@ bool OperatorEditDialog::apply()
|
||||
std::vector<OperatorManagement::PartiesByExercise> vpbe;
|
||||
PartiesByExercise pbe;
|
||||
DEBUG_LOG(m_logger) << "----------------- m_session.exerciseId:" << m_session->exerciseId();
|
||||
pbe.exerciseId(0);
|
||||
pbe.visibleParties().set({});
|
||||
std::copy(visiblePartyIds.begin(), visiblePartyIds.end(), std::back_inserter(pbe.visibleParties().get()));
|
||||
pbe.exerciseId = 0;
|
||||
pbe.visibleParties.set({});
|
||||
std::copy(visiblePartyIds.begin(), visiblePartyIds.end(), std::back_inserter(pbe.visibleParties.get()));
|
||||
vpbe.push_back(pbe);
|
||||
req.visiblePartiesByExercise() = vpbe;
|
||||
req.visiblePartiesByExercise = vpbe;
|
||||
}
|
||||
|
||||
if (m_projectionPriorityChanged)
|
||||
{
|
||||
bNeedUpdate = true;
|
||||
req.projectionPriority(m_ui->cbProjectionPriority->currentIndex() + 1);
|
||||
req.projectionPriority = m_ui->cbProjectionPriority->currentIndex() + 1;
|
||||
}
|
||||
|
||||
if (m_audioChannelPriorityChanged)
|
||||
{
|
||||
bNeedUpdate = true;
|
||||
req.audioChannelPriority(m_ui->cbAudioChannelPriority->currentIndex() + 1);
|
||||
req.audioChannelPriority = m_ui->cbAudioChannelPriority->currentIndex() + 1;
|
||||
}
|
||||
|
||||
return bNeedUpdate && operatorCreateModify(req);
|
||||
@@ -390,27 +392,27 @@ bool OperatorEditDialog::apply()
|
||||
else
|
||||
{
|
||||
OperatorCreateModifyRequest req;
|
||||
req.name(name);
|
||||
req.description(description);
|
||||
req.password(password);
|
||||
req.projectionPriority(dds::core::optional<int16_t>(m_ui->cbProjectionPriority->currentIndex() + 1));
|
||||
req.audioChannelPriority(m_ui->cbAudioChannelPriority->currentIndex() + 1);
|
||||
req.name = name;
|
||||
req.description = description;
|
||||
req.password = password;
|
||||
req.projectionPriority = dds::core::optional<int16_t>(m_ui->cbProjectionPriority->currentIndex() + 1);
|
||||
req.audioChannelPriority = m_ui->cbAudioChannelPriority->currentIndex() + 1;
|
||||
if (m_pictureChanged)
|
||||
req.image(LtsUtils::fromPixmap(m_ui->profileButton->pixmap()));
|
||||
req.image = LtsUtils::fromPixmap(m_ui->profileButton->pixmap());
|
||||
if (m_visiblePartiesChanged)
|
||||
{
|
||||
const QVector<int> visiblePartyIds = m_visiblePartiesModel->getCheckedIds();
|
||||
std::vector<OperatorManagement::PartiesByExercise> vpbe;
|
||||
PartiesByExercise pbe;
|
||||
DEBUG_LOG(m_logger) << "----------------- m_session.exerciseId:" << m_session->exerciseId();
|
||||
pbe.exerciseId(0);
|
||||
pbe.visibleParties().set({});
|
||||
std::copy(visiblePartyIds.begin(), visiblePartyIds.end(), std::back_inserter(pbe.visibleParties().get()));
|
||||
pbe.exerciseId = 0;
|
||||
pbe.visibleParties.set({});
|
||||
std::copy(visiblePartyIds.begin(), visiblePartyIds.end(), std::back_inserter(pbe.visibleParties.get()));
|
||||
vpbe.push_back(pbe);
|
||||
req.visiblePartiesByExercise() = vpbe;
|
||||
req.visiblePartiesByExercise = vpbe;
|
||||
}
|
||||
req.operatorRights(m_groups);
|
||||
req.rolePresetId(m_presetGroupId);
|
||||
req.operatorRights = m_groups;
|
||||
req.rolePresetId = m_presetGroupId;
|
||||
|
||||
return operatorCreateModify(req);
|
||||
}
|
||||
@@ -440,8 +442,8 @@ void OperatorEditDialog::createFolders()
|
||||
{
|
||||
|
||||
OperatorManagement::User op = m_dtc->user(m_operatorId);
|
||||
QString folderName = QString::fromStdString(op.name());
|
||||
int userId = op.id();
|
||||
QString folderName = QString::fromStdString(op.name);
|
||||
int userId = op.id;
|
||||
|
||||
|
||||
int folderId = m_flmDtc->findFolder(0,folderName);
|
||||
@@ -452,7 +454,7 @@ void OperatorEditDialog::createFolders()
|
||||
}
|
||||
|
||||
|
||||
folderId = createFolder(FileManagement::MainFolder::UserDocuments, folderName, userId);
|
||||
folderId = createFolder(static_cast<int>(FileManagement::MainFolder::UserDocuments), folderName, userId);
|
||||
|
||||
if (folderId <= 0)
|
||||
{
|
||||
@@ -484,15 +486,15 @@ void OperatorEditDialog::createFolders()
|
||||
int OperatorEditDialog::createFolder(int parentFolderId, const QString &folderName, int userId, bool isHidden)
|
||||
{
|
||||
FileManagement::Folder parentFolder = m_flmDtc->folder(parentFolderId);
|
||||
const std::vector<int32_t> &parentPath = parentFolder.path();
|
||||
const std::vector<int32_t> &parentPath = parentFolder.path;
|
||||
|
||||
FileManagement::FolderModifyRequest req;
|
||||
req.name(folderName.toStdString());
|
||||
req.path(parentPath);
|
||||
req.isEditable(true);
|
||||
req.isHidden(isHidden);
|
||||
req.parentId(parentFolderId);
|
||||
req.operatorId(userId);
|
||||
req.name = folderName.toStdString();
|
||||
req.path = parentPath;
|
||||
req.isEditable = true;
|
||||
req.isHidden = isHidden;
|
||||
req.parentId = parentFolderId;
|
||||
req.operatorId = userId;
|
||||
|
||||
m_requestHelper->startSingleRequest([this, req]()
|
||||
{
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
#include <OperatorManagement/opm_dtc.h>
|
||||
#include <OperatorManagement/logger.h>
|
||||
|
||||
#include <flm_data_plugin_interface.h>
|
||||
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
|
||||
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
||||
#include <FileManagement/flm_translation.h>
|
||||
|
||||
|
||||
+9
-9
@@ -42,9 +42,9 @@ QVariant OperatorEditVisiblePartiesModel::data(const QModelIndex &index, int rol
|
||||
switch (index.column())
|
||||
{
|
||||
case ColId:
|
||||
return party.id();
|
||||
return party.id;
|
||||
case ColName:
|
||||
return ParticipantManagement::trPartyName(party.name());
|
||||
return ParticipantManagement::trPartyName(party.name);
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
@@ -62,7 +62,7 @@ void OperatorEditVisiblePartiesModel::onPartiesChanged(const ParticipantManageme
|
||||
{
|
||||
for (int i = 0; i < m_vecData.size(); ++i)
|
||||
{
|
||||
if (m_vecData.at(i).second.id() == data.id())
|
||||
if (m_vecData.at(i).second.id == data.id)
|
||||
{
|
||||
removeRow(i);
|
||||
break;
|
||||
@@ -74,7 +74,7 @@ void OperatorEditVisiblePartiesModel::onPartiesChanged(const ParticipantManageme
|
||||
{
|
||||
for (int i = 0; i < m_vecData.size(); ++i)
|
||||
{
|
||||
if (m_vecData.at(i).second.id() == data.id())
|
||||
if (m_vecData.at(i).second.id == data.id)
|
||||
{
|
||||
m_vecData[i].second = data;
|
||||
const QModelIndex idx(index(i, ColName, QModelIndex()));
|
||||
@@ -89,17 +89,17 @@ void OperatorEditVisiblePartiesModel::onPartiesChanged(const ParticipantManageme
|
||||
|
||||
bool OperatorEditVisiblePartiesModel::hasParty(const ParticipantManagement::Party &party) const
|
||||
{
|
||||
const auto visiblePartiesByExercise = m_dtc->user(m_operatorId).visiblePartiesByExercise();
|
||||
const auto visiblePartiesByExercise = m_dtc->user(m_operatorId).visiblePartiesByExercise;
|
||||
|
||||
for (const auto &exerciseParties : visiblePartiesByExercise)
|
||||
{
|
||||
if (exerciseParties.exerciseId() != 0)
|
||||
if (exerciseParties.exerciseId != 0)
|
||||
continue;
|
||||
|
||||
if (!exerciseParties.visibleParties().is_set())
|
||||
if (!exerciseParties.visibleParties.has_value())
|
||||
return false;
|
||||
for (const auto &partyId : exerciseParties.visibleParties().get())
|
||||
if (partyId == party.id())
|
||||
for (const auto &partyId : exerciseParties.visibleParties.get())
|
||||
if (partyId == party.id)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <OperatorManagement/opm_data_plugin.h>
|
||||
#include <Plugins/OperatorManagement/Data/opm_data_plugin.h>
|
||||
#include <ParticipantManagement/Data/ppm_data_plugin.h>
|
||||
|
||||
#include <LtsWidgets/lts_checkable_table_model.h>
|
||||
|
||||
+7
-5
@@ -3,6 +3,7 @@
|
||||
|
||||
|
||||
#include "preset_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_preset_dialog.h"
|
||||
|
||||
#include "group_edit_dialog.h"
|
||||
@@ -18,6 +19,7 @@ PresetDialog::PresetDialog(const QString &menuGroup, QWidget *parent)
|
||||
, m_dtc(nullptr)
|
||||
, m_ftc(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -76,7 +78,7 @@ void PresetDialog::enaDisa()
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, cntSelectedRows == 1 );
|
||||
|
||||
bool deletable = cntSelectedRows > 0 &&
|
||||
(m_model->getRowData(selectedRows.at(0).row()).type() == GroupType::PresetGroup);
|
||||
(m_model->getRowData(selectedRows.at(0).row()).type == GroupType::PresetGroup);
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, deletable );
|
||||
}
|
||||
@@ -84,7 +86,7 @@ void PresetDialog::enaDisa()
|
||||
void PresetDialog::onRemoveGroup()
|
||||
{
|
||||
QModelIndex idx = m_ui->widget->currentIndex();
|
||||
Core::RemoveElementRequest req(m_model->getRowData(idx.row()).id());
|
||||
Core::RemoveElementRequest req(m_model->getRowData(idx.row()).id);
|
||||
m_requestHelper->startSingleRequest([req, this]()
|
||||
{
|
||||
return m_ftc->groupRemoveRequest(req, this);
|
||||
@@ -95,7 +97,7 @@ void PresetDialog::onAddGroup()
|
||||
{
|
||||
GroupEditDialog *dialog = new GroupEditDialog(this);
|
||||
Group grp;
|
||||
grp.type(GroupType::PresetGroup);
|
||||
grp.type = GroupType::PresetGroup;
|
||||
dialog->init(grp, m_dtc, m_ftc);
|
||||
|
||||
addDialog(dialog, m_menuGroup, QLatin1String("NewPreset"), LtsWidgets::LayoutArea::eDialogTab);
|
||||
@@ -106,12 +108,12 @@ void PresetDialog::onEditGroup()
|
||||
const QModelIndex idx = m_ui->widget->currentIndex();
|
||||
const OperatorManagement::Group group = m_model->getRowData(idx.row());
|
||||
|
||||
if (group.id() <= 0)
|
||||
if (group.id <= 0)
|
||||
return;
|
||||
|
||||
GroupEditDialog *dialog = new GroupEditDialog(this);
|
||||
dialog->init(group, m_dtc, m_ftc);
|
||||
const QString identifier = QLatin1String("editPreset") + QString::number(group.id());
|
||||
const QString identifier = QLatin1String("editPreset") + QString::number(group.id);
|
||||
|
||||
addDialog(dialog, m_menuGroup, identifier, LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
|
||||
+2
@@ -3,6 +3,7 @@
|
||||
|
||||
|
||||
#include "operator_overview_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_operator_overview_dialog.h"
|
||||
|
||||
#include "operator_overview_dialog.h"
|
||||
@@ -22,6 +23,7 @@ OperatorOverviewDialog::OperatorOverviewDialog(const QString &windowTitle, QWidg
|
||||
, m_ui(new Ui::OperatorOverviewDialog)
|
||||
, m_ftc(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_buttonBox->connectButton(LtsWidgets::DialogButton::Print, this, &OperatorOverviewDialog::onPrint);
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "opm_settings_group.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QJsonParseError>
|
||||
@@ -16,6 +17,7 @@ SettingsGroup::SettingsGroup(const QString &group, const QString &id, SubSetHand
|
||||
, m_id(id)
|
||||
, m_subSetHandler(handler)
|
||||
, m_opSettings(opSettings)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_logger.setNoSpace(false);
|
||||
}
|
||||
|
||||
+10
-7
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "operator_settings_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_operator_settings_dialog.h"
|
||||
|
||||
#include "operator_settings_create_new_dialog.h"
|
||||
@@ -9,7 +10,7 @@
|
||||
#include <OperatorManagement/Gui/Common/operator_change_password.h>
|
||||
|
||||
#include <LtsWidgets/lts_message_dialog.h>
|
||||
#include <LtsUtils/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtilsCore/dds_vector_to_pixmap.h>
|
||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
#include <LtsWidgets/lts_base_layout_widget.h>
|
||||
@@ -27,6 +28,7 @@
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPen>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QRandomGenerator>
|
||||
#include <QtCore/QUuid>
|
||||
|
||||
|
||||
@@ -125,7 +127,7 @@ OperatorSettingsDialog::OperatorSettingsDialog(LtsSession::LtsSession *session,
|
||||
m_ui->cbTimeZone->addItem(QString(QChar(tz)), tz);
|
||||
|
||||
const QChar tz = m_opSettings->value(groupTimeSettings, QStringLiteral("TimeZone"), QChar()).toChar();
|
||||
idx = m_ui->cbTimeZone->findData(tz.isNull() ? 0 : tz);
|
||||
idx = m_ui->cbTimeZone->findData(tz.isNull() ? 0 : tz.unicode());
|
||||
if (idx >= 0)
|
||||
m_ui->cbTimeZone->setCurrentIndex(idx);
|
||||
else
|
||||
@@ -190,7 +192,7 @@ bool OperatorSettingsDialog::init(const QMap<QString, SettingsGroup *> *workspac
|
||||
return false;
|
||||
|
||||
OperatorManagement::User op = m_dtc->user(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
m_ui->ltsProfileButton->setPixmap(LtsUtils::getPixmap(op.image()));
|
||||
m_ui->ltsProfileButton->setPixmap(LtsUtils::getPixmap(op.image));
|
||||
|
||||
this->enaDisaOpsettings(enaDisaOpsettings);
|
||||
this->enaDisaFilterPresets(enaDisaFilterPresets);
|
||||
@@ -221,7 +223,7 @@ void OperatorSettingsDialog::keyPressEvent(QKeyEvent *event)
|
||||
if (event->key() == '#')
|
||||
m_keyCache.clear();
|
||||
else
|
||||
m_keyCache += event->key();
|
||||
m_keyCache += QChar(event->key());
|
||||
|
||||
QDateTime dt(QDateTime::currentDateTime());
|
||||
QDate d = dt.date();
|
||||
@@ -602,8 +604,8 @@ void OperatorSettingsDialog::onChangeProfilePicture()
|
||||
m_operatorPixmap = pixmap;
|
||||
|
||||
OperatorCreateModifyRequest req;
|
||||
req.id(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
req.image(LtsUtils::fromPixmap(m_operatorPixmap));
|
||||
req.id = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
req.image = LtsUtils::fromPixmap(m_operatorPixmap);
|
||||
|
||||
m_requestHelper->addRequest([this, req]()
|
||||
{
|
||||
@@ -649,6 +651,7 @@ void OperatorSettingsDialog::onMineAreaInputModeChanged()
|
||||
|
||||
TetraBoard::TetraBoard(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
@@ -989,7 +992,7 @@ void TetraBoard::drawSquare(QPainter &painter, int x, int y, TetraShape shape)
|
||||
|
||||
void TetraPiece::setRandomShape()
|
||||
{
|
||||
setShape(TetraShape(qrand() % 7 + 1));
|
||||
setShape(TetraShape(QRandomGenerator::global()->bounded(7) + 1));
|
||||
}
|
||||
|
||||
void TetraPiece::setShape(TetraShape shape)
|
||||
|
||||
+3
-3
@@ -884,7 +884,7 @@ bool InterfaceImpl::saveSubSet(SubSet &subset)
|
||||
= m_fltParticipantIfc->symbolAppearanceForOperator(LtsSessionData::LtsSessionData::getInstance()->getOperatorId(), m_session->workspaceId());
|
||||
FilterManagement::SymbolAppearance appearance = appearanceSettings->settingsToData();
|
||||
|
||||
subset.data = QString::fromStdString(appearance.content());
|
||||
subset.data = QString::fromStdString(appearance.content);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -895,7 +895,7 @@ bool InterfaceImpl::saveSubSet(SubSet &subset)
|
||||
= m_fltAesIfc->aesFilterForOperator(LtsSessionData::LtsSessionData::getInstance()->getOperatorId(), m_session->workspaceId());
|
||||
FilterManagement::AesFilter aesFilter = displayFilter->filterToData();
|
||||
|
||||
subset.data = QJsonValue(QString::fromStdString(aesFilter.content()));
|
||||
subset.data = QJsonValue(QString::fromStdString(aesFilter.content));
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -906,7 +906,7 @@ bool InterfaceImpl::saveSubSet(SubSet &subset)
|
||||
= m_fltBuildingComponentIfc->buildingComponentSettingsForOperator(LtsSessionData::LtsSessionData::getInstance()->getOperatorId(), m_session->workspaceId());
|
||||
FilterManagement::BuildingComponentFilter filter = settings->bldCmpSettingsToData();
|
||||
|
||||
subset.data = QJsonValue(QString::fromStdString(filter.content()));
|
||||
subset.data = QJsonValue(QString::fromStdString(filter.content));
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
+15
-15
@@ -43,9 +43,9 @@ bool InterfaceImpl::fillOperatorComboBox(LtsWidgets::LtsComboBox *cbx, CbxOperat
|
||||
{
|
||||
auto cbUser = [cbx](const User &user)
|
||||
{
|
||||
if (user.isDeleted() || user.id() <= 0)
|
||||
if (user.isDeleted || user.id <= 0)
|
||||
return;
|
||||
cbx->addItem(QString::fromStdString(user.name()), user.id());
|
||||
cbx->addItem(QString::fromStdString(user.name), user.id);
|
||||
};
|
||||
m_dtc->users(cbUser);
|
||||
}
|
||||
@@ -54,15 +54,15 @@ bool InterfaceImpl::fillOperatorComboBox(LtsWidgets::LtsComboBox *cbx, CbxOperat
|
||||
{
|
||||
auto cbPlayer = [this, cbx] (const ParticipantManagement::Participant &oc)
|
||||
{
|
||||
if (oc.isDeleted() || !oc.equipmentNumber().is_set())
|
||||
if (oc.isDeleted || !oc.equipmentNumber.has_value())
|
||||
return;
|
||||
ParticipantManagement::TypeClass typeClass = m_ppmDtc->type(oc.typeId()).typeClass();
|
||||
ParticipantManagement::TypeClass typeClass = m_ppmDtc->type(oc.typeId).typeClass;
|
||||
if ((typeClass != ParticipantManagement::TypeClass::SupportEntity) ||
|
||||
(oc.id() <= 0))
|
||||
(oc.id <= 0))
|
||||
return;
|
||||
int participantId = oc.id();
|
||||
int participantId = oc.id;
|
||||
QString hierarchy = m_ppmDtc->hierarchyFromParticipant(participantId);
|
||||
cbx->addItem(hierarchy + QStringLiteral(" - ") + QString::fromStdString(oc.tacticalIdentifier()) + QStringLiteral(" - ")+ QString::number(oc.equipmentNumber().get()), 0 - oc.id());
|
||||
cbx->addItem(hierarchy + QStringLiteral(" - ") + QString::fromStdString(oc.tacticalIdentifier) + QStringLiteral(" - ")+ QString::number(oc.equipmentNumber.value()), 0 - oc.id);
|
||||
};
|
||||
m_ppmDtc->participants(cbPlayer);
|
||||
}
|
||||
@@ -79,12 +79,12 @@ bool InterfaceImpl::fillActiveAppOperatorComboBox(LtsWidgets::LtsComboBox *cbx,
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "activeApp = " << activeApp
|
||||
<< ", appId = " << appId;
|
||||
if ((activeApp.operatorId() <= 0) ||
|
||||
if ((activeApp.operatorId <= 0) ||
|
||||
|
||||
|
||||
(activeApp.exerciseId() != exerciseId))
|
||||
(activeApp.exerciseId != exerciseId))
|
||||
return;
|
||||
operatorIds += activeApp.operatorId();
|
||||
operatorIds += activeApp.operatorId;
|
||||
};
|
||||
m_dtc->activeApps(cbActiveApp);
|
||||
|
||||
@@ -92,7 +92,7 @@ bool InterfaceImpl::fillActiveAppOperatorComboBox(LtsWidgets::LtsComboBox *cbx,
|
||||
{
|
||||
const User &user = m_dtc->user(opId);
|
||||
DEBUG_LOG(m_logger) << "activeApp = addItem: " << user;
|
||||
cbx->addItem(QString::fromStdString(user.name()), user.id());
|
||||
cbx->addItem(QString::fromStdString(user.name), user.id);
|
||||
}
|
||||
|
||||
cbx->model()->sort(0);
|
||||
@@ -114,12 +114,12 @@ bool InterfaceImpl::fillActiveAppScreenComboBox(LtsWidgets::LtsComboBox *cbx, in
|
||||
auto cbActiveApp = [this, cbx, appId, operatorId, exerciseId](const ActiveApp &activeApp)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " activeApp = " << activeApp;
|
||||
if ((activeApp.operatorId() == operatorId) &&
|
||||
if ((activeApp.operatorId == operatorId) &&
|
||||
|
||||
(activeApp.exerciseId() == exerciseId))
|
||||
(activeApp.exerciseId == exerciseId))
|
||||
{
|
||||
const int screenId = activeApp.screenId();
|
||||
const QString &activeAppAsString = LtsSession::LtsSession::appToString(static_cast<LtsAppDescriptor::App>(activeApp.appId()));
|
||||
const int screenId = activeApp.screenId;
|
||||
const QString &activeAppAsString = LtsSession::LtsSession::appToString(static_cast<LtsAppDescriptor::App>(activeApp.appId));
|
||||
cbx->addItem(tr("Screen '%1' ('%2')").arg(screenId).arg(activeAppAsString),
|
||||
screenId);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user