mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Ref T420, setting to save "auto logoff"
* added flag in settings * use in login component
This commit is contained in:
@@ -32,6 +32,11 @@ namespace BlackCore
|
||||
return m_lastVatsimServer.set(server);
|
||||
}
|
||||
|
||||
CStatusMessage CNetworkSetup::setAutoLogoff(bool autoLogoff)
|
||||
{
|
||||
return m_autoLogoff.setAndSave(autoLogoff);
|
||||
}
|
||||
|
||||
CServer CNetworkSetup::getLastServer() const
|
||||
{
|
||||
return m_lastServer.get();
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "blackmisc/network/data/lastserver.h"
|
||||
#include "blackmisc/network/settings/serversettings.h"
|
||||
#include "blackmisc/network/serverlist.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/metaclass.h"
|
||||
|
||||
@@ -47,6 +48,9 @@ namespace BlackCore
|
||||
//! 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;
|
||||
|
||||
@@ -68,6 +72,9 @@ namespace BlackCore
|
||||
//! 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();
|
||||
@@ -77,6 +84,7 @@ namespace BlackCore
|
||||
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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user