mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
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:
committed by
Mat Sutcliffe
parent
d6f8da0f1f
commit
2b0fa22135
@@ -101,9 +101,11 @@ namespace BlackGui
|
|||||||
|
|
||||||
ui->form_FsdDetails->showEnableInfo(true);
|
ui->form_FsdDetails->showEnableInfo(true);
|
||||||
ui->form_FsdDetails->setFsdSetupEnabled(false);
|
ui->form_FsdDetails->setFsdSetupEnabled(false);
|
||||||
|
ui->form_FsdDetails->setAlwaysAllowOverride(true);
|
||||||
|
|
||||||
ui->form_Voice->showEnableInfo(true);
|
ui->form_Voice->showEnableInfo(true);
|
||||||
ui->form_Voice->setVoiceSetupEnabled(false);
|
ui->form_Voice->setVoiceSetupEnabled(false);
|
||||||
|
ui->form_Voice->setAlwaysAllowOverride(true);
|
||||||
|
|
||||||
ui->lblp_AircraftCombinedType->setToolTips("ok", "wrong");
|
ui->lblp_AircraftCombinedType->setToolTips("ok", "wrong");
|
||||||
ui->lblp_AirlineIcao->setToolTips("ok", "wrong");
|
ui->lblp_AirlineIcao->setToolTips("ok", "wrong");
|
||||||
|
|||||||
@@ -65,6 +65,16 @@ namespace BlackGui
|
|||||||
ui->cb_3LetterAirlineICAO->setChecked(setup.force3LetterAirlineCodes());
|
ui->cb_3LetterAirlineICAO->setChecked(setup.force3LetterAirlineCodes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CFsdSetupForm::setAlwaysAllowOverride(bool allow)
|
||||||
|
{
|
||||||
|
m_alwaysAllowOverride = allow;
|
||||||
|
if (allow)
|
||||||
|
{
|
||||||
|
ui->cb_Override->setEnabled(true);
|
||||||
|
CGuiUtility::checkBoxReadOnly(ui->cb_Override, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool CFsdSetupForm::isFsdSetupEnabled() const
|
bool CFsdSetupForm::isFsdSetupEnabled() const
|
||||||
{
|
{
|
||||||
return ui->cb_Override->isChecked();
|
return ui->cb_Override->isChecked();
|
||||||
@@ -86,12 +96,20 @@ namespace BlackGui
|
|||||||
ui->le_TextCodec->setReadOnly(readonly);
|
ui->le_TextCodec->setReadOnly(readonly);
|
||||||
ui->pb_SetDefaults->setEnabled(!readonly);
|
ui->pb_SetDefaults->setEnabled(!readonly);
|
||||||
CGuiUtility::checkBoxesReadOnly(this, readonly);
|
CGuiUtility::checkBoxesReadOnly(this, readonly);
|
||||||
CGuiUtility::checkBoxReadOnly(ui->cb_Override, false); // always editable
|
if (m_alwaysAllowOverride)
|
||||||
|
{
|
||||||
|
ui->cb_Override->setEnabled(true);
|
||||||
|
CGuiUtility::checkBoxReadOnly(ui->cb_Override, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
if (readonly && ui->cb_Override->isChecked())
|
if (readonly && ui->cb_Override->isChecked())
|
||||||
{
|
{
|
||||||
|
// this is no value which will be stored
|
||||||
ui->cb_Override->setChecked(false);
|
ui->cb_Override->setChecked(false);
|
||||||
}
|
}
|
||||||
|
**/
|
||||||
|
|
||||||
this->forceStyleSheetUpdate();
|
this->forceStyleSheetUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ namespace BlackGui
|
|||||||
//! Set to GUI
|
//! Set to GUI
|
||||||
void setValue(const BlackMisc::Network::CFsdSetup &setup);
|
void setValue(const BlackMisc::Network::CFsdSetup &setup);
|
||||||
|
|
||||||
|
//! Allow override even in read only mode
|
||||||
|
void setAlwaysAllowOverride(bool allow);
|
||||||
|
|
||||||
//! Enabled?
|
//! Enabled?
|
||||||
bool isFsdSetupEnabled() const;
|
bool isFsdSetupEnabled() const;
|
||||||
|
|
||||||
@@ -70,7 +73,8 @@ namespace BlackGui
|
|||||||
void visibleEnableInfo(bool visible);
|
void visibleEnableInfo(bool visible);
|
||||||
|
|
||||||
QScopedPointer<Ui::CFsdSetupForm> ui;
|
QScopedPointer<Ui::CFsdSetupForm> ui;
|
||||||
bool m_visibleEnableInfo = true;
|
bool m_visibleEnableInfo = true;
|
||||||
|
bool m_alwaysAllowOverride = false;
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -84,6 +84,11 @@ namespace BlackGui
|
|||||||
return ui->cb_ServerType->currentData().value<CServer::ServerType>();
|
return ui->cb_ServerType->currentData().value<CServer::ServerType>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CServerForm::resetToFirstTab()
|
||||||
|
{
|
||||||
|
ui->tw_ServerForm->setCurrentIndex(0);
|
||||||
|
}
|
||||||
|
|
||||||
void CServerForm::setReadOnly(bool readOnly)
|
void CServerForm::setReadOnly(bool readOnly)
|
||||||
{
|
{
|
||||||
ui->form_ServerFsd->setReadOnly(readOnly);
|
ui->form_ServerFsd->setReadOnly(readOnly);
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ namespace BlackGui
|
|||||||
//! Get currently selected server type
|
//! Get currently selected server type
|
||||||
BlackMisc::Network::CServer::ServerType getServerType() const;
|
BlackMisc::Network::CServer::ServerType getServerType() const;
|
||||||
|
|
||||||
|
//! Reset to 1st tab
|
||||||
|
void resetToFirstTab();
|
||||||
|
|
||||||
//! \name Form class implementations
|
//! \name Form class implementations
|
||||||
//! @{
|
//! @{
|
||||||
virtual void setReadOnly(bool readonly) override;
|
virtual void setReadOnly(bool readonly) override;
|
||||||
|
|||||||
@@ -61,6 +61,16 @@ namespace BlackGui
|
|||||||
ui->cb_Override->setChecked(enabled);
|
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)
|
void CVoiceSetupForm::showEnableInfo(bool visible)
|
||||||
{
|
{
|
||||||
m_visibleEnableInfo = visible;
|
m_visibleEnableInfo = visible;
|
||||||
@@ -71,10 +81,21 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
ui->pb_SetDefaults->setEnabled(!readonly);
|
ui->pb_SetDefaults->setEnabled(!readonly);
|
||||||
ui->le_VatsimUdpPort->setReadOnly(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())
|
if (readonly && ui->cb_Override->isChecked())
|
||||||
{
|
{
|
||||||
|
// this is no value which will be stored
|
||||||
ui->cb_Override->setChecked(false);
|
ui->cb_Override->setChecked(false);
|
||||||
}
|
}
|
||||||
|
**/
|
||||||
|
|
||||||
this->forceStyleSheetUpdate();
|
this->forceStyleSheetUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ namespace BlackGui
|
|||||||
//! Set enabled / disabled
|
//! Set enabled / disabled
|
||||||
void setVoiceSetupEnabled(bool enabled);
|
void setVoiceSetupEnabled(bool enabled);
|
||||||
|
|
||||||
|
//! Allow override even in read only mode
|
||||||
|
void setAlwaysAllowOverride(bool allow);
|
||||||
|
|
||||||
//! Show the enable info
|
//! Show the enable info
|
||||||
void showEnableInfo(bool visible);
|
void showEnableInfo(bool visible);
|
||||||
|
|
||||||
@@ -69,7 +72,8 @@ namespace BlackGui
|
|||||||
void visibleEnableInfo(bool visible);
|
void visibleEnableInfo(bool visible);
|
||||||
|
|
||||||
QScopedPointer<Ui::CVoiceSetupForm> ui;
|
QScopedPointer<Ui::CVoiceSetupForm> ui;
|
||||||
bool m_visibleEnableInfo = true;
|
bool m_alwaysAllowOverride = false;
|
||||||
|
bool m_visibleEnableInfo = true;
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
Reference in New Issue
Block a user