Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+50
-52
@@ -1,94 +1,92 @@
|
||||
|
||||
|
||||
|
||||
#include "logout_info_dialog.h"
|
||||
|
||||
#include "ui_logout_info_dialog.h"
|
||||
|
||||
#include <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)
|
||||
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;
|
||||
}
|
||||
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));
|
||||
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);
|
||||
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);
|
||||
m_timer->setInterval(1000);
|
||||
}
|
||||
|
||||
LogoutInformationDialog::~LogoutInformationDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void LogoutInformationDialog::setText(const QString &text)
|
||||
void LogoutInformationDialog::setText(const QString& text)
|
||||
{
|
||||
m_ui->lblLogoutText->setText(text);
|
||||
m_ui->lblLogoutText->setText(text);
|
||||
}
|
||||
|
||||
void LogoutInformationDialog::onTimerTimeout()
|
||||
{
|
||||
if (m_secsLeft > 0)
|
||||
{
|
||||
m_secsLeft--;
|
||||
setCloseButtonText(m_secsLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
acceptClicked();
|
||||
}
|
||||
if (m_secsLeft > 0)
|
||||
{
|
||||
m_secsLeft--;
|
||||
setCloseButtonText(m_secsLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
acceptClicked();
|
||||
}
|
||||
}
|
||||
|
||||
void LogoutInformationDialog::acceptClicked()
|
||||
{
|
||||
m_timer->stop();
|
||||
accept();
|
||||
m_timer->stop();
|
||||
accept();
|
||||
}
|
||||
|
||||
void LogoutInformationDialog::closeClicked()
|
||||
{
|
||||
m_timer->stop();
|
||||
reject();
|
||||
|
||||
m_timer->stop();
|
||||
reject();
|
||||
}
|
||||
|
||||
void LogoutInformationDialog::setCloseButtonText(int secsLeft)
|
||||
{
|
||||
m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Close)->setText(tr("Abort [%1]").arg(secsLeft));
|
||||
m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Close)->setText(tr("Abort [%1]").arg(secsLeft));
|
||||
}
|
||||
|
||||
void LogoutInformationDialog::showEvent(QShowEvent *event)
|
||||
void LogoutInformationDialog::showEvent(QShowEvent* event)
|
||||
{
|
||||
m_secsLeft = m_timeOut;
|
||||
setCloseButtonText(m_secsLeft);
|
||||
m_timer->start();
|
||||
LtsWidgets::LtsFramelessDialog::showEvent(event);
|
||||
m_secsLeft = m_timeOut;
|
||||
setCloseButtonText(m_secsLeft);
|
||||
m_timer->start();
|
||||
LtsWidgets::LtsFramelessDialog::showEvent(event);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace LtsLogin
|
||||
Reference in new issue
Block a user