summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt2/Config/ControllersWindow.cpp
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-07-04 13:45:21 +0200
committerGitHub <noreply@github.com>2017-07-04 13:45:21 +0200
commitaa1d750f30f94e2c80ecc3e8ad9cc865e2076b78 (patch)
tree9ac2c5fde8d776f61920b356c959c1ee181bfdba /Source/Core/DolphinQt2/Config/ControllersWindow.cpp
parent365892c61c7eb90feb636cbdbf3ecf23895521bf (diff)
parentd0fdb9f1491db121d37a7a807293c84f32adbad3 (diff)
Merge pull request #5664 from ligfx/removesettings
DolphinQt2: replace Settings with SConfig where possible
Diffstat (limited to 'Source/Core/DolphinQt2/Config/ControllersWindow.cpp')
-rw-r--r--Source/Core/DolphinQt2/Config/ControllersWindow.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/Source/Core/DolphinQt2/Config/ControllersWindow.cpp b/Source/Core/DolphinQt2/Config/ControllersWindow.cpp
index 1d96b48ccb..d0ddcf31ad 100644
--- a/Source/Core/DolphinQt2/Config/ControllersWindow.cpp
+++ b/Source/Core/DolphinQt2/Config/ControllersWindow.cpp
@@ -378,7 +378,7 @@ void ControllersWindow::OnWiimoteRefreshPressed()
void ControllersWindow::OnEmulationStateChanged(bool running)
{
- if (!Settings::Instance().IsWiiGameRunning() || NetPlay::IsNetPlayRunning())
+ if (!SConfig::GetInstance().bWii || NetPlay::IsNetPlayRunning())
{
m_wiimote_sync->setEnabled(!running);
m_wiimote_reset->setEnabled(!running);
@@ -390,7 +390,7 @@ void ControllersWindow::OnEmulationStateChanged(bool running)
m_wiimote_emu->setEnabled(!running);
m_wiimote_passthrough->setEnabled(!running);
- if (!Settings::Instance().IsWiiGameRunning())
+ if (!SConfig::GetInstance().bWii)
{
m_wiimote_real_balance_board->setEnabled(!running);
m_wiimote_continuous_scanning->setEnabled(!running);
@@ -478,35 +478,32 @@ void ControllersWindow::UnimplementedButton()
void ControllersWindow::LoadSettings()
{
- auto& settings = Settings::Instance();
for (size_t i = 0; i < m_wiimote_groups.size(); i++)
{
- m_gc_controller_boxes[i]->setCurrentIndex(ToGCMenuIndex(settings.GetSIDevice(i)));
+ m_gc_controller_boxes[i]->setCurrentIndex(ToGCMenuIndex(SConfig::GetInstance().m_SIDevice[i]));
m_wiimote_boxes[i]->setCurrentIndex(ToWiimoteMenuIndex(g_wiimote_sources[i]));
}
m_wiimote_real_balance_board->setChecked(g_wiimote_sources[WIIMOTE_BALANCE_BOARD] ==
WIIMOTE_SRC_REAL);
- m_wiimote_speaker_data->setChecked(settings.IsWiimoteSpeakerEnabled());
- m_wiimote_continuous_scanning->setChecked(settings.IsContinuousScanningEnabled());
+ m_wiimote_speaker_data->setChecked(SConfig::GetInstance().m_WiimoteEnableSpeaker);
+ m_wiimote_continuous_scanning->setChecked(SConfig::GetInstance().m_WiimoteContinuousScanning);
- m_advanced_bg_input->setChecked(settings.IsBackgroundInputEnabled());
+ m_advanced_bg_input->setChecked(SConfig::GetInstance().m_BackgroundInput);
- if (settings.IsBluetoothPassthroughEnabled())
+ if (SConfig::GetInstance().m_bt_passthrough_enabled)
m_wiimote_passthrough->setChecked(true);
else
m_wiimote_emu->setChecked(true);
- OnWiimoteModeChanged(settings.IsBluetoothPassthroughEnabled());
+ OnWiimoteModeChanged(SConfig::GetInstance().m_bt_passthrough_enabled);
}
void ControllersWindow::SaveSettings()
{
- auto& settings = Settings::Instance();
- settings.SetWiimoteSpeakerEnabled(m_wiimote_speaker_data->isChecked());
- settings.SetContinuousScanningEnabled(m_wiimote_continuous_scanning->isChecked());
-
- settings.SetBluetoothPassthroughEnabled(m_wiimote_passthrough->isChecked());
- settings.SetBackgroundInputEnabled(m_advanced_bg_input->isChecked());
+ SConfig::GetInstance().m_WiimoteEnableSpeaker = m_wiimote_speaker_data->isChecked();
+ SConfig::GetInstance().m_WiimoteContinuousScanning = m_wiimote_continuous_scanning->isChecked();
+ SConfig::GetInstance().m_bt_passthrough_enabled = m_wiimote_passthrough->isChecked();
+ SConfig::GetInstance().m_BackgroundInput = m_advanced_bg_input->isChecked();
WiimoteReal::ChangeWiimoteSource(WIIMOTE_BALANCE_BOARD,
m_wiimote_real_balance_board->isChecked() ? WIIMOTE_SRC_REAL :
@@ -524,8 +521,8 @@ void ControllersWindow::SaveSettings()
for (size_t i = 0; i < m_gc_groups.size(); i++)
{
const int index = m_gc_controller_boxes[i]->currentIndex();
- settings.SetSIDevice(i, FromGCMenuIndex(index));
+ SConfig::GetInstance().m_SIDevice[i] = FromGCMenuIndex(index);
m_gc_buttons[i]->setEnabled(index != 0 && index != 6);
}
- settings.Save();
+ SConfig::GetInstance().SaveSettings();
}