- training_area_telegrams.cpp: Fixed QJsonObject initializer syntax (Qt6 requires {{}} not ({}))
- training_area_telegrams.cpp: Fixed fromJson() methods to access m_* members directly
- training_area_telegrams.cpp: Fixed brace mismatches in multiple toJson() methods
- training_area_telegrams.h: Changed Header struct to public members for consistency
- tx_mixin.cpp: Fixed getEquipmentNumber() template for direct member access
- lts_coordinate.cpp: Added missing #include <iomanip>
- MIGRATION_STATUS.md: Added migration progress tracking document
C++17 constraint enforced due to RTI Connext DDS 7.7.0 incompatibility with C++20+
Build status: BUILD_RTI=OFF successful (0 errors, warnings only)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
116 lines
2.8 KiB
C++
Executable File
116 lines
2.8 KiB
C++
Executable File
#include "dev_permissions_dialog.h"
|
|
#include "ui_dev_permissions_dialog.h"
|
|
|
|
#include <LtsSession/lts_session.h>
|
|
|
|
#include <QtWidgets/QHBoxLayout>
|
|
#include <QtWidgets/QPushButton>
|
|
#include <QtWidgets/QLabel>
|
|
#include <QtCore/QTimer>
|
|
|
|
|
|
namespace DeveloperTools
|
|
{
|
|
|
|
PermissionsDialog::PermissionsDialog()
|
|
: LtsWidgets::LtsDialog()
|
|
, m_ui(new Ui::PermissionsDialog())
|
|
, m_session(nullptr)
|
|
{
|
|
m_ui->setupUi(this);
|
|
|
|
connect(m_ui->pushButton, &QPushButton::clicked,
|
|
this, &PermissionsDialog::setThings);
|
|
}
|
|
|
|
|
|
PermissionsDialog::~PermissionsDialog()
|
|
{
|
|
delete m_ui;
|
|
}
|
|
|
|
|
|
bool PermissionsDialog::init(LtsSession::LtsSession *session)
|
|
{
|
|
m_session = session;
|
|
|
|
setThings();
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
void PermissionsDialog::setThings()
|
|
{
|
|
const QVector<LtsWidgets::PluginData> &missingRightActions = m_session->missingRightActions();
|
|
|
|
for (auto i = missingRightActions.constBegin(); i != missingRightActions.constEnd(); ++i)
|
|
{
|
|
QWidget *container = new QWidget();
|
|
QHBoxLayout *l = new QHBoxLayout();
|
|
container->setLayout(l);
|
|
|
|
const LtsWidgets::PluginData &pd = *i;
|
|
QLabel *text = new QLabel(QStringLiteral("Menu: %1 - Text: %2 - Ident: %3").arg(pd.menuGroup, pd.menuText, pd.identifier));
|
|
QPushButton *execute = new QPushButton(QStringLiteral("execute"));
|
|
connect(execute, &QPushButton::clicked,
|
|
this, [this, pd]()
|
|
{
|
|
if (pd.createWidgetFunc)
|
|
{
|
|
LtsDialog *w = pd.createWidgetFunc(this);
|
|
|
|
if (w)
|
|
m_session->addWidget(w, pd.menuGroup, pd.identifier, pd.layoutArea, pd.closable);
|
|
}
|
|
|
|
if (pd.directFunc)
|
|
{
|
|
pd.directFunc(pd);
|
|
}
|
|
});
|
|
|
|
QPushButton *allow = new QPushButton(QStringLiteral("allow"));
|
|
|
|
if (pd.createInstant == LtsWidgets::CreateInstantType::CreateInstantAndDiscardAction)
|
|
{
|
|
allow->setCursor(QCursor(Qt::WhatsThisCursor));
|
|
allow->setToolTip(QStringLiteral("CreateInstantType == CreateInstantAndDiscardAction !"));
|
|
allow->setEnabled(false);
|
|
}
|
|
else
|
|
{
|
|
connect(allow, &QPushButton::clicked,
|
|
this, [this, pd , container]()
|
|
{
|
|
LtsWidgets::PluginData _pd = pd;
|
|
_pd.operatorRight = 0;
|
|
m_session->addAction(_pd);
|
|
container->deleteLater();
|
|
|
|
|
|
QVector<LtsWidgets::PluginData> &missingRightActions = m_session->missingRightActions();
|
|
for (int i = 0; i < missingRightActions.count(); i++)
|
|
{
|
|
LtsWidgets::PluginData &__pd = missingRightActions[i];
|
|
if (__pd.identifier == _pd.identifier &&
|
|
__pd.menuGroup == _pd.menuGroup &&
|
|
__pd.menuText == _pd.menuText)
|
|
{
|
|
missingRightActions.remove(i);
|
|
break;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
l->addWidget(text, 1);
|
|
l->addWidget(execute);
|
|
l->addWidget(allow);
|
|
|
|
m_ui->verticalLayout->addWidget(container);
|
|
}
|
|
}
|
|
|
|
}
|