diff options
| author | 2016-09-02 09:36:08 -0400 | |
|---|---|---|
| committer | 2016-09-02 09:36:08 -0400 | |
| commit | 274b925a9705ebd5c4ec242c70d44249dc9f2b0d (patch) | |
| tree | 01751cd1c7329b041aaa1d40cf1bf8b098c61567 /src | |
| parent | Merge pull request #2040 from citra-emu/revert-2037-msvc-relwithdebinfo (diff) | |
| parent | Qt: unify running detection (diff) | |
| download | yuzu-274b925a9705ebd5c4ec242c70d44249dc9f2b0d.tar.gz yuzu-274b925a9705ebd5c4ec242c70d44249dc9f2b0d.tar.xz yuzu-274b925a9705ebd5c4ec242c70d44249dc9f2b0d.zip | |
Merge pull request #2044 from wwylele/system-setting-fix
Qt: unify running detection of system settings configure
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra_qt/configure_dialog.cpp | 8 | ||||
| -rw-r--r-- | src/citra_qt/configure_dialog.h | 3 | ||||
| -rw-r--r-- | src/citra_qt/configure_system.cpp | 6 | ||||
| -rw-r--r-- | src/citra_qt/configure_system.h | 2 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 2 |
5 files changed, 9 insertions, 12 deletions
diff --git a/src/citra_qt/configure_dialog.cpp b/src/citra_qt/configure_dialog.cpp index 7da8ad067..016f201ef 100644 --- a/src/citra_qt/configure_dialog.cpp +++ b/src/citra_qt/configure_dialog.cpp | |||
| @@ -9,10 +9,9 @@ | |||
| 9 | 9 | ||
| 10 | #include "core/settings.h" | 10 | #include "core/settings.h" |
| 11 | 11 | ||
| 12 | ConfigureDialog::ConfigureDialog(QWidget *parent, bool running) : | 12 | ConfigureDialog::ConfigureDialog(QWidget *parent) : |
| 13 | QDialog(parent), | 13 | QDialog(parent), |
| 14 | ui(new Ui::ConfigureDialog), | 14 | ui(new Ui::ConfigureDialog) |
| 15 | emulation_running(running) | ||
| 16 | { | 15 | { |
| 17 | ui->setupUi(this); | 16 | ui->setupUi(this); |
| 18 | this->setConfiguration(); | 17 | this->setConfiguration(); |
| @@ -22,9 +21,6 @@ ConfigureDialog::~ConfigureDialog() { | |||
| 22 | } | 21 | } |
| 23 | 22 | ||
| 24 | void ConfigureDialog::setConfiguration() { | 23 | void ConfigureDialog::setConfiguration() { |
| 25 | // System tab needs set manually | ||
| 26 | // depending on whether emulation is running | ||
| 27 | ui->systemTab->setConfiguration(emulation_running); | ||
| 28 | } | 24 | } |
| 29 | 25 | ||
| 30 | void ConfigureDialog::applyConfiguration() { | 26 | void ConfigureDialog::applyConfiguration() { |
diff --git a/src/citra_qt/configure_dialog.h b/src/citra_qt/configure_dialog.h index 305b33bdf..e232699cd 100644 --- a/src/citra_qt/configure_dialog.h +++ b/src/citra_qt/configure_dialog.h | |||
| @@ -16,7 +16,7 @@ class ConfigureDialog : public QDialog | |||
| 16 | Q_OBJECT | 16 | Q_OBJECT |
| 17 | 17 | ||
| 18 | public: | 18 | public: |
| 19 | explicit ConfigureDialog(QWidget *parent, bool emulation_running); | 19 | explicit ConfigureDialog(QWidget *parent); |
| 20 | ~ConfigureDialog(); | 20 | ~ConfigureDialog(); |
| 21 | 21 | ||
| 22 | void applyConfiguration(); | 22 | void applyConfiguration(); |
| @@ -26,5 +26,4 @@ private: | |||
| 26 | 26 | ||
| 27 | private: | 27 | private: |
| 28 | std::unique_ptr<Ui::ConfigureDialog> ui; | 28 | std::unique_ptr<Ui::ConfigureDialog> ui; |
| 29 | bool emulation_running; | ||
| 30 | }; | 29 | }; |
diff --git a/src/citra_qt/configure_system.cpp b/src/citra_qt/configure_system.cpp index 4f0d4dbfe..55d964242 100644 --- a/src/citra_qt/configure_system.cpp +++ b/src/citra_qt/configure_system.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | #include "core/hle/service/fs/archive.h" | 9 | #include "core/hle/service/fs/archive.h" |
| 10 | #include "core/hle/service/cfg/cfg.h" | 10 | #include "core/hle/service/cfg/cfg.h" |
| 11 | #include "core/system.h" | ||
| 11 | 12 | ||
| 12 | static const std::array<int, 12> days_in_month = {{ | 13 | static const std::array<int, 12> days_in_month = {{ |
| 13 | 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 | 14 | 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 |
| @@ -17,6 +18,7 @@ ConfigureSystem::ConfigureSystem(QWidget *parent) : | |||
| 17 | QWidget(parent), | 18 | QWidget(parent), |
| 18 | ui(new Ui::ConfigureSystem) { | 19 | ui(new Ui::ConfigureSystem) { |
| 19 | ui->setupUi(this); | 20 | ui->setupUi(this); |
| 21 | this->setConfiguration(); | ||
| 20 | 22 | ||
| 21 | connect(ui->combo_birthmonth, SIGNAL(currentIndexChanged(int)), SLOT(updateBirthdayComboBox(int))); | 23 | connect(ui->combo_birthmonth, SIGNAL(currentIndexChanged(int)), SLOT(updateBirthdayComboBox(int))); |
| 22 | } | 24 | } |
| @@ -24,8 +26,8 @@ ConfigureSystem::ConfigureSystem(QWidget *parent) : | |||
| 24 | ConfigureSystem::~ConfigureSystem() { | 26 | ConfigureSystem::~ConfigureSystem() { |
| 25 | } | 27 | } |
| 26 | 28 | ||
| 27 | void ConfigureSystem::setConfiguration(bool emulation_running) { | 29 | void ConfigureSystem::setConfiguration() { |
| 28 | enabled = !emulation_running; | 30 | enabled = !System::IsPoweredOn(); |
| 29 | 31 | ||
| 30 | if (!enabled) { | 32 | if (!enabled) { |
| 31 | ReadSystemSettings(); | 33 | ReadSystemSettings(); |
diff --git a/src/citra_qt/configure_system.h b/src/citra_qt/configure_system.h index 1f5577070..f02d2d949 100644 --- a/src/citra_qt/configure_system.h +++ b/src/citra_qt/configure_system.h | |||
| @@ -20,7 +20,7 @@ public: | |||
| 20 | ~ConfigureSystem(); | 20 | ~ConfigureSystem(); |
| 21 | 21 | ||
| 22 | void applyConfiguration(); | 22 | void applyConfiguration(); |
| 23 | void setConfiguration(bool emulation_running); | 23 | void setConfiguration(); |
| 24 | 24 | ||
| 25 | public slots: | 25 | public slots: |
| 26 | void updateBirthdayComboBox(int birthmonth_index); | 26 | void updateBirthdayComboBox(int birthmonth_index); |
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 9fd4482f6..cf467532f 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -510,7 +510,7 @@ void GMainWindow::ToggleWindowMode() { | |||
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | void GMainWindow::OnConfigure() { | 512 | void GMainWindow::OnConfigure() { |
| 513 | ConfigureDialog configureDialog(this, emulation_running); | 513 | ConfigureDialog configureDialog(this); |
| 514 | auto result = configureDialog.exec(); | 514 | auto result = configureDialog.exec(); |
| 515 | if (result == QDialog::Accepted) | 515 | if (result == QDialog::Accepted) |
| 516 | { | 516 | { |