Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Common/LtsLogin/logout_info_dialog.cpp
T
Berrux Kana 3f7beb3c7e Qt6 migration: build fixes for Groups 10/11 + missing plugin modules
Continue the Qt5->Qt6 migration so the LTS Projects (Group 10) and LTS
Application (Group 11) compile, link, and ctest runs.

Qt5->Qt6 API migration (resolves removed/deprecated Qt6 APIs) across Lts
Tools and Apps, e.g. QAction->QActionGroup, QAbstractSocket::errorOccurred,
Qt::SkipEmptyParts, QRandomGenerator, QInputDevice::DeviceType,
QRegularExpression, QLatin1Literal->QStringLiteral, and the SampleModel
m_description->description rename.

CMake build fixes:
- CMakeLists.txt: add Lts/Common to CMAKE_AUTOMOC_INCLUDE_DIRECTORIES so moc
  resolves Q_INTERFACES(ProjectPlugin::Plugin) for the migrated Projects.
- cmake/NGLMacros.cmake: NGL_COMPILE_RESOURCES - replace return() (which aborts
  the calling CMakeLists.txt) with an if/else/endif.
- OpApp/THP: guard the ArcGISQt5Hack link with $<IF:$<TARGET_EXISTS:...>> (the
  target is absent when the SituationMap viewer is stubbed); matches
  CentralEffectSimulation.
- LtsSession: prefer the in-tree svcCoreClient target over a FIND_LIBRARY in
  /usr/local/lib.
- CnrProxyTester/DotMatrixDisplay: set AUTOUIC_SEARCH_PATHS for the ui/ subdir.
- TopicDiscover: link NGLLogger.

Export-header visibility stubs (expand the empty *_EXPORT macro to
__attribute__((visibility("default"))); the build sets -fvisibility=hidden and
these stubs shadow the CMake-generated header):
- include/LtsProjectionWorkstation/ltsprojectionworkstation_export.h (fixes
  undefined reference to LtsProjectionWorkstation::getInstance /
  setProjectionOperatorPreset)
- include/LtsSession/ltssession_export.h, include/LtsUtilsGuiDds/ltsutilsguidds_export.h (same pattern)

New plugin modules (copied from legacy) so LtsAppDescriptorChecker finds the
gui:3 IIDs referenced by the Projects' apps.json:
- TakeHomePackageManager/OldTHP              gui:3:tpm.man, gui:3:tpm.usb
- PresentationManagement/.../ScriptEditor   gui:3:pre.script.edit
- Timeline/Gui/EventTimelineClassic         gui:3:tln.view

new_docker_build.sh: correct group targets to the actual CMake target names,
guard LtsReportDisplay on BUILD_CODIFICATION, and skip modules unavailable in
the prebuilt image (AsmWorkstationCertifier/botan2, TrajectoryWidget,
VideoImport, thp_viewer/VLC).
2026-10-05 10:49:34 +02:00

93 lines
2.4 KiB
C++

#include "logout_info_dialog.h"
#include "ui_logout_info_dialog.h"
#include <QtCore/QTimer>
namespace LtsLogin
{
LogoutInformationDialog::LogoutInformationDialog(int timeOut, AssetManagement::ShutdownAction shutdownAction,
QWidget* parent)
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal), m_ui(new Ui::LogoutInformationDialog),
m_timer(new QTimer(this)), m_timeOut(timeOut), m_secsLeft(timeOut)
{
m_ui->setupUi(this);
QString actionText;
switch (shutdownAction)
{
case AssetManagement::ShutdownAction::NoAction:
case AssetManagement::ShutdownAction::Logout:
actionText = tr("logout");
break;
case AssetManagement::ShutdownAction::Shutdown:
actionText = tr("shutdown");
break;
case AssetManagement::ShutdownAction::Reboot:
actionText = tr("reboot");
break;
}
setText(tr("A %1 was triggered by a remote workstation.").arg(actionText));
connect(m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked, this,
&LogoutInformationDialog::acceptClicked);
connect(m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked, this,
&LogoutInformationDialog::closeClicked);
connect(m_timer, &QTimer::timeout, this, &LogoutInformationDialog::onTimerTimeout);
m_timer->setInterval(1000);
}
LogoutInformationDialog::~LogoutInformationDialog()
{
delete m_ui;
}
void LogoutInformationDialog::setText(const QString& text)
{
m_ui->lblLogoutText->setText(text);
}
void LogoutInformationDialog::onTimerTimeout()
{
if (m_secsLeft > 0)
{
m_secsLeft--;
setCloseButtonText(m_secsLeft);
}
else
{
acceptClicked();
}
}
void LogoutInformationDialog::acceptClicked()
{
m_timer->stop();
accept();
}
void LogoutInformationDialog::closeClicked()
{
m_timer->stop();
reject();
}
void LogoutInformationDialog::setCloseButtonText(int secsLeft)
{
m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Close)->setText(tr("Abort [%1]").arg(secsLeft));
}
void LogoutInformationDialog::showEvent(QShowEvent* event)
{
m_secsLeft = m_timeOut;
setCloseButtonText(m_secsLeft);
m_timer->start();
LtsWidgets::LtsFramelessDialog::showEvent(event);
}
} // namespace LtsLogin