This commit is contained in:
David Marcec 2018-11-07 20:12:27 +11:00
parent 41e99d8880
commit fd1ef25257
3 changed files with 17 additions and 12 deletions

View file

@ -60,7 +60,7 @@ public:
void OperationModeChanged(); void OperationModeChanged();
private: private:
std::queue<AppletMessage> messages{}; std::queue<AppletMessage> messages;
Kernel::SharedPtr<Kernel::Event> on_new_message; Kernel::SharedPtr<Kernel::Event> on_new_message;
Kernel::SharedPtr<Kernel::Event> on_operation_mode_changed; Kernel::SharedPtr<Kernel::Event> on_operation_mode_changed;
}; };

View file

@ -41,17 +41,8 @@ void ConfigureGeneral::PopulateHotkeyList(const HotkeyRegistry& registry) {
ui->widget->Populate(registry); ui->widget->Populate(registry);
} }
void ConfigureGeneral::applyConfiguration() { void ConfigureGeneral::CheckIfOperationChanged(bool last_state, bool new_state) {
UISettings::values.gamedir_deepscan = ui->toggle_deepscan->isChecked(); if (last_state != new_state) {
UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked();
UISettings::values.theme =
ui->theme_combobox->itemData(ui->theme_combobox->currentIndex()).toString();
Settings::values.use_cpu_jit = ui->use_cpu_jit->isChecked();
const bool pre_docked_mode = Settings::values.use_docked_mode;
Settings::values.use_docked_mode = ui->use_docked_mode->isChecked();
if (pre_docked_mode != Settings::values.use_docked_mode) {
Core::System& system{Core::System::GetInstance()}; Core::System& system{Core::System::GetInstance()};
Service::SM::ServiceManager& sm = system.ServiceManager(); Service::SM::ServiceManager& sm = system.ServiceManager();
@ -70,5 +61,18 @@ void ConfigureGeneral::applyConfiguration() {
applet_ae->GetMessageQueue()->OperationModeChanged(); applet_ae->GetMessageQueue()->OperationModeChanged();
} }
} }
}
void ConfigureGeneral::applyConfiguration() {
UISettings::values.gamedir_deepscan = ui->toggle_deepscan->isChecked();
UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked();
UISettings::values.theme =
ui->theme_combobox->itemData(ui->theme_combobox->currentIndex()).toString();
Settings::values.use_cpu_jit = ui->use_cpu_jit->isChecked();
const bool pre_docked_mode = Settings::values.use_docked_mode;
Settings::values.use_docked_mode = ui->use_docked_mode->isChecked();
CheckIfOperationChanged(pre_docked_mode, Settings::values.use_docked_mode);
Settings::values.enable_nfc = ui->enable_nfc->isChecked(); Settings::values.enable_nfc = ui->enable_nfc->isChecked();
} }

View file

@ -25,6 +25,7 @@ public:
private: private:
void setConfiguration(); void setConfiguration();
void CheckIfOperationChanged(bool last_state, bool new_state);
std::unique_ptr<Ui::ConfigureGeneral> ui; std::unique_ptr<Ui::ConfigureGeneral> ui;
}; };