mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -06:00
DolphinQt2: make Settings a singleton
With this, we can get signals when properties change.
This commit is contained in:
@ -140,11 +140,12 @@ void GeneralPane::CreateAdvanced()
|
||||
|
||||
void GeneralPane::LoadConfig()
|
||||
{
|
||||
m_checkbox_force_ntsc->setChecked(Settings().GetForceNTSCJ());
|
||||
m_checkbox_enable_analytics->setChecked(Settings().GetAnalyticsEnabled());
|
||||
auto& settings = Settings::Instance();
|
||||
m_checkbox_force_ntsc->setChecked(settings.GetForceNTSCJ());
|
||||
m_checkbox_enable_analytics->setChecked(settings.GetAnalyticsEnabled());
|
||||
m_checkbox_dualcore->setChecked(SConfig::GetInstance().bCPUThread);
|
||||
m_checkbox_cheats->setChecked(SConfig::GetInstance().bEnableCheats);
|
||||
int selection = qRound(Settings().GetEmulationSpeed() * 10);
|
||||
int selection = qRound(settings.GetEmulationSpeed() * 10);
|
||||
if (selection < m_combobox_speedlimit->count())
|
||||
m_combobox_speedlimit->setCurrentIndex(selection);
|
||||
m_checkbox_dualcore->setChecked(SConfig::GetInstance().bCPUThread);
|
||||
@ -170,8 +171,9 @@ void GeneralPane::LoadConfig()
|
||||
|
||||
void GeneralPane::OnSaveConfig()
|
||||
{
|
||||
Settings().SetForceNTSCJ(m_checkbox_force_ntsc->isChecked());
|
||||
Settings().SetAnalyticsEnabled(m_checkbox_enable_analytics->isChecked());
|
||||
auto& settings = Settings::Instance();
|
||||
settings.SetForceNTSCJ(m_checkbox_force_ntsc->isChecked());
|
||||
settings.SetAnalyticsEnabled(m_checkbox_enable_analytics->isChecked());
|
||||
SConfig::GetInstance().bCPUThread = m_checkbox_dualcore->isChecked();
|
||||
SConfig::GetInstance().bEnableCheats = m_checkbox_cheats->isChecked();
|
||||
SConfig::GetInstance().m_EmulationSpeed = m_combobox_speedlimit->currentIndex() * 0.1f;
|
||||
|
Reference in New Issue
Block a user