summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt2/Config/ControllersWindow.cpp
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2017-06-05 16:46:36 -0700
committerGitHub <noreply@github.com>2017-06-05 16:46:36 -0700
commitd712914d81c84d5bba62bbad2ccd8c717367427e (patch)
tree68fdd6421ed2f05ffde2d126ae45697ab336f524 /Source/Core/DolphinQt2/Config/ControllersWindow.cpp
parent95ef785b1f181e3bbbc359d2bb20890bba8a1d60 (diff)
parent688f5ed267210cbf8de1ba8be9bbb5f161438fab (diff)
Merge pull request #5504 from ligfx/qtsettingsandpaths
DolphinQt2: rework Settings/PathDialog + empty GameList interaction
Diffstat (limited to 'Source/Core/DolphinQt2/Config/ControllersWindow.cpp')
-rw-r--r--Source/Core/DolphinQt2/Config/ControllersWindow.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/Source/Core/DolphinQt2/Config/ControllersWindow.cpp b/Source/Core/DolphinQt2/Config/ControllersWindow.cpp
index 84490433f5..f7fb269129 100644
--- a/Source/Core/DolphinQt2/Config/ControllersWindow.cpp
+++ b/Source/Core/DolphinQt2/Config/ControllersWindow.cpp
@@ -371,7 +371,7 @@ void ControllersWindow::OnWiimoteRefreshPressed()
void ControllersWindow::OnEmulationStateChanged(bool running)
{
- if (!Settings().IsWiiGameRunning() || NetPlay::IsNetPlayRunning())
+ if (!Settings::Instance().IsWiiGameRunning() || NetPlay::IsNetPlayRunning())
{
m_wiimote_sync->setEnabled(!running);
m_wiimote_reset->setEnabled(!running);
@@ -383,7 +383,7 @@ void ControllersWindow::OnEmulationStateChanged(bool running)
m_wiimote_emu->setEnabled(!running);
m_wiimote_passthrough->setEnabled(!running);
- if (!Settings().IsWiiGameRunning())
+ if (!Settings::Instance().IsWiiGameRunning())
{
m_wiimote_real_balance_board->setEnabled(!running);
m_wiimote_continuous_scanning->setEnabled(!running);
@@ -471,33 +471,35 @@ 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(settings.GetSIDevice(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(settings.IsWiimoteSpeakerEnabled());
+ m_wiimote_continuous_scanning->setChecked(settings.IsContinuousScanningEnabled());
- m_advanced_bg_input->setChecked(Settings().IsBackgroundInputEnabled());
+ m_advanced_bg_input->setChecked(settings.IsBackgroundInputEnabled());
- if (Settings().IsBluetoothPassthroughEnabled())
+ if (settings.IsBluetoothPassthroughEnabled())
m_wiimote_passthrough->setChecked(true);
else
m_wiimote_emu->setChecked(true);
- OnWiimoteModeChanged(Settings().IsBluetoothPassthroughEnabled());
+ OnWiimoteModeChanged(settings.IsBluetoothPassthroughEnabled());
}
void ControllersWindow::SaveSettings()
{
- Settings().SetWiimoteSpeakerEnabled(m_wiimote_speaker_data->isChecked());
- Settings().SetContinuousScanningEnabled(m_wiimote_continuous_scanning->isChecked());
+ 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());
+ settings.SetBluetoothPassthroughEnabled(m_wiimote_passthrough->isChecked());
+ settings.SetBackgroundInputEnabled(m_advanced_bg_input->isChecked());
WiimoteReal::ChangeWiimoteSource(WIIMOTE_BALANCE_BOARD,
m_wiimote_real_balance_board->isChecked() ? WIIMOTE_SRC_REAL :
@@ -515,8 +517,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));
+ settings.SetSIDevice(i, FromGCMenuIndex(index));
m_gc_buttons[i]->setEnabled(index != 0 && index != 6);
}
- Settings().Save();
+ settings.Save();
}