GUI: Add a tab for backend-specific options
This commit is contained in:
parent
c80e1c6b49
commit
11724f9df1
25 changed files with 279 additions and 5 deletions
|
@ -168,6 +168,7 @@ void OptionsDialog::init() {
|
|||
_joystickDeadzoneSlider = nullptr;
|
||||
_joystickDeadzoneLabel = nullptr;
|
||||
_keymapperWidget = nullptr;
|
||||
_backendOptions = nullptr;
|
||||
_enableGraphicSettings = false;
|
||||
_gfxPopUp = nullptr;
|
||||
_gfxPopUpDesc = nullptr;
|
||||
|
@ -285,6 +286,11 @@ void OptionsDialog::build() {
|
|||
_keymapperWidget->load();
|
||||
}
|
||||
|
||||
// Backend options
|
||||
if (_backendOptions) {
|
||||
_backendOptions->load();
|
||||
}
|
||||
|
||||
// Graphic options
|
||||
if (_fullscreenCheckbox) {
|
||||
_gfxPopUp->setSelected(0);
|
||||
|
@ -710,6 +716,12 @@ void OptionsDialog::apply() {
|
|||
}
|
||||
}
|
||||
|
||||
if (_backendOptions) {
|
||||
bool changes = _backendOptions->save();
|
||||
if (changes && _domain == Common::ConfigManager::kApplicationDomain)
|
||||
g_system->applyBackendSettings();
|
||||
}
|
||||
|
||||
// Control options
|
||||
if (_enableControlSettings) {
|
||||
if (g_system->hasFeature(OSystem::kFeatureOnScreenControl)) {
|
||||
|
@ -1815,6 +1827,20 @@ void GlobalOptionsDialog::build() {
|
|||
addKeyMapperControls(tab, "GlobalOptions_KeyMapper.", keymaps, Common::ConfigManager::kKeymapperDomain);
|
||||
}
|
||||
|
||||
//
|
||||
// The backend tab (shown only if the backend implements one)
|
||||
//
|
||||
int backendTabId = tab->addTab(_("Backend"), "GlobalOptions_Backend");
|
||||
|
||||
g_system->registerDefaultSettings(_domain);
|
||||
_backendOptions = g_system->buildBackendOptionsWidget(tab, "GlobalOptions_Backend.Container", _domain);
|
||||
|
||||
if (_backendOptions) {
|
||||
_backendOptions->setParentDialog(this);
|
||||
} else {
|
||||
tab->removeTab(backendTabId);
|
||||
}
|
||||
|
||||
//
|
||||
// 2) The audio tab
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue