|
|
|
|
@@ -15,24 +15,24 @@
|
|
|
|
|
#include "network/network.h"
|
|
|
|
|
#include "network/network_settings.h"
|
|
|
|
|
|
|
|
|
|
Config::Config(const std::string& config_name, ConfigType config_type) : type{config_type} {
|
|
|
|
|
QtConfig::QtConfig(const std::string& config_name, ConfigType config_type) : type{config_type} {
|
|
|
|
|
global = config_type == ConfigType::GlobalConfig;
|
|
|
|
|
Initialize(config_name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Config::~Config() {
|
|
|
|
|
QtConfig::~QtConfig() {
|
|
|
|
|
if (global) {
|
|
|
|
|
Save();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const std::array<int, Settings::NativeButton::NumButtons> Config::default_buttons = {
|
|
|
|
|
const std::array<int, Settings::NativeButton::NumButtons> QtConfig::default_buttons = {
|
|
|
|
|
Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_T, Qt::Key_G,
|
|
|
|
|
Qt::Key_F, Qt::Key_H, Qt::Key_Q, Qt::Key_W, Qt::Key_M, Qt::Key_N,
|
|
|
|
|
Qt::Key_O, Qt::Key_P, Qt::Key_1, Qt::Key_2, Qt::Key_B, Qt::Key_V,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> Config::default_analogs{{
|
|
|
|
|
const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> QtConfig::default_analogs{{
|
|
|
|
|
{
|
|
|
|
|
Qt::Key_Up,
|
|
|
|
|
Qt::Key_Down,
|
|
|
|
|
@@ -54,7 +54,7 @@ const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> Config:
|
|
|
|
|
// This must be in alphabetical order according to action name as it must have the same order as
|
|
|
|
|
// UISetting::values.shortcuts, which is alphabetically ordered.
|
|
|
|
|
// clang-format off
|
|
|
|
|
const std::array<UISettings::Shortcut, 35> Config::default_hotkeys {{
|
|
|
|
|
const std::array<UISettings::Shortcut, 35> QtConfig::default_hotkeys {{
|
|
|
|
|
{QStringLiteral("Advance Frame"), QStringLiteral("Main Window"), {QStringLiteral(""), Qt::ApplicationShortcut}},
|
|
|
|
|
{QStringLiteral("Audio Mute/Unmute"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+M"), Qt::WindowShortcut}},
|
|
|
|
|
{QStringLiteral("Audio Volume Down"), QStringLiteral("Main Window"), {QStringLiteral(""), Qt::WindowShortcut}},
|
|
|
|
|
@@ -93,7 +93,7 @@ const std::array<UISettings::Shortcut, 35> Config::default_hotkeys {{
|
|
|
|
|
}};
|
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
|
|
void Config::Initialize(const std::string& config_name) {
|
|
|
|
|
void QtConfig::Initialize(const std::string& config_name) {
|
|
|
|
|
const std::string fs_config_loc = FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir);
|
|
|
|
|
const std::string config_file = fmt::format("{}.ini", config_name);
|
|
|
|
|
|
|
|
|
|
@@ -120,7 +120,7 @@ void Config::Initialize(const std::string& config_name) {
|
|
|
|
|
// Explicit std::string definition: Qt can't implicitly convert a std::string to a QVariant, nor
|
|
|
|
|
// can it implicitly convert a QVariant back to a {std::,Q}string
|
|
|
|
|
template <>
|
|
|
|
|
void Config::ReadBasicSetting(Settings::Setting<std::string>& setting) {
|
|
|
|
|
void QtConfig::ReadBasicSetting(Settings::Setting<std::string>& setting) {
|
|
|
|
|
const QString name = QString::fromStdString(setting.GetLabel());
|
|
|
|
|
const auto default_value = QString::fromStdString(setting.GetDefault());
|
|
|
|
|
if (qt_config->value(name + QStringLiteral("/default"), false).toBool()) {
|
|
|
|
|
@@ -131,7 +131,7 @@ void Config::ReadBasicSetting(Settings::Setting<std::string>& setting) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename Type, bool ranged>
|
|
|
|
|
void Config::ReadBasicSetting(Settings::Setting<Type, ranged>& setting) {
|
|
|
|
|
void QtConfig::ReadBasicSetting(Settings::Setting<Type, ranged>& setting) {
|
|
|
|
|
const QString name = QString::fromStdString(setting.GetLabel());
|
|
|
|
|
const Type default_value = setting.GetDefault();
|
|
|
|
|
if (qt_config->value(name + QStringLiteral("/default"), false).toBool()) {
|
|
|
|
|
@@ -150,7 +150,7 @@ void Config::ReadBasicSetting(Settings::Setting<Type, ranged>& setting) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename Type, bool ranged>
|
|
|
|
|
void Config::ReadGlobalSetting(Settings::SwitchableSetting<Type, ranged>& setting) {
|
|
|
|
|
void QtConfig::ReadGlobalSetting(Settings::SwitchableSetting<Type, ranged>& setting) {
|
|
|
|
|
QString name = QString::fromStdString(setting.GetLabel());
|
|
|
|
|
const bool use_global = qt_config->value(name + QStringLiteral("/use_global"), true).toBool();
|
|
|
|
|
setting.SetGlobal(use_global);
|
|
|
|
|
@@ -168,7 +168,7 @@ void Config::ReadGlobalSetting(Settings::SwitchableSetting<Type, ranged>& settin
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
void Config::ReadGlobalSetting(Settings::SwitchableSetting<std::string>& setting) {
|
|
|
|
|
void QtConfig::ReadGlobalSetting(Settings::SwitchableSetting<std::string>& setting) {
|
|
|
|
|
QString name = QString::fromStdString(setting.GetLabel());
|
|
|
|
|
const bool use_global = qt_config->value(name + QStringLiteral("/use_global"), true).toBool();
|
|
|
|
|
setting.SetGlobal(use_global);
|
|
|
|
|
@@ -181,7 +181,7 @@ void Config::ReadGlobalSetting(Settings::SwitchableSetting<std::string>& setting
|
|
|
|
|
|
|
|
|
|
// Explicit std::string definition: Qt can't implicitly convert a std::string to a QVariant
|
|
|
|
|
template <>
|
|
|
|
|
void Config::WriteBasicSetting(const Settings::Setting<std::string>& setting) {
|
|
|
|
|
void QtConfig::WriteBasicSetting(const Settings::Setting<std::string>& setting) {
|
|
|
|
|
const QString name = QString::fromStdString(setting.GetLabel());
|
|
|
|
|
const std::string& value = setting.GetValue();
|
|
|
|
|
qt_config->setValue(name + QStringLiteral("/default"), value == setting.GetDefault());
|
|
|
|
|
@@ -190,7 +190,7 @@ void Config::WriteBasicSetting(const Settings::Setting<std::string>& setting) {
|
|
|
|
|
|
|
|
|
|
// Explicit u16 definition: Qt would store it as QMetaType otherwise, which is not human-readable
|
|
|
|
|
template <>
|
|
|
|
|
void Config::WriteBasicSetting(const Settings::Setting<u16>& setting) {
|
|
|
|
|
void QtConfig::WriteBasicSetting(const Settings::Setting<u16>& setting) {
|
|
|
|
|
const QString name = QString::fromStdString(setting.GetLabel());
|
|
|
|
|
const u16& value = setting.GetValue();
|
|
|
|
|
qt_config->setValue(name + QStringLiteral("/default"), value == setting.GetDefault());
|
|
|
|
|
@@ -198,7 +198,7 @@ void Config::WriteBasicSetting(const Settings::Setting<u16>& setting) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename Type, bool ranged>
|
|
|
|
|
void Config::WriteBasicSetting(const Settings::Setting<Type, ranged>& setting) {
|
|
|
|
|
void QtConfig::WriteBasicSetting(const Settings::Setting<Type, ranged>& setting) {
|
|
|
|
|
const QString name = QString::fromStdString(setting.GetLabel());
|
|
|
|
|
const Type value = setting.GetValue();
|
|
|
|
|
qt_config->setValue(name + QStringLiteral("/default"), value == setting.GetDefault());
|
|
|
|
|
@@ -210,7 +210,7 @@ void Config::WriteBasicSetting(const Settings::Setting<Type, ranged>& setting) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename Type, bool ranged>
|
|
|
|
|
void Config::WriteGlobalSetting(const Settings::SwitchableSetting<Type, ranged>& setting) {
|
|
|
|
|
void QtConfig::WriteGlobalSetting(const Settings::SwitchableSetting<Type, ranged>& setting) {
|
|
|
|
|
const QString name = QString::fromStdString(setting.GetLabel());
|
|
|
|
|
const Type& value = setting.GetValue(global);
|
|
|
|
|
if (!global) {
|
|
|
|
|
@@ -227,7 +227,7 @@ void Config::WriteGlobalSetting(const Settings::SwitchableSetting<Type, ranged>&
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
void Config::WriteGlobalSetting(const Settings::SwitchableSetting<std::string>& setting) {
|
|
|
|
|
void QtConfig::WriteGlobalSetting(const Settings::SwitchableSetting<std::string>& setting) {
|
|
|
|
|
const QString name = QString::fromStdString(setting.GetLabel());
|
|
|
|
|
const std::string& value = setting.GetValue(global);
|
|
|
|
|
if (!global) {
|
|
|
|
|
@@ -241,7 +241,7 @@ void Config::WriteGlobalSetting(const Settings::SwitchableSetting<std::string>&
|
|
|
|
|
|
|
|
|
|
// Explicit u16 definition: Qt would store it as QMetaType otherwise, which is not human-readable
|
|
|
|
|
template <>
|
|
|
|
|
void Config::WriteGlobalSetting(const Settings::SwitchableSetting<u16, true>& setting) {
|
|
|
|
|
void QtConfig::WriteGlobalSetting(const Settings::SwitchableSetting<u16, true>& setting) {
|
|
|
|
|
const QString name = QString::fromStdString(setting.GetLabel());
|
|
|
|
|
const u16& value = setting.GetValue(global);
|
|
|
|
|
if (!global) {
|
|
|
|
|
@@ -253,7 +253,7 @@ void Config::WriteGlobalSetting(const Settings::SwitchableSetting<u16, true>& se
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadValues() {
|
|
|
|
|
void QtConfig::ReadValues() {
|
|
|
|
|
if (global) {
|
|
|
|
|
ReadControlValues();
|
|
|
|
|
ReadCameraValues();
|
|
|
|
|
@@ -273,7 +273,7 @@ void Config::ReadValues() {
|
|
|
|
|
ReadUtilityValues();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadAudioValues() {
|
|
|
|
|
void QtConfig::ReadAudioValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Audio"));
|
|
|
|
|
|
|
|
|
|
ReadGlobalSetting(Settings::values.audio_emulation);
|
|
|
|
|
@@ -291,7 +291,7 @@ void Config::ReadAudioValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadCameraValues() {
|
|
|
|
|
void QtConfig::ReadCameraValues() {
|
|
|
|
|
using namespace Service::CAM;
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Camera"));
|
|
|
|
|
|
|
|
|
|
@@ -325,7 +325,7 @@ void Config::ReadCameraValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadControlValues() {
|
|
|
|
|
void QtConfig::ReadControlValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Controls"));
|
|
|
|
|
|
|
|
|
|
ReadBasicSetting(Settings::values.use_artic_base_controller);
|
|
|
|
|
@@ -442,7 +442,7 @@ void Config::ReadControlValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadUtilityValues() {
|
|
|
|
|
void QtConfig::ReadUtilityValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Utility"));
|
|
|
|
|
|
|
|
|
|
ReadGlobalSetting(Settings::values.dump_textures);
|
|
|
|
|
@@ -453,7 +453,7 @@ void Config::ReadUtilityValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadCoreValues() {
|
|
|
|
|
void QtConfig::ReadCoreValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Core"));
|
|
|
|
|
|
|
|
|
|
ReadGlobalSetting(Settings::values.cpu_clock_percentage);
|
|
|
|
|
@@ -466,7 +466,7 @@ void Config::ReadCoreValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadDataStorageValues() {
|
|
|
|
|
void QtConfig::ReadDataStorageValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Data Storage"));
|
|
|
|
|
|
|
|
|
|
ReadBasicSetting(Settings::values.use_virtual_sd);
|
|
|
|
|
@@ -485,7 +485,7 @@ void Config::ReadDataStorageValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadDebuggingValues() {
|
|
|
|
|
void QtConfig::ReadDebuggingValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Debugging"));
|
|
|
|
|
|
|
|
|
|
// Intentionally not using the QT default setting as this is intended to be changed in the ini
|
|
|
|
|
@@ -506,7 +506,7 @@ void Config::ReadDebuggingValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadLayoutValues() {
|
|
|
|
|
void QtConfig::ReadLayoutValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Layout"));
|
|
|
|
|
|
|
|
|
|
ReadGlobalSetting(Settings::values.render_3d);
|
|
|
|
|
@@ -551,7 +551,7 @@ void Config::ReadLayoutValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadMiscellaneousValues() {
|
|
|
|
|
void QtConfig::ReadMiscellaneousValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Miscellaneous"));
|
|
|
|
|
|
|
|
|
|
ReadBasicSetting(Settings::values.log_filter);
|
|
|
|
|
@@ -561,7 +561,7 @@ void Config::ReadMiscellaneousValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadMultiplayerValues() {
|
|
|
|
|
void QtConfig::ReadMultiplayerValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Multiplayer"));
|
|
|
|
|
|
|
|
|
|
UISettings::values.nickname = ReadSetting(QStringLiteral("nickname"), QString{}).toString();
|
|
|
|
|
@@ -612,7 +612,7 @@ void Config::ReadMultiplayerValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadPathValues() {
|
|
|
|
|
void QtConfig::ReadPathValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Paths"));
|
|
|
|
|
|
|
|
|
|
ReadGlobalSetting(UISettings::values.screenshot_path);
|
|
|
|
|
@@ -664,7 +664,7 @@ void Config::ReadPathValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadRendererValues() {
|
|
|
|
|
void QtConfig::ReadRendererValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Renderer"));
|
|
|
|
|
|
|
|
|
|
ReadGlobalSetting(Settings::values.graphics_api);
|
|
|
|
|
@@ -695,7 +695,7 @@ void Config::ReadRendererValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadShortcutValues() {
|
|
|
|
|
void QtConfig::ReadShortcutValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Shortcuts"));
|
|
|
|
|
|
|
|
|
|
for (const auto& [name, group, shortcut] : default_hotkeys) {
|
|
|
|
|
@@ -716,7 +716,7 @@ void Config::ReadShortcutValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadSystemValues() {
|
|
|
|
|
void QtConfig::ReadSystemValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("System"));
|
|
|
|
|
|
|
|
|
|
ReadGlobalSetting(Settings::values.is_new_3ds);
|
|
|
|
|
@@ -743,7 +743,7 @@ const QString DEFAULT_VIDEO_ENCODER_OPTIONS =
|
|
|
|
|
QStringLiteral("quality:realtime,speed:6,tile-columns:4,frame-parallel:1,threads:8,row-mt:1");
|
|
|
|
|
const QString DEFAULT_AUDIO_ENCODER_OPTIONS = QStringLiteral("");
|
|
|
|
|
|
|
|
|
|
void Config::ReadVideoDumpingValues() {
|
|
|
|
|
void QtConfig::ReadVideoDumpingValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("VideoDumping"));
|
|
|
|
|
|
|
|
|
|
Settings::values.output_format =
|
|
|
|
|
@@ -780,7 +780,7 @@ void Config::ReadVideoDumpingValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadUIValues() {
|
|
|
|
|
void QtConfig::ReadUIValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("UI"));
|
|
|
|
|
|
|
|
|
|
ReadPathValues();
|
|
|
|
|
@@ -816,7 +816,7 @@ void Config::ReadUIValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadUIGameListValues() {
|
|
|
|
|
void QtConfig::ReadUIGameListValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("GameList"));
|
|
|
|
|
|
|
|
|
|
ReadBasicSetting(UISettings::values.game_list_icon_size);
|
|
|
|
|
@@ -842,7 +842,7 @@ void Config::ReadUIGameListValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadUILayoutValues() {
|
|
|
|
|
void QtConfig::ReadUILayoutValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("UILayout"));
|
|
|
|
|
|
|
|
|
|
UISettings::values.geometry = ReadSetting(QStringLiteral("geometry")).toByteArray();
|
|
|
|
|
@@ -858,7 +858,7 @@ void Config::ReadUILayoutValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadUpdaterValues() {
|
|
|
|
|
void QtConfig::ReadUpdaterValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Updater"));
|
|
|
|
|
|
|
|
|
|
ReadBasicSetting(UISettings::values.check_for_update_on_start);
|
|
|
|
|
@@ -867,7 +867,7 @@ void Config::ReadUpdaterValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::ReadWebServiceValues() {
|
|
|
|
|
void QtConfig::ReadWebServiceValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("WebService"));
|
|
|
|
|
|
|
|
|
|
NetSettings::values.web_api_url =
|
|
|
|
|
@@ -882,7 +882,7 @@ void Config::ReadWebServiceValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveValues() {
|
|
|
|
|
void QtConfig::SaveValues() {
|
|
|
|
|
if (global) {
|
|
|
|
|
SaveControlValues();
|
|
|
|
|
SaveCameraValues();
|
|
|
|
|
@@ -903,7 +903,7 @@ void Config::SaveValues() {
|
|
|
|
|
qt_config->sync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveAudioValues() {
|
|
|
|
|
void QtConfig::SaveAudioValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Audio"));
|
|
|
|
|
|
|
|
|
|
WriteGlobalSetting(Settings::values.audio_emulation);
|
|
|
|
|
@@ -921,7 +921,7 @@ void Config::SaveAudioValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveCameraValues() {
|
|
|
|
|
void QtConfig::SaveCameraValues() {
|
|
|
|
|
using namespace Service::CAM;
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Camera"));
|
|
|
|
|
|
|
|
|
|
@@ -951,7 +951,7 @@ void Config::SaveCameraValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveControlValues() {
|
|
|
|
|
void QtConfig::SaveControlValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Controls"));
|
|
|
|
|
|
|
|
|
|
WriteBasicSetting(Settings::values.use_artic_base_controller);
|
|
|
|
|
@@ -1012,7 +1012,7 @@ void Config::SaveControlValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveUtilityValues() {
|
|
|
|
|
void QtConfig::SaveUtilityValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Utility"));
|
|
|
|
|
|
|
|
|
|
WriteGlobalSetting(Settings::values.dump_textures);
|
|
|
|
|
@@ -1023,7 +1023,7 @@ void Config::SaveUtilityValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveCoreValues() {
|
|
|
|
|
void QtConfig::SaveCoreValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Core"));
|
|
|
|
|
|
|
|
|
|
WriteGlobalSetting(Settings::values.cpu_clock_percentage);
|
|
|
|
|
@@ -1036,7 +1036,7 @@ void Config::SaveCoreValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveDataStorageValues() {
|
|
|
|
|
void QtConfig::SaveDataStorageValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Data Storage"));
|
|
|
|
|
|
|
|
|
|
WriteBasicSetting(Settings::values.use_virtual_sd);
|
|
|
|
|
@@ -1051,7 +1051,7 @@ void Config::SaveDataStorageValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveDebuggingValues() {
|
|
|
|
|
void QtConfig::SaveDebuggingValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Debugging"));
|
|
|
|
|
|
|
|
|
|
// Intentionally not using the QT default setting as this is intended to be changed in the ini
|
|
|
|
|
@@ -1070,7 +1070,7 @@ void Config::SaveDebuggingValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveLayoutValues() {
|
|
|
|
|
void QtConfig::SaveLayoutValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Layout"));
|
|
|
|
|
|
|
|
|
|
WriteGlobalSetting(Settings::values.render_3d);
|
|
|
|
|
@@ -1114,7 +1114,7 @@ void Config::SaveLayoutValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveMiscellaneousValues() {
|
|
|
|
|
void QtConfig::SaveMiscellaneousValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Miscellaneous"));
|
|
|
|
|
|
|
|
|
|
WriteBasicSetting(Settings::values.log_filter);
|
|
|
|
|
@@ -1124,7 +1124,7 @@ void Config::SaveMiscellaneousValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveMultiplayerValues() {
|
|
|
|
|
void QtConfig::SaveMultiplayerValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Multiplayer"));
|
|
|
|
|
|
|
|
|
|
WriteSetting(QStringLiteral("nickname"), UISettings::values.nickname, QString{});
|
|
|
|
|
@@ -1167,7 +1167,7 @@ void Config::SaveMultiplayerValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SavePathValues() {
|
|
|
|
|
void QtConfig::SavePathValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Paths"));
|
|
|
|
|
|
|
|
|
|
WriteGlobalSetting(UISettings::values.screenshot_path);
|
|
|
|
|
@@ -1195,7 +1195,7 @@ void Config::SavePathValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveRendererValues() {
|
|
|
|
|
void QtConfig::SaveRendererValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Renderer"));
|
|
|
|
|
|
|
|
|
|
WriteGlobalSetting(Settings::values.graphics_api);
|
|
|
|
|
@@ -1227,7 +1227,7 @@ void Config::SaveRendererValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveShortcutValues() {
|
|
|
|
|
void QtConfig::SaveShortcutValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Shortcuts"));
|
|
|
|
|
|
|
|
|
|
// Lengths of UISettings::values.shortcuts & default_hotkeys are same.
|
|
|
|
|
@@ -1247,7 +1247,7 @@ void Config::SaveShortcutValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveSystemValues() {
|
|
|
|
|
void QtConfig::SaveSystemValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("System"));
|
|
|
|
|
|
|
|
|
|
WriteGlobalSetting(Settings::values.is_new_3ds);
|
|
|
|
|
@@ -1268,7 +1268,7 @@ void Config::SaveSystemValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveVideoDumpingValues() {
|
|
|
|
|
void QtConfig::SaveVideoDumpingValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("VideoDumping"));
|
|
|
|
|
|
|
|
|
|
WriteSetting(QStringLiteral("output_format"),
|
|
|
|
|
@@ -1295,7 +1295,7 @@ void Config::SaveVideoDumpingValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveUIValues() {
|
|
|
|
|
void QtConfig::SaveUIValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("UI"));
|
|
|
|
|
|
|
|
|
|
SavePathValues();
|
|
|
|
|
@@ -1330,7 +1330,7 @@ void Config::SaveUIValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveUIGameListValues() {
|
|
|
|
|
void QtConfig::SaveUIGameListValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("GameList"));
|
|
|
|
|
|
|
|
|
|
WriteBasicSetting(UISettings::values.game_list_icon_size);
|
|
|
|
|
@@ -1356,7 +1356,7 @@ void Config::SaveUIGameListValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveUILayoutValues() {
|
|
|
|
|
void QtConfig::SaveUILayoutValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("UILayout"));
|
|
|
|
|
|
|
|
|
|
WriteSetting(QStringLiteral("geometry"), UISettings::values.geometry);
|
|
|
|
|
@@ -1370,7 +1370,7 @@ void Config::SaveUILayoutValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveUpdaterValues() {
|
|
|
|
|
void QtConfig::SaveUpdaterValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("Updater"));
|
|
|
|
|
|
|
|
|
|
WriteBasicSetting(UISettings::values.check_for_update_on_start);
|
|
|
|
|
@@ -1379,7 +1379,7 @@ void Config::SaveUpdaterValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::SaveWebServiceValues() {
|
|
|
|
|
void QtConfig::SaveWebServiceValues() {
|
|
|
|
|
qt_config->beginGroup(QStringLiteral("WebService"));
|
|
|
|
|
|
|
|
|
|
WriteSetting(QStringLiteral("web_api_url"),
|
|
|
|
|
@@ -1393,11 +1393,11 @@ void Config::SaveWebServiceValues() {
|
|
|
|
|
qt_config->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVariant Config::ReadSetting(const QString& name) const {
|
|
|
|
|
QVariant QtConfig::ReadSetting(const QString& name) const {
|
|
|
|
|
return qt_config->value(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVariant Config::ReadSetting(const QString& name, const QVariant& default_value) const {
|
|
|
|
|
QVariant QtConfig::ReadSetting(const QString& name, const QVariant& default_value) const {
|
|
|
|
|
QVariant result;
|
|
|
|
|
if (qt_config->value(name + QStringLiteral("/default"), false).toBool()) {
|
|
|
|
|
result = default_value;
|
|
|
|
|
@@ -1407,22 +1407,22 @@ QVariant Config::ReadSetting(const QString& name, const QVariant& default_value)
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::WriteSetting(const QString& name, const QVariant& value) {
|
|
|
|
|
void QtConfig::WriteSetting(const QString& name, const QVariant& value) {
|
|
|
|
|
qt_config->setValue(name, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::WriteSetting(const QString& name, const QVariant& value,
|
|
|
|
|
const QVariant& default_value) {
|
|
|
|
|
void QtConfig::WriteSetting(const QString& name, const QVariant& value,
|
|
|
|
|
const QVariant& default_value) {
|
|
|
|
|
qt_config->setValue(name + QStringLiteral("/default"), value == default_value);
|
|
|
|
|
qt_config->setValue(name, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::Reload() {
|
|
|
|
|
void QtConfig::Reload() {
|
|
|
|
|
ReadValues();
|
|
|
|
|
// To apply default value changes
|
|
|
|
|
SaveValues();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Config::Save() {
|
|
|
|
|
void QtConfig::Save() {
|
|
|
|
|
SaveValues();
|
|
|
|
|
}
|
|
|
|
|
|