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:
1718 files changed
+126739
-18495
No files matched your search
+33
-31
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "operator_party_assignment.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_operator_party_assignment.h"
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
#include <OperatorManagement/opm_data_plugin_interface.h>
|
||||
@@ -24,6 +25,7 @@ OperatorPartyAssignment::OperatorPartyAssignment(const QString &menuGroup, QWidg
|
||||
, m_operatorId(-1)
|
||||
, m_model(nullptr)
|
||||
, m_ui(new Ui::OperatorPartyAssignment)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -103,15 +105,15 @@ QMap<int, bool> OperatorPartyAssignment::getPartyStatesForOpertator() const
|
||||
QMap<int,bool> mapPartyCheckStates;
|
||||
for (auto p : partys)
|
||||
{
|
||||
const QString partyId = QString::number(p.id());
|
||||
QJsonObject mainObj = QJsonDocument::fromJson(QByteArray::fromStdString(p.properties())).object();
|
||||
const QString partyId = QString::number(p.id);
|
||||
QJsonObject mainObj = QJsonDocument::fromJson(QByteArray::fromStdString(p.properties)).object();
|
||||
QJsonObject subObj = mainObj.value(s_partyOpAssignStr).toObject();
|
||||
QJsonArray opIdJsArry = subObj.value(QString::number(p.id())).toArray();
|
||||
QJsonArray opIdJsArry = subObj.value(QString::number(p.id)).toArray();
|
||||
|
||||
if (opIdJsArry.contains(QJsonValue::fromVariant(m_operatorId)))
|
||||
mapPartyCheckStates.insert(p.id(), true);
|
||||
mapPartyCheckStates.insert(p.id, true);
|
||||
else
|
||||
mapPartyCheckStates.insert(p.id(), false);
|
||||
mapPartyCheckStates.insert(p.id, false);
|
||||
|
||||
}
|
||||
|
||||
@@ -124,35 +126,35 @@ void OperatorPartyAssignment::onOperatorChanged(const OperatorManagement::User &
|
||||
{
|
||||
case DataModification::eRemoved:
|
||||
{
|
||||
Q_ASSERT(m_operatorMap.contains(data.id()));
|
||||
Q_ASSERT(m_operatorMap.contains(data.id));
|
||||
|
||||
|
||||
if (m_ui->operatorComboBox->currentData().toInt() == data.id())
|
||||
if (m_ui->operatorComboBox->currentData().toInt() == data.id)
|
||||
{
|
||||
__unchange__();
|
||||
}
|
||||
|
||||
m_operatorMap.remove(data.id());
|
||||
m_ui->operatorComboBox->removeItem(m_ui->operatorComboBox->findData(data.id()));
|
||||
m_operatorMap.remove(data.id);
|
||||
m_ui->operatorComboBox->removeItem(m_ui->operatorComboBox->findData(data.id));
|
||||
break;
|
||||
}
|
||||
|
||||
case DataModification::eAdded:
|
||||
{
|
||||
Q_ASSERT(!m_operatorMap.contains(data.id()));
|
||||
const QString operatorName = QString::fromStdString(data.name());
|
||||
m_operatorMap.insert(data.id(), operatorName);
|
||||
m_ui->operatorComboBox->addItem(operatorName, data.id());
|
||||
Q_ASSERT(!m_operatorMap.contains(data.id));
|
||||
const QString operatorName = QString::fromStdString(data.name);
|
||||
m_operatorMap.insert(data.id, operatorName);
|
||||
m_ui->operatorComboBox->addItem(operatorName, data.id);
|
||||
m_ui->operatorComboBox->model()->sort(0);
|
||||
break;
|
||||
}
|
||||
|
||||
case DataModification::eModified:
|
||||
{
|
||||
Q_ASSERT(m_operatorMap.contains(data.id()));
|
||||
const QString operatorName = QString::fromStdString(data.name());
|
||||
m_operatorMap.insert(data.id(), operatorName);
|
||||
int i = m_ui->operatorComboBox->findData(data.id());
|
||||
Q_ASSERT(m_operatorMap.contains(data.id));
|
||||
const QString operatorName = QString::fromStdString(data.name);
|
||||
m_operatorMap.insert(data.id, operatorName);
|
||||
int i = m_ui->operatorComboBox->findData(data.id);
|
||||
Q_ASSERT(i != -1);
|
||||
m_ui->operatorComboBox->setItemText(i, operatorName);
|
||||
m_ui->operatorComboBox->model()->sort(0);
|
||||
@@ -202,13 +204,13 @@ bool OperatorPartyAssignment::apply()
|
||||
const auto &partys = m_ppmDtc->partys();
|
||||
for (auto party : partys)
|
||||
{
|
||||
const QString partyId = QString::number(party.id());
|
||||
QJsonObject propertiesObj = QJsonDocument::fromJson(QByteArray::fromStdString(party.properties())).object();
|
||||
const QString partyId = QString::number(party.id);
|
||||
QJsonObject propertiesObj = QJsonDocument::fromJson(QByteArray::fromStdString(party.properties)).object();
|
||||
QJsonObject subObj = propertiesObj.value(s_partyOpAssignStr).toObject();
|
||||
QJsonArray jsArry = subObj.value(QString::number(party.id())).toArray();
|
||||
QJsonArray jsArry = subObj.value(QString::number(party.id)).toArray();
|
||||
|
||||
const bool containsOpId = jsArry.contains(QJsonValue::fromVariant(m_operatorId));
|
||||
const bool isPartyChecked = statesData.value(party.id(), false);
|
||||
const bool isPartyChecked = statesData.value(party.id, false);
|
||||
if (!containsOpId && !isPartyChecked)
|
||||
continue;
|
||||
if (containsOpId && isPartyChecked)
|
||||
@@ -222,7 +224,7 @@ bool OperatorPartyAssignment::apply()
|
||||
if (jsArry.at(idx).toInt() == m_operatorId)
|
||||
{
|
||||
jsArry.removeAt(idx);
|
||||
subObj.insert(QString::number(party.id()), jsArry);
|
||||
subObj.insert(QString::number(party.id), jsArry);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -230,7 +232,7 @@ bool OperatorPartyAssignment::apply()
|
||||
else if (isPartyChecked)
|
||||
{
|
||||
jsArry.append(QJsonValue::fromVariant(m_operatorId));
|
||||
subObj.insert(QString::number(party.id()), jsArry);
|
||||
subObj.insert(QString::number(party.id), jsArry);
|
||||
}
|
||||
|
||||
|
||||
@@ -239,15 +241,15 @@ bool OperatorPartyAssignment::apply()
|
||||
|
||||
|
||||
Party req = party;
|
||||
req.id(party.id());
|
||||
req.name(party.name());
|
||||
req.color(party.color());
|
||||
req.fadingColor(party.fadingColor());
|
||||
req.hlaForceIdentifier(party.hlaForceIdentifier());
|
||||
req.isUsedBy(party.isUsedBy());
|
||||
req.role(party.role());
|
||||
req.id = party.id;
|
||||
req.name = party.name;
|
||||
req.color = party.color;
|
||||
req.fadingColor = party.fadingColor;
|
||||
req.hlaForceIdentifier = party.hlaForceIdentifier;
|
||||
req.isUsedBy = party.isUsedBy;
|
||||
req.role = party.role;
|
||||
QString props = QString::fromUtf8(QJsonDocument(propertiesObj).toJson());
|
||||
req.properties(props.toStdString());
|
||||
req.properties = props.toStdString();
|
||||
|
||||
m_requestHelper->addRequest([this, req]
|
||||
{
|
||||
|
||||
+9
-7
@@ -1,4 +1,5 @@
|
||||
#include "operator_party_assignment_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <ParticipantManagement/ppm_translation.h>
|
||||
#include <QtGui/QColor>
|
||||
@@ -17,6 +18,7 @@ OPeratorPartyAssignmentModel::OPeratorPartyAssignmentModel(QObject *parent)
|
||||
tr("Role")},
|
||||
parent)
|
||||
, m_dtc(nullptr)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
}
|
||||
bool OPeratorPartyAssignmentModel::initModel(const std::shared_ptr<ParticipantManagement::Interface::Dtc> &dtc)
|
||||
@@ -70,9 +72,9 @@ QVariant OPeratorPartyAssignmentModel::data(const QModelIndex &index, int role)
|
||||
switch(index.column())
|
||||
{
|
||||
case Color:
|
||||
return QColor::fromRgb(QRgb(party.color()));
|
||||
return QColor::fromRgb(QRgb(party.color));
|
||||
case FadedColor:
|
||||
return QColor::fromRgb(QRgb(party.fadingColor()));
|
||||
return QColor::fromRgb(QRgb(party.fadingColor));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,20 +83,20 @@ QVariant OPeratorPartyAssignmentModel::data(const QModelIndex &index, int role)
|
||||
switch (index.column())
|
||||
{
|
||||
case Id:
|
||||
return party.id();
|
||||
return party.id;
|
||||
case Name:
|
||||
return ParticipantManagement::trPartyName(party.name());
|
||||
return ParticipantManagement::trPartyName(party.name);
|
||||
case Color:
|
||||
return QVariant();
|
||||
case FadedColor:
|
||||
return QVariant();
|
||||
case Role:
|
||||
return ParticipantManagement::toString(party.role());
|
||||
return ParticipantManagement::toString(party.role);
|
||||
}
|
||||
}
|
||||
if (role == Qt::CheckStateRole && index.column() == Name)
|
||||
{
|
||||
Qt::CheckState checkState = m_mapPartyCheckStates.value(party.id(),false) ? Qt::Checked : Qt::Unchecked;
|
||||
Qt::CheckState checkState = m_mapPartyCheckStates.value(party.id,false) ? Qt::Checked : Qt::Unchecked;
|
||||
return checkState;
|
||||
}
|
||||
return QVariant();
|
||||
@@ -119,7 +121,7 @@ bool OPeratorPartyAssignmentModel::setData(const QModelIndex &index, const QVari
|
||||
return QAbstractTableModel::setData(index, value, role);
|
||||
|
||||
const ParticipantManagement::Party &party = m_vecData.at(index.row());
|
||||
bool &state = m_mapPartyCheckStates[party.id()];
|
||||
bool &state = m_mapPartyCheckStates[party.id];
|
||||
state = state ? false : true;
|
||||
|
||||
emit dataChanged(index, index, {role});
|
||||
|
||||
+2
-1
@@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/logger.h>
|
||||
|
||||
#include <QtCore/QSortFilterProxyModel>
|
||||
@@ -43,7 +44,7 @@ NGL::INGLLogger &m_logger;
|
||||
bool isFiltered(const Party &data, DataModification modType) const override
|
||||
{
|
||||
|
||||
if (data.id() <= 1)
|
||||
if (data.id <= 1)
|
||||
return true;
|
||||
return LtsWidgets::LtsAbstractTableModel<ParticipantManagement::Party>::isFiltered(data, modType);
|
||||
}
|
||||
|
||||
+39
-39
@@ -54,7 +54,7 @@ PartyEdit::~PartyEdit()
|
||||
|
||||
void PartyEdit::retranslate()
|
||||
{
|
||||
translate(m_ui, m_dtc->party(m_partyId), trPartyName(m_dtc->party(m_partyId).name()), tr("Party"));
|
||||
translate(m_ui, m_dtc->party(m_partyId), trPartyName(m_dtc->party(m_partyId).name), tr("Party"));
|
||||
m_ppmGuiCbxIfc->fillRoleComboBox(m_ui->cbRole);
|
||||
m_ppmGuiCbxIfc->fillHlaForceIdentifierComboBox(m_ui->cbHlaForceIdentifier);
|
||||
}
|
||||
@@ -98,7 +98,7 @@ bool PartyEdit::init(int partyId, LtsSession::LtsSession *session)
|
||||
if (m_partyId >= 0) // pool has id 0 so is a valid party
|
||||
{
|
||||
const Party &party = m_dtc->party(m_partyId);
|
||||
if(party.id() >= 0)
|
||||
if(party.id >= 0)
|
||||
{
|
||||
setData(party);
|
||||
}
|
||||
@@ -115,8 +115,8 @@ bool PartyEdit::init(int partyId, LtsSession::LtsSession *session)
|
||||
}
|
||||
|
||||
// Could be filled programmatically later
|
||||
m_ui->cbAdlerNotification->setProperty("Notification", NotificationManagement::NotificationType::AdlerNotification);
|
||||
m_ui->cbCombatOrder->setProperty("Notification", NotificationManagement::NotificationType::CombatOrder);
|
||||
m_ui->cbAdlerNotification->setProperty("Notification", static_cast<int>(NotificationManagement::NotificationType::AdlerNotification));
|
||||
m_ui->cbCombatOrder->setProperty("Notification", static_cast<int>(NotificationManagement::NotificationType::CombatOrder));
|
||||
|
||||
bool enableNotification = (LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::NotificationShow) );
|
||||
if (!enableNotification)
|
||||
@@ -127,7 +127,7 @@ bool PartyEdit::init(int partyId, LtsSession::LtsSession *session)
|
||||
|
||||
const ParticipantManagement::ConnectState status = m_dtc->saaConnectedState(m_partyId);
|
||||
const bool enableReset = (LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::ChargeAdministrationShow)) &&
|
||||
(status.underlying() == ParticipantManagement::ConnectState::NoHeartbeat);
|
||||
(status == ParticipantManagement::ConnectState::NoHeartbeat);
|
||||
if (!enableReset)
|
||||
{
|
||||
m_ui->lblReset->hide();
|
||||
@@ -156,13 +156,13 @@ bool PartyEdit::apply()
|
||||
ParticipantManagement::HlaForceIdentifierEnum hlaIdentfier = static_cast<ParticipantManagement::HlaForceIdentifierEnum>(m_ui->cbHlaForceIdentifier->currentData().toInt());
|
||||
Party req;
|
||||
|
||||
req.id(m_partyId);
|
||||
req.name(m_ui->leName->text().toStdString());
|
||||
req.color(m_color.rgb());
|
||||
req.fadingColor(m_fadedColor.rgb());
|
||||
req.role(role);
|
||||
req.hlaForceIdentifier(hlaIdentfier);
|
||||
req.isUsedBy(m_isUsed);
|
||||
req.id = m_partyId;
|
||||
req.name = m_ui->leName->text().toStdString();
|
||||
req.color = m_color.rgb();
|
||||
req.fadingColor = m_fadedColor.rgb();
|
||||
req.role = role;
|
||||
req.hlaForceIdentifier = hlaIdentfier;
|
||||
req.isUsedBy = m_isUsed;
|
||||
|
||||
m_requestHelper->addRequest([req, this]()
|
||||
{
|
||||
@@ -171,23 +171,23 @@ bool PartyEdit::apply()
|
||||
}
|
||||
|
||||
OperatorManagement::User user = m_dtcOpm->user(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
QJsonObject opmProperties(QJsonDocument::fromJson(QByteArray::fromStdString(user.properties())).object());
|
||||
QJsonObject opmProperties(QJsonDocument::fromJson(QByteArray::fromStdString(user.properties)).object());
|
||||
|
||||
fillOpmProperties(opmProperties);
|
||||
|
||||
OperatorManagement::OperatorCreateModifyRequest reqOpm;
|
||||
reqOpm.id(user.id());
|
||||
reqOpm.name(user.name());
|
||||
reqOpm.description(user.description());
|
||||
reqOpm.audioChannelPriority(user.audioChannelPriority());
|
||||
reqOpm.projectionPriority(user.projectionPriority());
|
||||
reqOpm.image(user.image());
|
||||
reqOpm.visiblePartiesByExercise(user.visiblePartiesByExercise());
|
||||
reqOpm.rolePresetId(user.rolePresetId());
|
||||
reqOpm.id = user.id;
|
||||
reqOpm.name = user.name;
|
||||
reqOpm.description = user.description;
|
||||
reqOpm.audioChannelPriority = user.audioChannelPriority;
|
||||
reqOpm.projectionPriority = user.projectionPriority;
|
||||
reqOpm.image = user.image;
|
||||
reqOpm.visiblePartiesByExercise = user.visiblePartiesByExercise;
|
||||
reqOpm.rolePresetId = user.rolePresetId;
|
||||
|
||||
QString properties = QString::fromUtf8(QJsonDocument(opmProperties).toJson());
|
||||
DEBUG_LOG(m_logger) << "properties: " << properties;
|
||||
reqOpm.properties(properties.toStdString());
|
||||
reqOpm.properties = properties.toStdString();
|
||||
|
||||
m_requestHelper->addRequest([reqOpm, this]()
|
||||
{
|
||||
@@ -238,11 +238,11 @@ void PartyEdit::onResetAdlerConnectionClicked()
|
||||
|
||||
void PartyEdit::onPartyChanged(const Party &data, DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eRemoved || data.id() != m_partyId)
|
||||
if (modType == DataModification::eRemoved || data.id != m_partyId)
|
||||
return;
|
||||
|
||||
const ConnectState connectState = m_dtc->saaConnectedState(m_partyId);
|
||||
switch (connectState.underlying())
|
||||
switch (connectState)
|
||||
{
|
||||
case ParticipantManagement::ConnectState::NoHeartbeat:
|
||||
{
|
||||
@@ -264,14 +264,14 @@ void PartyEdit::onPartyChanged(const Party &data, DataModification modType)
|
||||
|
||||
void PartyEdit::setData(const Party &party)
|
||||
{
|
||||
m_ui->leName->setText(ParticipantManagement::trPartyName(party.name()));
|
||||
m_color = QColor::fromRgb(QRgb(party.color()));
|
||||
m_fadedColor = QColor::fromRgb(QRgb(party.fadingColor()));
|
||||
m_isUsed = party.isUsedBy();
|
||||
m_ui->leName->setText(ParticipantManagement::trPartyName(party.name));
|
||||
m_color = QColor::fromRgb(QRgb(party.color));
|
||||
m_fadedColor = QColor::fromRgb(QRgb(party.fadingColor));
|
||||
m_isUsed = party.isUsedBy;
|
||||
setColorToButton(m_ui->tbColor, m_color);
|
||||
setColorToButton(m_ui->tbFadedColor, m_fadedColor);
|
||||
m_ui->cbRole->setCurrentIndex(m_ui->cbRole->findData(party.role().underlying()));
|
||||
m_ui->cbHlaForceIdentifier->setCurrentIndex(m_ui->cbHlaForceIdentifier->findData(party.hlaForceIdentifier().underlying()));
|
||||
m_ui->cbRole->setCurrentIndex(m_ui->cbRole->findData(static_cast<int>(party.role)));
|
||||
m_ui->cbHlaForceIdentifier->setCurrentIndex(m_ui->cbHlaForceIdentifier->findData(static_cast<int>(party.hlaForceIdentifier)));
|
||||
}
|
||||
|
||||
void PartyEdit::setColorToButton(QToolButton *button, const QColor &color)
|
||||
@@ -283,7 +283,7 @@ void PartyEdit::fillJsonSuppressNotifications( QJsonArray ¬if, NotificationMa
|
||||
{
|
||||
QJsonObject suppNotif;
|
||||
suppNotif[QStringLiteral("partyId")] = m_partyId;
|
||||
suppNotif[QStringLiteral("AddressType")] = NotificationManagement::AddressType::Service;
|
||||
suppNotif[QStringLiteral("AddressType")] = static_cast<int>(NotificationManagement::AddressType::Service);
|
||||
suppNotif[QStringLiteral("Address")] = AreaEffectSimulation::Offset;
|
||||
|
||||
QCheckBox *cbNotif = findCheckBoxByNotificationType(notifType);
|
||||
@@ -293,7 +293,7 @@ void PartyEdit::fillJsonSuppressNotifications( QJsonArray ¬if, NotificationMa
|
||||
int index = findSuppressNotification(m_partyId, notifType, notif);
|
||||
if (!cbNotif->isChecked())
|
||||
{
|
||||
suppNotif[QStringLiteral("NotificationType")] = notifType.underlying();
|
||||
suppNotif[QStringLiteral("NotificationType")] = static_cast<int>(notifType);
|
||||
if (index >= 0)
|
||||
notif.replace(index, suppNotif);
|
||||
else
|
||||
@@ -310,7 +310,7 @@ QCheckBox* PartyEdit::findCheckBoxByNotificationType(const NotificationManagemen
|
||||
{
|
||||
for(QCheckBox* cb : findChildren<QCheckBox*>())
|
||||
{
|
||||
if (cb->property("Notification").toInt() == notif.underlying())
|
||||
if (cb->property("Notification").toInt() == static_cast<int>(notif))
|
||||
return cb;
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ int PartyEdit::findSuppressNotification( int partyId, NotificationManagement::No
|
||||
{
|
||||
QJsonObject obj = suppNotif.at(i).toObject();
|
||||
if (obj[QStringLiteral("partyId")] == partyId &&
|
||||
obj[QStringLiteral("NotificationType")] == notifType.underlying())
|
||||
obj[QStringLiteral("NotificationType")] == static_cast<int>(notifType))
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ void PartyEdit::notificationCheck()
|
||||
|
||||
DEBUG_LOG(m_logger) << "Party allowed for ADLER notifications";
|
||||
|
||||
const std::string properties = m_dtcOpm->user(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()).properties();
|
||||
const std::string properties = m_dtcOpm->user(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()).properties;
|
||||
QJsonObject opmProperties(QJsonDocument::fromJson(QByteArray::fromStdString(properties)).object());
|
||||
|
||||
QJsonArray arrExercises = opmProperties[QStringLiteral("Exercises")].toArray();
|
||||
@@ -419,11 +419,11 @@ void PartyEdit::modifyPartyProperties()
|
||||
ParticipantManagement::Party requestParty;
|
||||
requestParty = m_dtc->party(m_partyId);
|
||||
// Get properties and then update them
|
||||
const QJsonObject &origObj = QJsonDocument::fromJson(requestParty.properties().c_str()).object();
|
||||
const QJsonObject &origObj = QJsonDocument::fromJson(requestParty.properties.c_str()).object();
|
||||
QJsonObject adlerPropertiesObj = origObj[QStringLiteral("Adler")].toObject();
|
||||
adlerPropertiesObj[QStringLiteral("saaConnectedState")] = ParticipantManagement::ConnectState::Disconnecting;
|
||||
adlerPropertiesObj[QStringLiteral("saaConnectedState")] = static_cast<int>(ParticipantManagement::ConnectState::Disconnecting);
|
||||
|
||||
const QByteArray &propertiesBa = requestParty.properties().c_str();
|
||||
const QByteArray &propertiesBa = requestParty.properties.c_str();
|
||||
QJsonParseError parserError;
|
||||
QJsonDocument doc(QJsonDocument::fromJson(propertiesBa, &parserError));
|
||||
|
||||
@@ -439,7 +439,7 @@ void PartyEdit::modifyPartyProperties()
|
||||
obj[QStringLiteral("Adler")] = adlerPropertiesObj;
|
||||
|
||||
const QByteArray propertiesStr = QJsonDocument(obj).toJson(QJsonDocument::Compact);
|
||||
requestParty.properties() = propertiesStr.data();
|
||||
requestParty.properties = propertiesStr.data();
|
||||
|
||||
m_ftc->modifyPartyDataRequest(requestParty);
|
||||
}
|
||||
|
||||
+1
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <ParticipantManagement/logger.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_ftc.h>
|
||||
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
|
||||
+23
-23
@@ -74,9 +74,9 @@ QVariant PartyModel::data(const QModelIndex &index, int role) const
|
||||
switch(index.column())
|
||||
{
|
||||
case Color:
|
||||
return QColor::fromRgb(QRgb(party.color()));
|
||||
return QColor::fromRgb(QRgb(party.color));
|
||||
case FadedColor:
|
||||
return QColor::fromRgb(QRgb(party.fadingColor()));
|
||||
return QColor::fromRgb(QRgb(party.fadingColor));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,25 +85,25 @@ QVariant PartyModel::data(const QModelIndex &index, int role) const
|
||||
switch (index.column())
|
||||
{
|
||||
case Id:
|
||||
return party.id();
|
||||
return party.id;
|
||||
case Name:
|
||||
return ParticipantManagement::trPartyName(party.name());
|
||||
return ParticipantManagement::trPartyName(party.name);
|
||||
case Color:
|
||||
return QVariant();
|
||||
case FadedColor:
|
||||
return QVariant();
|
||||
case Role:
|
||||
return ParticipantManagement::toString(party.role());
|
||||
return ParticipantManagement::toString(party.role);
|
||||
case IsUsedBy:
|
||||
return party.isUsedBy() ? tr("Yes") : tr("No");
|
||||
return party.isUsedBy ? tr("Yes") : tr("No");
|
||||
case IsSaaConnected:
|
||||
{
|
||||
if ( party.properties().empty())
|
||||
if ( party.properties.empty())
|
||||
return false;
|
||||
|
||||
ParticipantManagement::ConnectState status = m_ppmDtc->saaConnectedState(party.id());
|
||||
ParticipantManagement::ConnectState status = m_ppmDtc->saaConnectedState(party.id);
|
||||
QString connectState;
|
||||
switch (status.underlying())
|
||||
switch (status)
|
||||
{
|
||||
case ParticipantManagement::ConnectState::Undefined:
|
||||
connectState = QStringLiteral("");
|
||||
@@ -116,9 +116,9 @@ QVariant PartyModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
case SaaName:
|
||||
{
|
||||
if ( party.properties().empty())
|
||||
if ( party.properties.empty())
|
||||
return QString{};
|
||||
const QJsonObject properties(QJsonDocument::fromJson(QByteArray::fromStdString(party.properties())).object());
|
||||
const QJsonObject properties(QJsonDocument::fromJson(QByteArray::fromStdString(party.properties)).object());
|
||||
if (!properties.contains(QStringLiteral("Adler")) )
|
||||
return QString{};
|
||||
const QJsonObject adlerObj = properties[QStringLiteral("Adler")].toObject();
|
||||
@@ -131,9 +131,9 @@ QVariant PartyModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
case SzenarName:
|
||||
{
|
||||
if ( party.properties().empty())
|
||||
if ( party.properties.empty())
|
||||
return QString{};
|
||||
const QJsonObject properties(QJsonDocument::fromJson(QByteArray::fromStdString(party.properties())).object());
|
||||
const QJsonObject properties(QJsonDocument::fromJson(QByteArray::fromStdString(party.properties)).object());
|
||||
if (!properties.contains(QStringLiteral("Adler")) )
|
||||
return QString{};
|
||||
const QJsonObject adlerObj = properties[QStringLiteral("Adler")].toObject();
|
||||
@@ -148,16 +148,16 @@ QVariant PartyModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
bool PartyModel::hasParty(const Party &party) const
|
||||
{
|
||||
const auto visiblePartiesByExercise = m_opmDtc->user(m_operatorId).visiblePartiesByExercise();
|
||||
const auto visiblePartiesByExercise = m_opmDtc->user(m_operatorId).visiblePartiesByExercise;
|
||||
|
||||
for (const auto &exerciseParties : visiblePartiesByExercise)
|
||||
{
|
||||
if (exerciseParties.exerciseId() != m_session->exerciseId())
|
||||
if (exerciseParties.exerciseId != m_session->exerciseId())
|
||||
continue;
|
||||
if (!exerciseParties.visibleParties().is_set()) //has_value not support on windows yet so we need depricated is_set
|
||||
if (!exerciseParties.visibleParties.has_value()) //has_value not support on windows yet so we need depricated is_set
|
||||
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;
|
||||
}
|
||||
@@ -165,16 +165,16 @@ bool PartyModel::hasParty(const Party &party) const
|
||||
}
|
||||
|
||||
bool PartyModel::isPartyHidden(const Party &party) const
|
||||
{ const auto visiblePartiesByExercise = m_opmDtc->user(m_operatorId).visiblePartiesByExercise();
|
||||
{ const auto visiblePartiesByExercise = m_opmDtc->user(m_operatorId).visiblePartiesByExercise;
|
||||
|
||||
for (const auto &exerciseParties : visiblePartiesByExercise)
|
||||
{
|
||||
if (exerciseParties.exerciseId() != m_session->exerciseId())
|
||||
if (exerciseParties.exerciseId != m_session->exerciseId())
|
||||
continue;
|
||||
if (!exerciseParties.hiddenParties().is_set()) //has_value not support on windows yet so we need depricated is_set
|
||||
if (!exerciseParties.hiddenParties.has_value()) //has_value not support on windows yet so we need depricated is_set
|
||||
return false;
|
||||
for (const auto &partyId : exerciseParties.hiddenParties().get())
|
||||
if (partyId == party.id())
|
||||
for (const auto &partyId : exerciseParties.hiddenParties.get())
|
||||
if (partyId == party.id)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <OperatorManagement/opm_dtc.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/logger.h>
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
@@ -45,7 +46,7 @@ NGL::INGLLogger &m_logger;
|
||||
bool isFiltered(const Party &data, DataModification modType) const override
|
||||
{
|
||||
|
||||
if (data.id() <= 1)
|
||||
if (data.id <= 1)
|
||||
return true;
|
||||
return LtsWidgets::LtsAbstractTableModel<ParticipantManagement::Party>::isFiltered(data, modType);
|
||||
}
|
||||
|
||||
+10
-8
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "ppm_party_view.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_ppm_party_view.h"
|
||||
#include "CustomView/ppm_party.h"
|
||||
#include "ppm_party_edit.h"
|
||||
@@ -23,6 +24,7 @@ PartyView::PartyView(const QString &menuGroup, QWidget *parent)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_session(nullptr)
|
||||
, m_ui(new Ui::PartyView)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->widget->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
@@ -103,8 +105,8 @@ void PartyView::enaDisa()
|
||||
else
|
||||
{
|
||||
const ParticipantManagement::Party party = m_model->getRowData(row);
|
||||
bEditEnabled = party.id() > 0;
|
||||
bRemoveEnabled = !party.isUsedBy();
|
||||
bEditEnabled = party.id > 0;
|
||||
bRemoveEnabled = !party.isUsedBy;
|
||||
}
|
||||
|
||||
if (m_session->exerciseId() > 0)
|
||||
@@ -149,9 +151,9 @@ void PartyView::onEditParty()
|
||||
|
||||
ParticipantManagement::Party party = m_model->getRowData(row);
|
||||
PartyEdit *dialog = new PartyEdit(this);
|
||||
dialog->init(party.id(), m_session);
|
||||
dialog->init(party.id, m_session);
|
||||
|
||||
addDialog(dialog, m_menuGroup, QLatin1String("ppmEditParty")+QString::number(party.id()), LtsWidgets::LayoutArea::eDialogTab);
|
||||
addDialog(dialog, m_menuGroup, QLatin1String("ppmEditParty")+QString::number(party.id), LtsWidgets::LayoutArea::eDialogTab);
|
||||
}
|
||||
|
||||
void PartyView::onAddParty()
|
||||
@@ -168,10 +170,10 @@ void PartyView::onRemoveParty()
|
||||
if (!curIdx.isValid())
|
||||
return;
|
||||
const Party party = m_model->getRowData(curIdx.row());
|
||||
if (party.id() < 0)
|
||||
if (party.id < 0)
|
||||
return;
|
||||
RemovePartyRequest req;
|
||||
req.partyId(party.id());
|
||||
req.partyId = party.id;
|
||||
m_requestHelper->startSingleRequest([req, this]()
|
||||
{
|
||||
return m_ftc->removePartyRequest(req, this);
|
||||
@@ -194,9 +196,9 @@ void PartyView::onSyncParties()
|
||||
m_requestHelper->startSingleRequest([this]()
|
||||
{
|
||||
SyncPartiesRequest req;
|
||||
req.exerciseId(m_session->exerciseId());
|
||||
req.exerciseId = m_session->exerciseId();
|
||||
|
||||
DEBUG_LOG(m_logger) << "Sync parties for exercise " << req.exerciseId();
|
||||
DEBUG_LOG(m_logger) << "Sync parties for exercise " << req.exerciseId;
|
||||
|
||||
return m_ftc->syncPartiesRequest(req, this);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user