Qt/GameCubePane: Don't trigger config change events when populating GUI.

This commit is contained in:
Admiral H. Curtiss 2022-04-19 00:39:37 +02:00
parent 67ee78b9dc
commit 1d224d1da5
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 16 additions and 11 deletions

View File

@ -37,6 +37,7 @@
#include "DolphinQt/QtUtils/DolphinFileDialog.h" #include "DolphinQt/QtUtils/DolphinFileDialog.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h" #include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h" #include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
#include "DolphinQt/QtUtils/SignalBlocking.h"
#include "DolphinQt/Settings.h" #include "DolphinQt/Settings.h"
#include "DolphinQt/Settings/BroadbandAdapterSettingsDialog.h" #include "DolphinQt/Settings/BroadbandAdapterSettingsDialog.h"
@ -438,9 +439,9 @@ void GameCubePane::BrowseGBASaves()
void GameCubePane::LoadSettings() void GameCubePane::LoadSettings()
{ {
// IPL Settings // IPL Settings
m_skip_main_menu->setChecked(Config::Get(Config::MAIN_SKIP_IPL)); SignalBlocking(m_skip_main_menu)->setChecked(Config::Get(Config::MAIN_SKIP_IPL));
m_language_combo->setCurrentIndex( SignalBlocking(m_language_combo)
m_language_combo->findData(Config::Get(Config::MAIN_GC_LANGUAGE))); ->setCurrentIndex(m_language_combo->findData(Config::Get(Config::MAIN_GC_LANGUAGE)));
bool have_menu = false; bool have_menu = false;
@ -461,22 +462,26 @@ void GameCubePane::LoadSettings()
// Device Settings // Device Settings
for (ExpansionInterface::Slot slot : ExpansionInterface::SLOTS) for (ExpansionInterface::Slot slot : ExpansionInterface::SLOTS)
{ {
QSignalBlocker blocker(m_slot_combos[slot]);
const ExpansionInterface::EXIDeviceType exi_device = const ExpansionInterface::EXIDeviceType exi_device =
Config::Get(Config::GetInfoForEXIDevice(slot)); Config::Get(Config::GetInfoForEXIDevice(slot));
m_slot_combos[slot]->setCurrentIndex( SignalBlocking(m_slot_combos[slot])
m_slot_combos[slot]->findData(static_cast<int>(exi_device))); ->setCurrentIndex(m_slot_combos[slot]->findData(static_cast<int>(exi_device)));
UpdateButton(slot); UpdateButton(slot);
} }
#ifdef HAS_LIBMGBA #ifdef HAS_LIBMGBA
// GBA Settings // GBA Settings
m_gba_threads->setChecked(Config::Get(Config::MAIN_GBA_THREADS)); SignalBlocking(m_gba_threads)->setChecked(Config::Get(Config::MAIN_GBA_THREADS));
m_gba_bios_edit->setText(QString::fromStdString(File::GetUserPath(F_GBABIOS_IDX))); SignalBlocking(m_gba_bios_edit)
m_gba_save_rom_path->setChecked(Config::Get(Config::MAIN_GBA_SAVES_IN_ROM_PATH)); ->setText(QString::fromStdString(File::GetUserPath(F_GBABIOS_IDX)));
m_gba_saves_edit->setText(QString::fromStdString(File::GetUserPath(D_GBASAVES_IDX))); SignalBlocking(m_gba_save_rom_path)->setChecked(Config::Get(Config::MAIN_GBA_SAVES_IN_ROM_PATH));
SignalBlocking(m_gba_saves_edit)
->setText(QString::fromStdString(File::GetUserPath(D_GBASAVES_IDX)));
for (size_t i = 0; i < m_gba_rom_edits.size(); ++i) for (size_t i = 0; i < m_gba_rom_edits.size(); ++i)
m_gba_rom_edits[i]->setText(QString::fromStdString(Config::Get(Config::MAIN_GBA_ROM_PATHS[i]))); {
SignalBlocking(m_gba_rom_edits[i])
->setText(QString::fromStdString(Config::Get(Config::MAIN_GBA_ROM_PATHS[i])));
}
#endif #endif
} }