summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt2/Config/ControllersWindow.cpp
diff options
context:
space:
mode:
authorMichael Maltese <mchtly@gmail.com>2017-06-22 15:11:53 -0700
committerMichael Maltese <mchtly@gmail.com>2017-06-29 17:17:32 -0700
commitd0fdb9f1491db121d37a7a807293c84f32adbad3 (patch)
tree5d288988e78f49fca117c21d708e605c86c929b0 /Source/Core/DolphinQt2/Config/ControllersWindow.cpp
parent898bbffaa7cd124801f4682270e1b8d38840dc24 (diff)
DolphinQt2: replace Settings with SConfig where possible
Changes: - `ShowDevelopmentWarning` is now under the '[Interface]' group in Dolphin.ini, with other interface-related settings. So, whoever uses DolphinQt will have to edit that manually again. Sorry! - Game search paths and the last file are now shared properly with DolphinWX - Qt-only preferences like "Preferred View: list/table" are now stored using the platform's native settings storage, rather than in UI.ini
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();
}