Port some settings to the new config system

Other than the controller settings and JIT debug settings,
these are the only settings which were defined in Java code
but not defined in the new config system in C++. (There are
still a lot of settings that are defined in the new config
system but not yet saveable in the new config system, though.)
This commit is contained in:
JosJuice
2020-07-20 11:22:53 +02:00
parent 25ebc3c07c
commit b0f9bb9f13
15 changed files with 68 additions and 68 deletions

View File

@ -8,7 +8,9 @@
#include <QDirIterator>
#include <QFile>
#include "Core/ConfigManager.h"
#include "Common/Config/Config.h"
#include "Core/Config/UISettings.h"
#include "DiscIO/DirectoryBlob.h"
@ -224,7 +226,7 @@ void GameTracker::AddDirectoryInternal(const QString& dir)
static std::unique_ptr<QDirIterator> GetIterator(const QString& dir)
{
return std::make_unique<QDirIterator>(dir, game_filters, QDir::NoFilter,
SConfig::GetInstance().m_RecursiveISOFolder ?
Config::Get(Config::MAIN_RECURSIVE_ISO_PATHS) ?
QDirIterator::Subdirectories :
QDirIterator::NoIteratorFlags);
}

View File

@ -14,12 +14,13 @@
#include <QPushButton>
#include <QWidget>
#include "Common/Config/Config.h"
#include "Common/MsgHandler.h"
#include "Common/ScopeGuard.h"
#include "Core/Analytics.h"
#include "Core/Boot/Boot.h"
#include "Core/ConfigManager.h"
#include "Core/Config/MainSettings.h"
#include "Core/Core.h"
#include "DolphinQt/Host.h"
@ -219,7 +220,7 @@ int main(int argc, char* argv[])
win.Show();
#if defined(USE_ANALYTICS) && USE_ANALYTICS
if (!SConfig::GetInstance().m_analytics_permission_asked)
if (!Config::Get(Config::MAIN_ANALYTICS_PERMISSION_ASKED))
{
ModalMessageBox analytics_prompt(&win);
@ -241,7 +242,7 @@ int main(int argc, char* argv[])
const int answer = analytics_prompt.exec();
SConfig::GetInstance().m_analytics_permission_asked = true;
Config::SetBase(Config::MAIN_ANALYTICS_PERMISSION_ASKED, true);
Settings::Instance().SetAnalyticsEnabled(answer == QMessageBox::Yes);
DolphinAnalytics::Instance().ReloadConfig();

View File

@ -515,14 +515,14 @@ void Settings::SetAnalyticsEnabled(bool enabled)
if (enabled == IsAnalyticsEnabled())
return;
SConfig::GetInstance().m_analytics_enabled = enabled;
Config::SetBase(Config::MAIN_ANALYTICS_PERMISSION_ASKED, enabled);
emit AnalyticsToggled(enabled);
}
bool Settings::IsAnalyticsEnabled() const
{
return SConfig::GetInstance().m_analytics_enabled;
return Config::Get(Config::MAIN_ANALYTICS_PERMISSION_ASKED);
}
void Settings::SetToolBarVisible(bool visible)

View File

@ -19,6 +19,7 @@
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "Core/Config/MainSettings.h"
#include "Core/Config/UISettings.h"
#include "Core/ConfigManager.h"
@ -229,8 +230,8 @@ void InterfacePane::LoadConfig()
// Render Window Options
m_checkbox_top_window->setChecked(Settings::Instance().IsKeepWindowOnTopEnabled());
m_checkbox_confirm_on_stop->setChecked(startup_params.bConfirmStop);
m_checkbox_use_panic_handlers->setChecked(startup_params.bUsePanicHandlers);
m_checkbox_enable_osd->setChecked(startup_params.bOnScreenDisplayMessages);
m_checkbox_use_panic_handlers->setChecked(Config::Get(Config::MAIN_USE_PANIC_HANDLERS));
m_checkbox_enable_osd->setChecked(Config::Get(Config::MAIN_OSD_MESSAGES));
m_checkbox_show_active_title->setChecked(startup_params.m_show_active_title);
m_checkbox_pause_on_focus_lost->setChecked(startup_params.m_PauseOnFocusLost);
m_checkbox_use_covers->setChecked(Config::Get(Config::MAIN_USE_GAME_COVERS));
@ -254,12 +255,12 @@ void InterfacePane::OnSaveConfig()
// Render Window Options
Settings::Instance().SetKeepWindowOnTop(m_checkbox_top_window->isChecked());
settings.bConfirmStop = m_checkbox_confirm_on_stop->isChecked();
settings.bUsePanicHandlers = m_checkbox_use_panic_handlers->isChecked();
settings.bOnScreenDisplayMessages = m_checkbox_enable_osd->isChecked();
Config::SetBase(Config::MAIN_USE_PANIC_HANDLERS, m_checkbox_use_panic_handlers->isChecked());
Config::SetBase(Config::MAIN_OSD_MESSAGES, m_checkbox_enable_osd->isChecked());
settings.m_show_active_title = m_checkbox_show_active_title->isChecked();
settings.m_PauseOnFocusLost = m_checkbox_pause_on_focus_lost->isChecked();
Common::SetEnableAlert(settings.bUsePanicHandlers);
Common::SetEnableAlert(Config::Get(Config::MAIN_USE_PANIC_HANDLERS));
auto new_language = m_combobox_language->currentData().toString().toStdString();
if (new_language != SConfig::GetInstance().m_InterfaceLanguage)

View File

@ -16,7 +16,7 @@
#include "Common/FileUtil.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h"
#include "Core/Config/UISettings.h"
#include "DolphinQt/Settings.h"
#include "DolphinQt/Settings/PathPane.h"
@ -148,7 +148,7 @@ QGroupBox* PathPane::MakeGameFolderBox()
m_remove_path->setEnabled(false);
auto* recursive_checkbox = new QCheckBox(tr("Search Subfolders"));
recursive_checkbox->setChecked(SConfig::GetInstance().m_RecursiveISOFolder);
recursive_checkbox->setChecked(Config::Get(Config::MAIN_RECURSIVE_ISO_PATHS));
auto* auto_checkbox = new QCheckBox(tr("Check for Game List Changes in the Background"));
auto_checkbox->setChecked(Settings::Instance().IsAutoRefreshEnabled());
@ -160,7 +160,7 @@ QGroupBox* PathPane::MakeGameFolderBox()
vlayout->addWidget(auto_checkbox);
connect(recursive_checkbox, &QCheckBox::toggled, [](bool checked) {
SConfig::GetInstance().m_RecursiveISOFolder = checked;
Config::SetBase(Config::MAIN_RECURSIVE_ISO_PATHS, checked);
Settings::Instance().RefreshGameList();
});