Skip to content

Commit

Permalink
WiiSpeakWindow: Don't hide QGroupBox
Browse files Browse the repository at this point in the history
  • Loading branch information
sepalani committed Sep 22, 2024
1 parent 296bd70 commit 987896a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
13 changes: 5 additions & 8 deletions Source/Core/DolphinQt/EmulatedUSB/WiiSpeakWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <QComboBox>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QString>
#include <QVBoxLayout>

Expand Down Expand Up @@ -38,13 +39,16 @@ WiiSpeakWindow::~WiiSpeakWindow() = default;
void WiiSpeakWindow::CreateMainWindow()
{
auto* main_layout = new QVBoxLayout();
auto* label = new QLabel();
label->setText(QStringLiteral("<center><i>%1</i></center>")
.arg(tr("Some settings cannot be changed when emulation is running.")));
main_layout->addWidget(label);

auto* checkbox_group = new QGroupBox();
auto* checkbox_layout = new QHBoxLayout();
checkbox_layout->setAlignment(Qt::AlignHCenter);
m_checkbox_enabled = new QCheckBox(tr("Emulate Wii Speak"), this);
m_checkbox_enabled->setChecked(Config::Get(Config::MAIN_EMULATE_WII_SPEAK));
connect(m_checkbox_enabled, &QCheckBox::toggled, this, &WiiSpeakWindow::EmulateWiiSpeak);
checkbox_layout->addWidget(m_checkbox_enabled);
checkbox_group->setLayout(checkbox_layout);
main_layout->addWidget(checkbox_group);
Expand Down Expand Up @@ -74,18 +78,11 @@ void WiiSpeakWindow::CreateMainWindow()
config_layout->addWidget(m_combobox_microphones);

m_config_group->setLayout(config_layout);
m_config_group->setVisible(Config::Get(Config::MAIN_EMULATE_WII_SPEAK));
main_layout->addWidget(m_config_group);

setLayout(main_layout);
}

void WiiSpeakWindow::EmulateWiiSpeak(bool emulate)
{
Config::SetBaseOrCurrent(Config::MAIN_EMULATE_WII_SPEAK, emulate);
m_config_group->setVisible(emulate);
}

void WiiSpeakWindow::SetWiiSpeakConnectionState(bool muted)
{
Config::SetBaseOrCurrent(Config::MAIN_WII_SPEAK_MUTED, muted);
Expand Down
1 change: 0 additions & 1 deletion Source/Core/DolphinQt/EmulatedUSB/WiiSpeakWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class WiiSpeakWindow : public QWidget
private:
void CreateMainWindow();
void OnEmulationStateChanged(Core::State state);
void EmulateWiiSpeak(bool emulate);
void SetWiiSpeakConnectionState(bool connected);
void OnInputDeviceChange();

Expand Down

0 comments on commit 987896a

Please sign in to comment.