Ref T659, improved handling of override checkbox in FSD details/voice

* the checkbox can be always enabled
* or disabled in read only mode
This commit is contained in:
Klaus Basan
2019-08-06 20:09:00 +02:00
committed by Mat Sutcliffe
parent 4e9bf35cfc
commit d546ebdcba
7 changed files with 60 additions and 3 deletions

View File

@@ -61,6 +61,16 @@ namespace BlackGui
ui->cb_Override->setChecked(enabled);
}
void CVoiceSetupForm::setAlwaysAllowOverride(bool allow)
{
m_alwaysAllowOverride = allow;
if (allow)
{
ui->cb_Override->setEnabled(true);
CGuiUtility::checkBoxReadOnly(ui->cb_Override, false);
}
}
void CVoiceSetupForm::showEnableInfo(bool visible)
{
m_visibleEnableInfo = visible;
@@ -71,10 +81,21 @@ namespace BlackGui
{
ui->pb_SetDefaults->setEnabled(!readonly);
ui->le_VatsimUdpPort->setReadOnly(readonly);
CGuiUtility::checkBoxesReadOnly(this, readonly);
if (m_alwaysAllowOverride)
{
ui->cb_Override->setEnabled(true);
CGuiUtility::checkBoxReadOnly(ui->cb_Override, false);
}
/**
if (readonly && ui->cb_Override->isChecked())
{
// this is no value which will be stored
ui->cb_Override->setChecked(false);
}
**/
this->forceStyleSheetUpdate();
}