diff options
| author | 2016-12-21 23:49:36 -0500 | |
|---|---|---|
| committer | 2017-04-03 20:43:13 -0600 | |
| commit | 1631e99eed644bb9d313bc49ef6023ac3afe1e52 (patch) | |
| tree | 523eade6ec8d6779a4a55a46f1471079b88bf4f9 /src/citra_qt/configuration/configure_general.cpp | |
| parent | Merge pull request #2622 from jfmherokiller/socufix (diff) | |
| download | yuzu-1631e99eed644bb9d313bc49ef6023ac3afe1e52.tar.gz yuzu-1631e99eed644bb9d313bc49ef6023ac3afe1e52.tar.xz yuzu-1631e99eed644bb9d313bc49ef6023ac3afe1e52.zip | |
citra-qt: Move config dialog code to its own directory
Diffstat (limited to 'src/citra_qt/configuration/configure_general.cpp')
| -rw-r--r-- | src/citra_qt/configuration/configure_general.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/citra_qt/configuration/configure_general.cpp b/src/citra_qt/configuration/configure_general.cpp new file mode 100644 index 000000000..a21176c34 --- /dev/null +++ b/src/citra_qt/configuration/configure_general.cpp | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "citra_qt/configuration/configure_general.h" | ||
| 6 | #include "citra_qt/ui_settings.h" | ||
| 7 | #include "core/core.h" | ||
| 8 | #include "core/settings.h" | ||
| 9 | #include "ui_configure_general.h" | ||
| 10 | |||
| 11 | ConfigureGeneral::ConfigureGeneral(QWidget* parent) | ||
| 12 | : QWidget(parent), ui(new Ui::ConfigureGeneral) { | ||
| 13 | |||
| 14 | ui->setupUi(this); | ||
| 15 | this->setConfiguration(); | ||
| 16 | |||
| 17 | ui->toggle_cpu_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn()); | ||
| 18 | } | ||
| 19 | |||
| 20 | ConfigureGeneral::~ConfigureGeneral() {} | ||
| 21 | |||
| 22 | void ConfigureGeneral::setConfiguration() { | ||
| 23 | ui->toggle_deepscan->setChecked(UISettings::values.gamedir_deepscan); | ||
| 24 | ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing); | ||
| 25 | ui->toggle_cpu_jit->setChecked(Settings::values.use_cpu_jit); | ||
| 26 | |||
| 27 | // The first item is "auto-select" with actual value -1, so plus one here will do the trick | ||
| 28 | ui->region_combobox->setCurrentIndex(Settings::values.region_value + 1); | ||
| 29 | } | ||
| 30 | |||
| 31 | void ConfigureGeneral::applyConfiguration() { | ||
| 32 | UISettings::values.gamedir_deepscan = ui->toggle_deepscan->isChecked(); | ||
| 33 | UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); | ||
| 34 | Settings::values.region_value = ui->region_combobox->currentIndex() - 1; | ||
| 35 | Settings::values.use_cpu_jit = ui->toggle_cpu_jit->isChecked(); | ||
| 36 | Settings::Apply(); | ||
| 37 | } | ||