refactor: Remove option to disable autologoff

Auto logoff was always enabled in normal builds anyway, even when the
user tried to disable it (see 8eff8cd).
This commit is contained in:
Lars Toenning
2024-01-27 22:16:42 +01:00
parent 882ae3b741
commit 298c9eeec1
14 changed files with 0 additions and 120 deletions

View File

@@ -24,11 +24,6 @@ namespace BlackCore::Data
return m_lastVatsimServer.set(server);
}
CStatusMessage CNetworkSetup::setAutoLogoff(bool autoLogoff)
{
return m_autoLogoff.setAndSave(autoLogoff);
}
CServer CNetworkSetup::getLastServer() const
{
return m_lastServer.get();

View File

@@ -40,9 +40,6 @@ namespace BlackCore::Data
//! Set value of last VATSIM server
BlackMisc::CStatusMessage setLastVatsimServer(const BlackMisc::Network::CServer &server);
//! Save auto logoff
BlackMisc::CStatusMessage setAutoLogoff(bool autoLogoff);
//! Last server (all networks)
BlackMisc::Network::CServer getLastServer() const;
@@ -64,9 +61,6 @@ namespace BlackCore::Data
//! Used with an other server (i.e. non VATSIM)
bool wasLastUsedWithOtherServer() const;
//! Auto logoff?
bool useAutoLogoff() const { return m_autoLogoff.get(); }
signals:
//! Setup changed
void setupChanged();
@@ -76,7 +70,6 @@ namespace BlackCore::Data
void onSettingsChanged();
BlackMisc::CSettingReadOnly<BlackMisc::Network::Settings::TTrafficServers> m_otherTrafficNetworkServers { this, &CNetworkSetup::onSettingsChanged };
BlackMisc::CSetting<BlackMisc::Network::Settings::TAutoLogoff> m_autoLogoff { this, &CNetworkSetup::onSettingsChanged };
BlackMisc::CData<BlackMisc::Network::Data::TLastServer> m_lastServer { this, &CNetworkSetup::onSettingsChanged }; //!< recently used server (VATSIM, other)
BlackMisc::CData<BlackCore::Data::TVatsimLastServer> m_lastVatsimServer { this, &CNetworkSetup::onSettingsChanged }; //!< recently used VATSIM server
};

View File

@@ -85,13 +85,6 @@ namespace BlackGui::Components
// override details/voice
ui->comp_NetworkDetails->setAlwaysAllowOverride(true);
// auto logoff
// we decided to make it difficult for users to disable it
if (!CBuildConfig::isLocalDeveloperDebugBuild())
{
ui->cb_AutoLogoff->setChecked(true);
}
// Stored data
this->loadRememberedUserData();
@@ -105,17 +98,11 @@ namespace BlackGui::Components
// inital setup, if data already available
ui->form_Pilot->validate();
ui->cb_AutoLogoff->setChecked(m_networkSetup.useAutoLogoff());
}
CLoginAdvComponent::~CLoginAdvComponent()
{}
void CLoginAdvComponent::setAutoLogoff(bool autoLogoff)
{
ui->cb_AutoLogoff->setChecked(autoLogoff);
}
void CLoginAdvComponent::loginCancelled()
{
this->closeOverlay();
@@ -129,7 +116,6 @@ namespace BlackGui::Components
const bool isConnected = sGui && sGui->getIContextNetwork()->isConnected();
const bool vatsimLogin = ui->comp_NetworkDetails->isVatsimServerSelected();
m_networkSetup.setAutoLogoff(ui->cb_AutoLogoff->isChecked());
ui->form_Pilot->setVatsimValidation(vatsimLogin);
@@ -323,7 +309,6 @@ namespace BlackGui::Components
void CLoginAdvComponent::autoLogoffDetection()
{
if (!ui->cb_AutoLogoff->isChecked()) { return; }
if (!this->hasValidContexts()) { return; }
if (!sGui->getIContextNetwork()->isConnected()) { return; } // nothing to logoff
@@ -337,7 +322,6 @@ namespace BlackGui::Components
void CLoginAdvComponent::autoLogoffFrameRate(bool fatal)
{
//! \fixme code duplication with function above
if (!ui->cb_AutoLogoff->isChecked()) { return; }
if (!this->hasValidContexts()) { return; }
if (!sGui->getIContextNetwork()->isConnected()) { return; }

View File

@@ -60,9 +60,6 @@ namespace BlackGui::Components
//! Automatically popup
void setAutoPopupWizad(bool autoPopup);
//! Set auto logoff
void setAutoLogoff(bool autoLogoff);
//! Login requested
void toggleNetworkConnection();

View File

@@ -223,16 +223,6 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cb_AutoLogoff">
<property name="toolTip">
<string>automatically logoff when simulator changes or appears crashed</string>
</property>
<property name="text">
<string>auto logoff</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -266,7 +256,6 @@
</customwidgets>
<tabstops>
<tabstop>form_Pilot</tabstop>
<tabstop>cb_AutoLogoff</tabstop>
<tabstop>pb_Connect</tabstop>
<tabstop>pb_Cancel</tabstop>
</tabstops>

View File

@@ -161,7 +161,6 @@ namespace BlackGui::Components
// inital setup, if data already available
this->validateAircraftValues();
ui->form_Pilot->validate();
ui->cb_AutoLogoff->setChecked(m_networkSetup.useAutoLogoff());
this->onWebServiceDataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, -1, {});
this->reloadOtherServersSetup();
@@ -202,12 +201,6 @@ namespace BlackGui::Components
this->updateUiConnectState();
this->blinkConnectButton();
}
// we decided to make it difficult for users to disable it
if (!CBuildConfig::isLocalDeveloperDebugBuild())
{
ui->cb_AutoLogoff->setChecked(true);
}
}
void CLoginComponent::setLogoffCountdown(int timeoutSeconds)
@@ -235,7 +228,6 @@ namespace BlackGui::Components
m_networkConnected = sGui && sGui->getIContextNetwork()->isConnected();
const bool vatsimLogin = this->isVatsimNetworkTabSelected();
m_networkSetup.setAutoLogoff(ui->cb_AutoLogoff->isChecked());
ui->form_Pilot->setVatsimValidation(vatsimLogin);
this->updateUiConnectState();
@@ -691,7 +683,6 @@ namespace BlackGui::Components
void CLoginComponent::autoLogoffDetection()
{
if (!ui->cb_AutoLogoff->isChecked()) { return; }
if (!this->hasValidContexts()) { return; }
if (!sGui->getIContextNetwork()->isConnected()) { return; } // nothing to logoff
@@ -707,7 +698,6 @@ namespace BlackGui::Components
void CLoginComponent::autoLogoffFrameRate(bool fatal)
{
//! \fixme code duplication with function above
if (!ui->cb_AutoLogoff->isChecked()) { return; }
if (!this->hasValidContexts()) { return; }
if (!sGui->getIContextNetwork()->isConnected()) { return; }

View File

@@ -871,16 +871,6 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cb_AutoLogoff">
<property name="toolTip">
<string>automatically logoff when simulator changes or appears crashed</string>
</property>
<property name="text">
<string>auto logoff</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -965,7 +955,6 @@
<tabstop>le_LoginAsAircaft</tabstop>
<tabstop>le_LoginSince</tabstop>
<tabstop>tb_Timeout</tabstop>
<tabstop>cb_AutoLogoff</tabstop>
<tabstop>pb_Ok</tabstop>
<tabstop>pb_Cancel</tabstop>
<tabstop>comp_OtherServers</tabstop>

View File

@@ -35,12 +35,6 @@ namespace BlackGui::Components
CLoginDialog::~CLoginDialog()
{}
void CLoginDialog::setAutoLogoff(bool logoff)
{
ui->comp_LoginComponent->setAutoLogoff(logoff);
ui->comp_LoginOverviewComponent->setAutoLogoff(logoff);
}
void CLoginDialog::show()
{
this->init();

View File

@@ -30,9 +30,6 @@ namespace BlackGui::Components
//! Destructor
virtual ~CLoginDialog() override;
//! Set auto logoff
void setAutoLogoff(bool logoff);
//! Init and show
void show();

View File

@@ -84,26 +84,13 @@ namespace BlackGui::Components
ui->form_Pilot->setReadOnly(true);
ui->form_Server->setReadOnly(true);
// auto logoff
// we decided to make it difficult for users to disable it
if (!CBuildConfig::isLocalDeveloperDebugBuild())
{
ui->cb_AutoLogoff->setChecked(true);
}
// inital setup, if data already available
ui->form_Pilot->validate();
ui->cb_AutoLogoff->setChecked(m_networkSetup.useAutoLogoff());
}
CLoginOverviewComponent::~CLoginOverviewComponent()
{}
void CLoginOverviewComponent::setAutoLogoff(bool autoLogoff)
{
ui->cb_AutoLogoff->setChecked(autoLogoff);
}
void CLoginOverviewComponent::cancel()
{
this->closeOverlay();
@@ -116,7 +103,6 @@ namespace BlackGui::Components
if (!sGui->getIContextNetwork() || !sGui->getIContextAudio()) { return; }
const bool isConnected = sGui && sGui->getIContextNetwork()->isConnected();
m_networkSetup.setAutoLogoff(ui->cb_AutoLogoff->isChecked());
CStatusMessage msg;
if (!isConnected)

View File

@@ -55,9 +55,6 @@ namespace BlackGui::Components
//! Destructor
virtual ~CLoginOverviewComponent() override;
//! Set auto logoff
void setAutoLogoff(bool autoLogoff);
//! Login requested
void toggleNetworkConnection();

View File

@@ -272,16 +272,6 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cb_AutoLogoff">
<property name="toolTip">
<string>automatically logoff when simulator changes or appears crashed</string>
</property>
<property name="text">
<string>auto logoff</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -317,7 +307,6 @@
<tabstop>le_LoginMode</tabstop>
<tabstop>le_PartnerCallsign</tabstop>
<tabstop>gb_OwnAircraft</tabstop>
<tabstop>cb_AutoLogoff</tabstop>
<tabstop>pb_Disconnect</tabstop>
<tabstop>pb_Cancel</tabstop>
</tabstops>

View File

@@ -50,22 +50,6 @@ namespace BlackMisc::Network::Settings
return dv;
}
};
/*!
* Auto logoff
*/
struct TAutoLogoff : public TSettingTrait<bool>
{
//! \copydoc BlackMisc::TSettingTrait::key
static const char *key() { return "network/autologoff"; }
//! \copydoc BlackMisc::TSettingTrait::humanReadable
static const QString &humanReadable()
{
static const QString name("Auto logoff");
return name;
}
};
} // ns
#endif

View File

@@ -250,10 +250,6 @@ void SwiftGuiStd::loginRequested()
{
if (!m_loginDialog) { m_loginDialog.reset(new CLoginDialog(this)); }
connect(m_loginDialog.data(), &CLoginDialog::requestNetworkSettings, this, &SwiftGuiStd::displayNetworkSettings);
if (!CBuildConfig::isLocalDeveloperDebugBuild())
{
m_loginDialog->setAutoLogoff(true);
}
m_loginDialog->show();
}
else