Ref T659, display server name on details tab and allow to reset state for details component

This commit is contained in:
Klaus Basan
2019-08-06 20:10:04 +02:00
committed by Mat Sutcliffe
parent d546ebdcba
commit 23a44ced2a
3 changed files with 32 additions and 1 deletions

View File

@@ -52,8 +52,10 @@ namespace BlackGui
ui->form_FsdDetails->showEnableInfo(true);
ui->form_FsdDetails->setFsdSetupEnabled(false);
ui->form_FsdDetails->setReadOnly(false);
ui->form_Voice->showEnableInfo(true);
ui->form_Voice->setVoiceSetupEnabled(false);
ui->form_Voice->setReadOnly(false);
constexpr int MaxLength = 10;
constexpr int MinLength = 0;
@@ -82,6 +84,12 @@ namespace BlackGui
ui->frp_LoginMode->setLoginMode(mode);
}
void CNetworkDetailsComponent::resetState()
{
ui->sw_NetworkServerDetails->setCurrentIndex(PageServer);
this->setBackTabName();
}
bool CNetworkDetailsComponent::isVatsimServerSelected() const
{
const bool vatsim = ui->tw_Network->currentWidget() == ui->tb_NetworkVatsim;
@@ -108,6 +116,12 @@ namespace BlackGui
return ui->form_FsdDetails->getValue();
}
void CNetworkDetailsComponent::setAlwaysAllowOverride(bool allow)
{
ui->form_FsdDetails->setAlwaysAllowOverride(allow);
ui->form_Voice->setAlwaysAllowOverride(allow);
}
bool CNetworkDetailsComponent::isFsdSetupOverrideEnabled() const
{
return ui->form_FsdDetails->isFsdSetupEnabled();
@@ -197,6 +211,14 @@ namespace BlackGui
{
ui->sw_NetworkServerDetails->setCurrentIndex(PageServer);
}
this->setBackTabName();
}
void CNetworkDetailsComponent::setBackTabName()
{
const QString name = this->getCurrentServer().getName();
const int index = ui->tw_Details->indexOf(ui->tb_BackToServer);
ui->tw_Details->setTabText(index, QStringLiteral("Back to server '%1'").arg(name));
}
CServer CNetworkDetailsComponent::getCurrentVatsimServer() const