Skip to content

Commit

Permalink
DolphinQt: Fix the enabling/disabling of ControllersWindow buttons
Browse files Browse the repository at this point in the history
Without this change, calling OnEmulationStateChanged undoes part
of the enabling/disabling that OnWiimoteModeChanged has done.
  • Loading branch information
JosJuice committed Nov 3, 2019
1 parent 0f4c971 commit ef1bae5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Source/Core/DolphinQt/Config/ControllersWindow.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -377,23 +377,25 @@ void ControllersWindow::OnWiimoteRefreshPressed()


void ControllersWindow::OnEmulationStateChanged(bool running) void ControllersWindow::OnEmulationStateChanged(bool running)
{ {
const bool passthrough = SConfig::GetInstance().m_bt_passthrough_enabled;

if (!SConfig::GetInstance().bWii) if (!SConfig::GetInstance().bWii)
{ {
m_wiimote_sync->setEnabled(!running); m_wiimote_sync->setEnabled(!running && passthrough);
m_wiimote_reset->setEnabled(!running); m_wiimote_reset->setEnabled(!running && passthrough);


for (size_t i = 0; i < m_wiimote_groups.size(); i++) for (size_t i = 0; i < m_wiimote_groups.size(); i++)
m_wiimote_boxes[i]->setEnabled(!running); m_wiimote_boxes[i]->setEnabled(!running && !passthrough);
} }


m_wiimote_emu->setEnabled(!running); m_wiimote_emu->setEnabled(!running);
m_wiimote_passthrough->setEnabled(!running); m_wiimote_passthrough->setEnabled(!running);


if (!SConfig::GetInstance().bWii) if (!SConfig::GetInstance().bWii)
{ {
m_wiimote_real_balance_board->setEnabled(!running); m_wiimote_real_balance_board->setEnabled(!running && !passthrough);
m_wiimote_continuous_scanning->setEnabled(!running); m_wiimote_continuous_scanning->setEnabled(!running && !passthrough);
m_wiimote_speaker_data->setEnabled(!running); m_wiimote_speaker_data->setEnabled(!running && !passthrough);
} }
} }


Expand Down

0 comments on commit ef1bae5

Please sign in to comment.