add configuration menu "other settings" and add "save metadata on exit" option, which users can use to speed up exit - fixes #35

This commit is contained in:
Jools Wills 2016-03-26 01:57:05 +00:00
parent e65a1ee80a
commit 26f4850eaf
3 changed files with 15 additions and 1 deletions

View file

@ -55,7 +55,7 @@ SystemData::SystemData(const std::string& name, const std::string& fullName, con
SystemData::~SystemData()
{
//save changed game data back to xml
if(!Settings::getInstance()->getBool("IgnoreGamelist"))
if(!Settings::getInstance()->getBool("IgnoreGamelist") && Settings::getInstance()->getBool("SaveGamelistsOnExit"))
{
updateGamelist(this);
}

View file

@ -165,6 +165,19 @@ GuiMenu::GuiMenu(Window* window) : GuiComponent(window), mMenu(window, "MAIN MEN
mWindow->pushGui(s);
});
addEntry("OTHER SETTINGS", 0x777777FF, true,
[this] {
auto s = new GuiSettings(mWindow, "OTHER SETTINGS");
// gamelists
auto save_gamelists = std::make_shared<SwitchComponent>(mWindow);
save_gamelists->setState(Settings::getInstance()->getBool("SaveGamelistsOnExit"));
s->addWithLabel("SAVE METADATA ON EXIT", save_gamelists);
s->addSaveFunc([save_gamelists] { Settings::getInstance()->setBool("SaveGamelistsOnExit", save_gamelists->getState()); });
mWindow->pushGui(s);
});
addEntry("CONFIGURE INPUT", 0x777777FF, true,
[this] {
mWindow->pushGui(new GuiDetectDevice(mWindow, false, nullptr));

View file

@ -59,6 +59,7 @@ void Settings::setDefaults()
mBoolMap["IgnoreGamelist"] = false;
mBoolMap["HideConsole"] = true;
mBoolMap["QuickSystemSelect"] = true;
mBoolMap["SaveGamelistsOnExit"] = true;
mBoolMap["Debug"] = false;
mBoolMap["DebugGrid"] = false;