diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/settings_common.h | 2 | ||||
| -rw-r--r-- | src/common/settings_setting.h | 14 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_audio.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics_advanced.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_system.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/shared_widget.cpp | 27 |
9 files changed, 37 insertions, 34 deletions
diff --git a/src/common/settings_common.h b/src/common/settings_common.h index 4d6d3021e..2b5c72f41 100644 --- a/src/common/settings_common.h +++ b/src/common/settings_common.h | |||
| @@ -178,7 +178,7 @@ public: | |||
| 178 | * | 178 | * |
| 179 | * @returns The setting's category | 179 | * @returns The setting's category |
| 180 | */ | 180 | */ |
| 181 | [[nodiscard]] Category Category() const; | 181 | [[nodiscard]] enum Category Category() const; |
| 182 | 182 | ||
| 183 | /** | 183 | /** |
| 184 | * Returns the label this setting was created with. | 184 | * Returns the label this setting was created with. |
diff --git a/src/common/settings_setting.h b/src/common/settings_setting.h index 658b6328d..f803e4e6e 100644 --- a/src/common/settings_setting.h +++ b/src/common/settings_setting.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include <map> | 6 | #include <map> |
| 7 | #include <optional> | 7 | #include <optional> |
| 8 | #include <stdexcept> | ||
| 8 | #include <string> | 9 | #include <string> |
| 9 | #include <typeindex> | 10 | #include <typeindex> |
| 10 | #include <typeinfo> | 11 | #include <typeinfo> |
| @@ -169,7 +170,7 @@ public: | |||
| 169 | } else { | 170 | } else { |
| 170 | this->SetValue(static_cast<Type>(std::stoll(input))); | 171 | this->SetValue(static_cast<Type>(std::stoll(input))); |
| 171 | } | 172 | } |
| 172 | } catch (std::invalid_argument) { | 173 | } catch (std::invalid_argument& e) { |
| 173 | this->SetValue(this->GetDefault()); | 174 | this->SetValue(this->GetDefault()); |
| 174 | } | 175 | } |
| 175 | } | 176 | } |
| @@ -229,9 +230,10 @@ public: | |||
| 229 | * @param category_ Category of the setting AKA INI group | 230 | * @param category_ Category of the setting AKA INI group |
| 230 | */ | 231 | */ |
| 231 | explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const std::string& name, | 232 | explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const std::string& name, |
| 232 | Category category, bool save = true, bool runtime_modifiable = false) | 233 | Category category_, bool save_ = true, |
| 234 | bool runtime_modifiable_ = false) | ||
| 233 | requires(!ranged) | 235 | requires(!ranged) |
| 234 | : Setting<Type, false>{linkage, default_val, name, category, save, runtime_modifiable} { | 236 | : Setting<Type, false>{linkage, default_val, name, category_, save_, runtime_modifiable_} { |
| 235 | linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); | 237 | linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); |
| 236 | } | 238 | } |
| 237 | virtual ~SwitchableSetting() = default; | 239 | virtual ~SwitchableSetting() = default; |
| @@ -247,11 +249,11 @@ public: | |||
| 247 | * @param category_ Category of the setting AKA INI group | 249 | * @param category_ Category of the setting AKA INI group |
| 248 | */ | 250 | */ |
| 249 | explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const Type& min_val, | 251 | explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const Type& min_val, |
| 250 | const Type& max_val, const std::string& name, Category category, | 252 | const Type& max_val, const std::string& name, Category category_, |
| 251 | bool save = true, bool runtime_modifiable = false) | 253 | bool save_ = true, bool runtime_modifiable_ = false) |
| 252 | requires(ranged) | 254 | requires(ranged) |
| 253 | : Setting<Type, true>{linkage, default_val, min_val, max_val, | 255 | : Setting<Type, true>{linkage, default_val, min_val, max_val, |
| 254 | name, category, save, runtime_modifiable} { | 256 | name, category_, save_, runtime_modifiable_} { |
| 255 | linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); | 257 | linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); |
| 256 | } | 258 | } |
| 257 | 259 | ||
diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index c90316725..8c5378925 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp | |||
| @@ -18,10 +18,10 @@ | |||
| 18 | 18 | ||
| 19 | ConfigureAudio::ConfigureAudio( | 19 | ConfigureAudio::ConfigureAudio( |
| 20 | const Core::System& system_, | 20 | const Core::System& system_, |
| 21 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | 21 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_, |
| 22 | const ConfigurationShared::TranslationMap& translations_, | 22 | const ConfigurationShared::TranslationMap& translations_, |
| 23 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) | 23 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) |
| 24 | : Tab(group, parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_}, | 24 | : Tab(group_, parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_}, |
| 25 | translations{translations_}, combobox_translations{combobox_translations_} { | 25 | translations{translations_}, combobox_translations{combobox_translations_} { |
| 26 | ui->setupUi(this); | 26 | ui->setupUi(this); |
| 27 | Setup(); | 27 | Setup(); |
diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cpp index f4bec1155..210af146d 100644 --- a/src/yuzu/configuration/configure_cpu.cpp +++ b/src/yuzu/configuration/configure_cpu.cpp | |||
| @@ -15,10 +15,10 @@ | |||
| 15 | 15 | ||
| 16 | ConfigureCpu::ConfigureCpu( | 16 | ConfigureCpu::ConfigureCpu( |
| 17 | const Core::System& system_, | 17 | const Core::System& system_, |
| 18 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | 18 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_, |
| 19 | const ConfigurationShared::TranslationMap& translations_, | 19 | const ConfigurationShared::TranslationMap& translations_, |
| 20 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) | 20 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) |
| 21 | : Tab(group, parent), ui{std::make_unique<Ui::ConfigureCpu>()}, system{system_}, | 21 | : Tab(group_, parent), ui{std::make_unique<Ui::ConfigureCpu>()}, system{system_}, |
| 22 | translations{translations_}, combobox_translations{combobox_translations_} { | 22 | translations{translations_}, combobox_translations{combobox_translations_} { |
| 23 | ui->setupUi(this); | 23 | ui->setupUi(this); |
| 24 | 24 | ||
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 625dd75dd..ca5b92bc0 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -14,10 +14,10 @@ | |||
| 14 | 14 | ||
| 15 | ConfigureGeneral::ConfigureGeneral( | 15 | ConfigureGeneral::ConfigureGeneral( |
| 16 | const Core::System& system_, | 16 | const Core::System& system_, |
| 17 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | 17 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_, |
| 18 | const ConfigurationShared::TranslationMap& translations_, | 18 | const ConfigurationShared::TranslationMap& translations_, |
| 19 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) | 19 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) |
| 20 | : Tab(group, parent), ui{std::make_unique<Ui::ConfigureGeneral>()}, system{system_}, | 20 | : Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGeneral>()}, system{system_}, |
| 21 | translations{translations_}, combobox_translations{combobox_translations_} { | 21 | translations{translations_}, combobox_translations{combobox_translations_} { |
| 22 | ui->setupUi(this); | 22 | ui->setupUi(this); |
| 23 | 23 | ||
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 62d74d12b..5537118ef 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -80,10 +80,10 @@ static constexpr Settings::VSyncMode PresentModeToSetting(VkPresentModeKHR mode) | |||
| 80 | ConfigureGraphics::ConfigureGraphics( | 80 | ConfigureGraphics::ConfigureGraphics( |
| 81 | const Core::System& system_, std::vector<VkDeviceInfo::Record>& records_, | 81 | const Core::System& system_, std::vector<VkDeviceInfo::Record>& records_, |
| 82 | const std::function<void()>& expose_compute_option_, | 82 | const std::function<void()>& expose_compute_option_, |
| 83 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | 83 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_, |
| 84 | const ConfigurationShared::TranslationMap& translations_, | 84 | const ConfigurationShared::TranslationMap& translations_, |
| 85 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) | 85 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) |
| 86 | : ConfigurationShared::Tab(group, parent), ui{std::make_unique<Ui::ConfigureGraphics>()}, | 86 | : ConfigurationShared::Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphics>()}, |
| 87 | records{records_}, expose_compute_option{expose_compute_option_}, system{system_}, | 87 | records{records_}, expose_compute_option{expose_compute_option_}, system{system_}, |
| 88 | translations{translations_}, combobox_translations{combobox_translations_}, | 88 | translations{translations_}, combobox_translations{combobox_translations_}, |
| 89 | shader_mapping{combobox_translations.at(typeid(Settings::ShaderBackend))} { | 89 | shader_mapping{combobox_translations.at(typeid(Settings::ShaderBackend))} { |
| @@ -275,7 +275,7 @@ void ConfigureGraphics::Setup() { | |||
| 275 | 275 | ||
| 276 | if (!Settings::IsConfiguringGlobal()) { | 276 | if (!Settings::IsConfiguringGlobal()) { |
| 277 | QObject::connect(api_restore_global_button, &QAbstractButton::clicked, | 277 | QObject::connect(api_restore_global_button, &QAbstractButton::clicked, |
| 278 | [=](bool) { UpdateAPILayout(); }); | 278 | [this](bool) { UpdateAPILayout(); }); |
| 279 | 279 | ||
| 280 | // Detach API's restore button and place it where we want | 280 | // Detach API's restore button and place it where we want |
| 281 | // Lets us put it on the side, and it will automatically scale if there's a | 281 | // Lets us put it on the side, and it will automatically scale if there's a |
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index 20ca3fa96..e2f7d284d 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp | |||
| @@ -13,10 +13,10 @@ | |||
| 13 | 13 | ||
| 14 | ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced( | 14 | ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced( |
| 15 | const Core::System& system_, | 15 | const Core::System& system_, |
| 16 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | 16 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_, |
| 17 | const ConfigurationShared::TranslationMap& translations_, | 17 | const ConfigurationShared::TranslationMap& translations_, |
| 18 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) | 18 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) |
| 19 | : Tab(group, parent), ui{std::make_unique<Ui::ConfigureGraphicsAdvanced>()}, system{system_}, | 19 | : Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphicsAdvanced>()}, system{system_}, |
| 20 | translations{translations_}, combobox_translations{combobox_translations_} { | 20 | translations{translations_}, combobox_translations{combobox_translations_} { |
| 21 | 21 | ||
| 22 | ui->setupUi(this); | 22 | ui->setupUi(this); |
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index f78ed7c24..51b0629a6 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp | |||
| @@ -45,10 +45,10 @@ static bool IsValidLocale(u32 region_index, u32 language_index) { | |||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | ConfigureSystem::ConfigureSystem( | 47 | ConfigureSystem::ConfigureSystem( |
| 48 | Core::System& system_, std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | 48 | Core::System& system_, std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group_, |
| 49 | const ConfigurationShared::TranslationMap& translations_, | 49 | const ConfigurationShared::TranslationMap& translations_, |
| 50 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) | 50 | const ConfigurationShared::ComboboxTranslationMap& combobox_translations_, QWidget* parent) |
| 51 | : Tab(group, parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_}, | 51 | : Tab(group_, parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_}, |
| 52 | translations{translations_}, combobox_translations{combobox_translations_} { | 52 | translations{translations_}, combobox_translations{combobox_translations_} { |
| 53 | ui->setupUi(this); | 53 | ui->setupUi(this); |
| 54 | 54 | ||
| @@ -128,7 +128,7 @@ void ConfigureSystem::Setup() { | |||
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | [[maybe_unused]] std::string label = setting->GetLabel(); | 130 | [[maybe_unused]] std::string label = setting->GetLabel(); |
| 131 | ConfigurationShared::Widget* widget = [=]() { | 131 | ConfigurationShared::Widget* widget = [this, setting, runtime_lock]() { |
| 132 | if (setting->Id() == Settings::values.custom_rtc.Id()) { | 132 | if (setting->Id() == Settings::values.custom_rtc.Id()) { |
| 133 | // custom_rtc needs a DateTimeEdit (default is LineEdit), and a checkbox to manage | 133 | // custom_rtc needs a DateTimeEdit (default is LineEdit), and a checkbox to manage |
| 134 | // it and custom_rtc_enabled | 134 | // it and custom_rtc_enabled |
diff --git a/src/yuzu/configuration/shared_widget.cpp b/src/yuzu/configuration/shared_widget.cpp index a855559b6..882cd9eda 100644 --- a/src/yuzu/configuration/shared_widget.cpp +++ b/src/yuzu/configuration/shared_widget.cpp | |||
| @@ -276,7 +276,7 @@ QWidget* Widget::CreateHexEdit(std::function<std::string()>& serializer, | |||
| 276 | line_edit->setMaxLength(8); | 276 | line_edit->setMaxLength(8); |
| 277 | line_edit->setValidator(regex); | 277 | line_edit->setValidator(regex); |
| 278 | 278 | ||
| 279 | auto hex_to_dec = [=]() -> std::string { | 279 | auto hex_to_dec = [this]() -> std::string { |
| 280 | return std::to_string(std::stoul(line_edit->text().toStdString(), nullptr, 16)); | 280 | return std::to_string(std::stoul(line_edit->text().toStdString(), nullptr, 16)); |
| 281 | }; | 281 | }; |
| 282 | 282 | ||
| @@ -307,8 +307,8 @@ QWidget* Widget::CreateDateTimeEdit(bool disabled, bool restrict, | |||
| 307 | serializer = [this]() { return std::to_string(date_time_edit->dateTime().toSecsSinceEpoch()); }; | 307 | serializer = [this]() { return std::to_string(date_time_edit->dateTime().toSecsSinceEpoch()); }; |
| 308 | 308 | ||
| 309 | if (!Settings::IsConfiguringGlobal()) { | 309 | if (!Settings::IsConfiguringGlobal()) { |
| 310 | auto get_clear_val = [=]() { | 310 | auto get_clear_val = [this, restrict, current_time]() { |
| 311 | return QDateTime::fromSecsSinceEpoch([=]() { | 311 | return QDateTime::fromSecsSinceEpoch([this, restrict, current_time]() { |
| 312 | if (restrict && checkbox->checkState() == Qt::Checked) { | 312 | if (restrict && checkbox->checkState() == Qt::Checked) { |
| 313 | return std::stoll(setting.ToStringGlobal()); | 313 | return std::stoll(setting.ToStringGlobal()); |
| 314 | } | 314 | } |
| @@ -316,13 +316,14 @@ QWidget* Widget::CreateDateTimeEdit(bool disabled, bool restrict, | |||
| 316 | }()); | 316 | }()); |
| 317 | }; | 317 | }; |
| 318 | 318 | ||
| 319 | restore_func = [=]() { date_time_edit->setDateTime(get_clear_val()); }; | 319 | restore_func = [this, get_clear_val]() { date_time_edit->setDateTime(get_clear_val()); }; |
| 320 | 320 | ||
| 321 | QObject::connect(date_time_edit, &QDateTimeEdit::editingFinished, [=]() { | 321 | QObject::connect(date_time_edit, &QDateTimeEdit::editingFinished, |
| 322 | if (date_time_edit->dateTime() != get_clear_val()) { | 322 | [this, get_clear_val, touch]() { |
| 323 | touch(); | 323 | if (date_time_edit->dateTime() != get_clear_val()) { |
| 324 | } | 324 | touch(); |
| 325 | }); | 325 | } |
| 326 | }); | ||
| 326 | } | 327 | } |
| 327 | 328 | ||
| 328 | return date_time_edit; | 329 | return date_time_edit; |
| @@ -528,11 +529,11 @@ Widget::Widget(Settings::BasicSetting* setting_, const TranslationMap& translati | |||
| 528 | this->setToolTip(tooltip); | 529 | this->setToolTip(tooltip); |
| 529 | } | 530 | } |
| 530 | 531 | ||
| 531 | Widget::Widget(Settings::BasicSetting* setting, const TranslationMap& translations, | 532 | Widget::Widget(Settings::BasicSetting* setting_, const TranslationMap& translations_, |
| 532 | const ComboboxTranslationMap& combobox_translations, QWidget* parent, | 533 | const ComboboxTranslationMap& combobox_translations, QWidget* parent_, |
| 533 | bool runtime_lock, std::forward_list<std::function<void(bool)>>& apply_funcs_, | 534 | bool runtime_lock_, std::forward_list<std::function<void(bool)>>& apply_funcs_, |
| 534 | Settings::BasicSetting* other_setting, RequestType request, const QString& string) | 535 | Settings::BasicSetting* other_setting, RequestType request, const QString& string) |
| 535 | : Widget(setting, translations, combobox_translations, parent, runtime_lock, apply_funcs_, | 536 | : Widget(setting_, translations_, combobox_translations, parent_, runtime_lock_, apply_funcs_, |
| 536 | request, true, 1.0f, other_setting, string) {} | 537 | request, true, 1.0f, other_setting, string) {} |
| 537 | 538 | ||
| 538 | } // namespace ConfigurationShared | 539 | } // namespace ConfigurationShared |