mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Merge pull request #8433 from JosJuice/settings-onemulationstatechanged
DolphinQt: Call OnEmulationStateChanged when creating config window panes
This commit is contained in:
commit
2ebea1bfa7
@ -39,14 +39,7 @@ SettingsWindow::SettingsWindow(QWidget* parent) : QDialog(parent)
|
|||||||
m_tab_widget->addTab(GetWrappedWidget(new AudioPane, this, 125, 100), tr("Audio"));
|
m_tab_widget->addTab(GetWrappedWidget(new AudioPane, this, 125, 100), tr("Audio"));
|
||||||
m_tab_widget->addTab(GetWrappedWidget(new PathPane, this, 125, 100), tr("Paths"));
|
m_tab_widget->addTab(GetWrappedWidget(new PathPane, this, 125, 100), tr("Paths"));
|
||||||
m_tab_widget->addTab(GetWrappedWidget(new GameCubePane, this, 125, 100), tr("GameCube"));
|
m_tab_widget->addTab(GetWrappedWidget(new GameCubePane, this, 125, 100), tr("GameCube"));
|
||||||
|
m_tab_widget->addTab(GetWrappedWidget(new WiiPane, this, 125, 100), tr("Wii"));
|
||||||
auto* wii_pane = new WiiPane;
|
|
||||||
m_tab_widget->addTab(GetWrappedWidget(wii_pane, this, 125, 100), tr("Wii"));
|
|
||||||
|
|
||||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, [wii_pane](Core::State state) {
|
|
||||||
wii_pane->OnEmulationStateChanged(state != Core::State::Uninitialized);
|
|
||||||
});
|
|
||||||
|
|
||||||
m_tab_widget->addTab(GetWrappedWidget(new AdvancedPane, this, 125, 200), tr("Advanced"));
|
m_tab_widget->addTab(GetWrappedWidget(new AdvancedPane, this, 125, 200), tr("Advanced"));
|
||||||
|
|
||||||
// Dialog box buttons
|
// Dialog box buttons
|
||||||
|
@ -37,6 +37,8 @@ AudioPane::AudioPane()
|
|||||||
connect(&Settings::Instance(), &Settings::VolumeChanged, this, &AudioPane::OnVolumeChanged);
|
connect(&Settings::Instance(), &Settings::VolumeChanged, this, &AudioPane::OnVolumeChanged);
|
||||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
|
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
|
||||||
[=](Core::State state) { OnEmulationStateChanged(state != Core::State::Uninitialized); });
|
[=](Core::State state) { OnEmulationStateChanged(state != Core::State::Uninitialized); });
|
||||||
|
|
||||||
|
OnEmulationStateChanged(Core::GetState() != Core::State::Uninitialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioPane::CreateWidgets()
|
void AudioPane::CreateWidgets()
|
||||||
|
@ -50,6 +50,8 @@ GeneralPane::GeneralPane(QWidget* parent) : QWidget(parent)
|
|||||||
|
|
||||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
|
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
|
||||||
&GeneralPane::OnEmulationStateChanged);
|
&GeneralPane::OnEmulationStateChanged);
|
||||||
|
|
||||||
|
OnEmulationStateChanged(Core::GetState());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralPane::CreateLayout()
|
void GeneralPane::CreateLayout()
|
||||||
|
@ -48,6 +48,7 @@ WiiPane::WiiPane(QWidget* parent) : QWidget(parent)
|
|||||||
LoadConfig();
|
LoadConfig();
|
||||||
ConnectLayout();
|
ConnectLayout();
|
||||||
ValidateSelectionState();
|
ValidateSelectionState();
|
||||||
|
OnEmulationStateChanged(Core::GetState() != Core::State::Uninitialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WiiPane::CreateLayout()
|
void WiiPane::CreateLayout()
|
||||||
@ -92,6 +93,10 @@ void WiiPane::ConnectLayout()
|
|||||||
connect(m_wiimote_ir_sensitivity, &QSlider::valueChanged, this, &WiiPane::OnSaveConfig);
|
connect(m_wiimote_ir_sensitivity, &QSlider::valueChanged, this, &WiiPane::OnSaveConfig);
|
||||||
connect(m_wiimote_speaker_volume, &QSlider::valueChanged, this, &WiiPane::OnSaveConfig);
|
connect(m_wiimote_speaker_volume, &QSlider::valueChanged, this, &WiiPane::OnSaveConfig);
|
||||||
connect(m_wiimote_motor, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig);
|
connect(m_wiimote_motor, &QCheckBox::toggled, this, &WiiPane::OnSaveConfig);
|
||||||
|
|
||||||
|
// Emulation State
|
||||||
|
connect(&Settings::Instance(), &Settings::EmulationStateChanged,
|
||||||
|
[=](Core::State state) { OnEmulationStateChanged(state != Core::State::Uninitialized); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void WiiPane::CreateMisc()
|
void WiiPane::CreateMisc()
|
||||||
|
@ -19,7 +19,6 @@ class WiiPane : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit WiiPane(QWidget* parent = nullptr);
|
explicit WiiPane(QWidget* parent = nullptr);
|
||||||
void OnEmulationStateChanged(bool running);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void PopulateUSBPassthroughListWidget();
|
void PopulateUSBPassthroughListWidget();
|
||||||
@ -31,6 +30,7 @@ private:
|
|||||||
|
|
||||||
void LoadConfig();
|
void LoadConfig();
|
||||||
void OnSaveConfig();
|
void OnSaveConfig();
|
||||||
|
void OnEmulationStateChanged(bool running);
|
||||||
|
|
||||||
void ValidateSelectionState();
|
void ValidateSelectionState();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user