mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
Ref T420, logoff countdown time configurable
This commit is contained in:
@@ -77,8 +77,7 @@ namespace BlackGui
|
||||
{
|
||||
ui->setupUi(this);
|
||||
m_logoffCountdownTimer.setObjectName("CLoginComponent:m_logoffCountdownTimer");
|
||||
ui->pb_LogoffTimeout->setMaximum(LogoffIntervalSeconds);
|
||||
ui->pb_LogoffTimeout->setValue(LogoffIntervalSeconds);
|
||||
this->setLogoffCountdown();
|
||||
connect(&m_logoffCountdownTimer, &QTimer::timeout, this, &CLoginComponent::logoffCountdown);
|
||||
|
||||
ui->tw_Network->setCurrentIndex(0);
|
||||
@@ -205,6 +204,15 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CLoginComponent::setLogoffCountdown(int timeout)
|
||||
{
|
||||
if (timeout < 0) { timeout = LogoffIntervalSeconds; }
|
||||
|
||||
ui->pb_LogoffTimeout->setMaximum(timeout);
|
||||
ui->pb_LogoffTimeout->setValue(timeout);
|
||||
m_logoffIntervalSeconds = timeout;
|
||||
}
|
||||
|
||||
void CLoginComponent::loginCancelled()
|
||||
{
|
||||
m_logoffCountdownTimer.stop();
|
||||
@@ -450,8 +458,8 @@ namespace BlackGui
|
||||
|
||||
void CLoginComponent::startLogoffTimerCountdown()
|
||||
{
|
||||
ui->pb_LogoffTimeout->setValue(LogoffIntervalSeconds);
|
||||
m_logoffCountdownTimer.setInterval(1000);
|
||||
ui->pb_LogoffTimeout->setValue(m_logoffIntervalSeconds);
|
||||
m_logoffCountdownTimer.setInterval(m_logoffIntervalSeconds * 1000 / 10);
|
||||
m_logoffCountdownTimer.start();
|
||||
}
|
||||
|
||||
|
||||
@@ -81,6 +81,9 @@ namespace BlackGui
|
||||
//! Main info area changed
|
||||
void mainInfoAreaChanged(const QWidget *currentWidget);
|
||||
|
||||
//! Set a logoof time
|
||||
void setLogoffCountdown(int timeout = -1);
|
||||
|
||||
signals:
|
||||
//! Login
|
||||
void loginOrLogoffSuccessful();
|
||||
@@ -216,7 +219,9 @@ namespace BlackGui
|
||||
//! Has contexts?
|
||||
bool hasValidContexts();
|
||||
|
||||
static const int OverlayMessageMs = 5000;
|
||||
static constexpr int OverlayMessageMs = 5000;
|
||||
static constexpr int LogoffIntervalSeconds = 20; //!< time before logoff
|
||||
|
||||
QScopedPointer<Ui::CLoginComponent> ui;
|
||||
QScopedPointer<CDbQuickMappingWizard> m_mappingWizard;
|
||||
BlackMisc::CDigestSignal m_changedLoginDataDigestSignal { this, &CLoginComponent::loginDataChangedDigest, 1500, 10 };
|
||||
@@ -225,8 +230,9 @@ namespace BlackGui
|
||||
bool m_updatePilotOnServerChanges = true;
|
||||
const QIcon m_iconPlay {":/famfamfam/icons/famfamfam/icons/silk/control_play_blue.png"};
|
||||
const QIcon m_iconPause {":/famfamfam/icons/famfamfam/icons/silk/control_pause_blue.png"};
|
||||
const int LogoffIntervalSeconds = 20; //!< time before logoff
|
||||
int m_logoffIntervalSeconds = LogoffIntervalSeconds;
|
||||
QTimer m_logoffCountdownTimer; //!< timer for logoff countdown
|
||||
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TLastModel> m_lastAircraftModel { this }; //!< recently used aircraft model
|
||||
BlackCore::Data::CNetworkSetup m_networkSetup; //!< servers last used
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user