Merge pull request #3911 from BreadFish64/fix-setting-change-freeze
citra-qt: optimize settings application
This commit is contained in:
commit
9c1c899243
|
@ -61,7 +61,6 @@ void ConfigureAudio::applyConfiguration() {
|
||||||
Settings::values.audio_device_id =
|
Settings::values.audio_device_id =
|
||||||
ui->audio_device_combo_box->itemText(ui->audio_device_combo_box->currentIndex())
|
ui->audio_device_combo_box->itemText(ui->audio_device_combo_box->currentIndex())
|
||||||
.toStdString();
|
.toStdString();
|
||||||
Settings::Apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureAudio::updateAudioDevices(int sink_index) {
|
void ConfigureAudio::updateAudioDevices(int sink_index) {
|
||||||
|
|
|
@ -285,7 +285,6 @@ void ConfigureCamera::applyConfiguration() {
|
||||||
Settings::values.camera_name = camera_name;
|
Settings::values.camera_name = camera_name;
|
||||||
Settings::values.camera_config = camera_config;
|
Settings::values.camera_config = camera_config;
|
||||||
Settings::values.camera_flip = camera_flip;
|
Settings::values.camera_flip = camera_flip;
|
||||||
Settings::Apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigureCamera::CameraPosition ConfigureCamera::getCameraSelection() {
|
ConfigureCamera::CameraPosition ConfigureCamera::getCameraSelection() {
|
||||||
|
|
|
@ -44,7 +44,6 @@ void ConfigureDebug::applyConfiguration() {
|
||||||
Log::Filter filter;
|
Log::Filter filter;
|
||||||
filter.ParseFilterString(Settings::values.log_filter);
|
filter.ParseFilterString(Settings::values.log_filter);
|
||||||
Log::SetGlobalFilter(filter);
|
Log::SetGlobalFilter(filter);
|
||||||
Settings::Apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureDebug::retranslateUi() {
|
void ConfigureDebug::retranslateUi() {
|
||||||
|
|
|
@ -68,7 +68,6 @@ void ConfigureGeneral::applyConfiguration() {
|
||||||
|
|
||||||
Settings::values.region_value = ui->region_combobox->currentIndex() - 1;
|
Settings::values.region_value = ui->region_combobox->currentIndex() - 1;
|
||||||
Settings::values.use_cpu_jit = ui->toggle_cpu_jit->isChecked();
|
Settings::values.use_cpu_jit = ui->toggle_cpu_jit->isChecked();
|
||||||
Settings::Apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureGeneral::onLanguageChanged(int index) {
|
void ConfigureGeneral::onLanguageChanged(int index) {
|
||||||
|
|
|
@ -62,7 +62,6 @@ void ConfigureGraphics::applyConfiguration() {
|
||||||
Settings::values.layout_option =
|
Settings::values.layout_option =
|
||||||
static_cast<Settings::LayoutOption>(ui->layout_combobox->currentIndex());
|
static_cast<Settings::LayoutOption>(ui->layout_combobox->currentIndex());
|
||||||
Settings::values.swap_screen = ui->swap_screen->isChecked();
|
Settings::values.swap_screen = ui->swap_screen->isChecked();
|
||||||
Settings::Apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureGraphics::retranslateUi() {
|
void ConfigureGraphics::retranslateUi() {
|
||||||
|
|
|
@ -186,8 +186,6 @@ void ConfigureInput::applyConfiguration() {
|
||||||
[](const Common::ParamPackage& param) { return param.Serialize(); });
|
[](const Common::ParamPackage& param) { return param.Serialize(); });
|
||||||
std::transform(analogs_param.begin(), analogs_param.end(), Settings::values.analogs.begin(),
|
std::transform(analogs_param.begin(), analogs_param.end(), Settings::values.analogs.begin(),
|
||||||
[](const Common::ParamPackage& param) { return param.Serialize(); });
|
[](const Common::ParamPackage& param) { return param.Serialize(); });
|
||||||
|
|
||||||
Settings::Apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureInput::loadConfiguration() {
|
void ConfigureInput::loadConfiguration() {
|
||||||
|
|
|
@ -61,7 +61,6 @@ void ConfigureWeb::applyConfiguration() {
|
||||||
tr("Username and token were not verified. The changes to your "
|
tr("Username and token were not verified. The changes to your "
|
||||||
"username and/or token have not been saved."));
|
"username and/or token have not been saved."));
|
||||||
}
|
}
|
||||||
Settings::Apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureWeb::RefreshTelemetryID() {
|
void ConfigureWeb::RefreshTelemetryID() {
|
||||||
|
|
|
@ -1153,9 +1153,11 @@ void GMainWindow::OnConfigure() {
|
||||||
ConfigureDialog configureDialog(this);
|
ConfigureDialog configureDialog(this);
|
||||||
connect(&configureDialog, &ConfigureDialog::languageChanged, this,
|
connect(&configureDialog, &ConfigureDialog::languageChanged, this,
|
||||||
&GMainWindow::OnLanguageChanged);
|
&GMainWindow::OnLanguageChanged);
|
||||||
|
auto old_theme = UISettings::values.theme;
|
||||||
auto result = configureDialog.exec();
|
auto result = configureDialog.exec();
|
||||||
if (result == QDialog::Accepted) {
|
if (result == QDialog::Accepted) {
|
||||||
configureDialog.applyConfiguration();
|
configureDialog.applyConfiguration();
|
||||||
|
if (UISettings::values.theme != old_theme)
|
||||||
UpdateUITheme();
|
UpdateUITheme();
|
||||||
emit UpdateThemedIcons();
|
emit UpdateThemedIcons();
|
||||||
SyncMenuUISettings();
|
SyncMenuUISettings();
|
||||||
|
|
Reference in New Issue