Files
qt-migration-legatus/qt5-before/dlbo/Lts/Tools/LicenceEditor/licenceedit.cpp
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list

Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF

Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
  - Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
  - Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)

Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified

Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-15 18:20:26 +00:00

124 lines
3.3 KiB
C++

/*
* @RDE_HEADER@
* <short description>
* $Id$
* $HeadURL$
* $Author$
* Created by Malte Schröder, SLSE, 2016-06-08
*/
#include "licenceedit.h"
#include "ui_licenceedit.h"
#include <LtsLicence/lts_licence.h>
LicenceEdit::LicenceEdit(QWidget *parent)
: NGLDialog(parent)
, m_ui(new Ui::LicenceEdit)
{
m_ui->setupUi(this);
clear();
connect(m_ui->nglDialogButtonBox, &NGLDialogButtonBox::onOk,
this, &LicenceEdit::onOk);
connect(m_ui->nglDialogButtonBox, &NGLDialogButtonBox::onCancel,
this, &LicenceEdit::onCancel);
connect(m_ui->chbIgnoreCount, &QCheckBox::stateChanged,
this, &LicenceEdit::enableIgnoreCount);
connect(m_ui->chbIgnoreExpiration, &QCheckBox::stateChanged,
this, &LicenceEdit::enableIgnoreExpiration);
connect(m_ui->leName, &QLineEdit::textChanged,
this, &LicenceEdit::onNameChanged);
}
LicenceEdit::~LicenceEdit()
{
delete m_ui;
}
/**
* @brief enables QCheckBox "Ignore Count"
* @param checkState
*
* The function enables or disables the QCheckBox "sbCount"
* The parameter @checkState represents the CheckState of the QCheckBox.
*
* @return void
*/
void LicenceEdit::enableIgnoreCount(int checkState)
{
m_ui->lbxCount->setEnabled(checkState == Qt::Unchecked);
m_ui->sbMaxCount->setEnabled(checkState == Qt::Unchecked);
}
/**
* @brief enables QCheckBox "Ignore Expiration"
* @param i
*
* The function enables or disables the QCheckBox "sbExpiration"
* The parameter "i" represents the CheckState of the QCheckBox.
*
* @return void
*/
void LicenceEdit::enableIgnoreExpiration(int checkState)
{
m_ui->lbxExpiry->setEnabled(checkState == Qt::Unchecked);
m_ui->dateEdit->setEnabled(checkState == Qt::Unchecked);
m_ui->timeEdit->setEnabled(checkState == Qt::Unchecked);
}
void LicenceEdit::onNameChanged(const QString &name)
{
setWindowTitle(name.isEmpty() ? tr("Add Licence") : name);
m_ui->nglDialogButtonBox->setEnabled(NGLStandardButton::Ok, !name.isEmpty());
}
void LicenceEdit::setLicence(const LtsLicence::Licence &licence)
{
m_ui->leName->setText(licence.name);
m_ui->dateEdit->setDate(licence.expiration.date());
m_ui->timeEdit->setTime(licence.expiration.time());
m_ui->sbMaxCount->setValue(licence.maxCount);
m_ui->chbIgnoreCount->setChecked(licence.ignoreMaxCount);
m_ui->chbIgnoreExpiration->setChecked(licence.ignoreExpiration);
m_ui->leName->setEnabled(false);
}
void LicenceEdit::clear()
{
m_ui->leName->clear();
m_ui->chbIgnoreCount->setChecked(false);
m_ui->chbIgnoreExpiration->setChecked(false);
m_ui->dateEdit->setMinimumDate(QDate::currentDate());
m_ui->dateEdit->setDate(QDateTime::currentDateTime().date());
m_ui->timeEdit->setTime(QDateTime::currentDateTime().time());
m_ui->sbMaxCount->setValue(1);
m_ui->leName->setEnabled(true);
m_ui->leName->setFocus();
}
void LicenceEdit::onOk()
{
QDateTime dateTime(m_ui->dateEdit->date(), m_ui->timeEdit->time());
LtsLicence::Licence li;
li.name = m_ui->leName->text();
li.expiration = dateTime;
li.maxCount = m_ui->sbMaxCount->text().toInt();
li.ignoreMaxCount = m_ui->chbIgnoreCount->isChecked();
li.ignoreExpiration = m_ui->chbIgnoreExpiration->isChecked();
emit newLicence(li);
accept();
}
void LicenceEdit::onCancel()
{
reject();
}