GUI: Allow user to opt between GUI browser and native browser

This commit is contained in:
SupSuper 2018-11-22 16:26:04 +00:00 committed by Thierry Crozat
parent 7bff9176d5
commit fc504996d3
2 changed files with 6 additions and 3 deletions

View file

@ -284,6 +284,7 @@ void registerDefaults() {
ConfMan.registerDefault("gui_saveload_last_pos", "0"); ConfMan.registerDefault("gui_saveload_last_pos", "0");
ConfMan.registerDefault("gui_browser_show_hidden", false); ConfMan.registerDefault("gui_browser_show_hidden", false);
ConfMan.registerDefault("gui_browser_native", true);
ConfMan.registerDefault("game", ""); ConfMan.registerDefault("game", "");
#ifdef USE_FLUIDSYNTH #ifdef USE_FLUIDSYNTH

View file

@ -88,11 +88,13 @@ int BrowserDialog::runModal() {
// Try to use the backend browser // Try to use the backend browser
Common::DialogManager *dialogManager = g_system->getDialogManager(); Common::DialogManager *dialogManager = g_system->getDialogManager();
if (dialogManager) { if (dialogManager) {
if (ConfMan.getBool("gui_browser_native", Common::ConfigManager::kApplicationDomain)) {
Common::DialogManager::DialogResult result = dialogManager->showFileBrowser(_title, _choice, _isDirBrowser); Common::DialogManager::DialogResult result = dialogManager->showFileBrowser(_title, _choice, _isDirBrowser);
if (result != Common::DialogManager::kDialogError) { if (result != Common::DialogManager::kDialogError) {
return result; return result;
} }
} }
}
#endif #endif
// If all else fails, use the GUI browser // If all else fails, use the GUI browser
return Dialog::runModal(); return Dialog::runModal();