feature: added isAvailable flag support (#1032)

* feature: added isAvailable flag support
* added the option to switch to dev env
This commit is contained in:
Nethius 2024-09-09 16:27:29 +04:00 committed by GitHub
parent 175477d31f
commit 918be16372
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 100 additions and 21 deletions

View file

@ -283,7 +283,24 @@ void SettingsController::setGatewayEndpoint(const QString &endpoint)
QString SettingsController::getGatewayEndpoint()
{
return m_settings->getGatewayEndpoint();
return m_settings->isDevGatewayEnv() ? "Dev endpoint" : m_settings->getGatewayEndpoint();
}
bool SettingsController::isDevGatewayEnv()
{
return m_settings->isDevGatewayEnv();
}
void SettingsController::toggleDevGatewayEnv(bool enabled)
{
m_settings->toggleDevGatewayEnv(enabled);
if (enabled) {
m_settings->setDevGatewayEndpoint();
} else {
m_settings->resetGatewayEndpoint();
}
emit gatewayEndpointChanged(m_settings->getGatewayEndpoint());
emit devGatewayEnvChanged(enabled);
}
bool SettingsController::isOnTv()