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
+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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user