- 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>
93 lines
2.4 KiB
C++
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.underlying())
|
|
{
|
|
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
|