mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Merge pull request #6024 from ligfx/coreonstatechangedcallback
Qt: use Settings::EmulationStateChanged
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
#include <map>
|
||||
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/HW/SI/SI.h"
|
||||
#include "Core/HW/Wiimote.h"
|
||||
#include "Core/HW/WiimoteReal/WiimoteReal.h"
|
||||
@ -238,6 +239,9 @@ void ControllersWindow::CreateMainLayout()
|
||||
|
||||
void ControllersWindow::ConnectWidgets()
|
||||
{
|
||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
|
||||
[=](Core::State state) { OnEmulationStateChanged(state != Core::State::Uninitialized); });
|
||||
|
||||
connect(m_wiimote_passthrough, &QRadioButton::toggled, this,
|
||||
&ControllersWindow::OnWiimoteModeChanged);
|
||||
|
||||
|
@ -25,9 +25,9 @@ class ControllersWindow final : public QDialog
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ControllersWindow(QWidget* parent);
|
||||
void OnEmulationStateChanged(bool running);
|
||||
|
||||
private:
|
||||
void OnEmulationStateChanged(bool running);
|
||||
void OnWiimoteModeChanged(bool passthrough);
|
||||
void OnWiimoteTypeChanged(int state);
|
||||
void OnGCTypeChanged(int state);
|
||||
|
@ -11,9 +11,11 @@
|
||||
|
||||
#include "Core/Config/GraphicsSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "DolphinQt2/Config/Graphics/GraphicsBool.h"
|
||||
#include "DolphinQt2/Config/Graphics/GraphicsChoice.h"
|
||||
#include "DolphinQt2/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt2/Settings.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
AdvancedWidget::AdvancedWidget(GraphicsWindow* parent) : GraphicsWidget(parent)
|
||||
@ -24,8 +26,8 @@ AdvancedWidget::AdvancedWidget(GraphicsWindow* parent) : GraphicsWidget(parent)
|
||||
AddDescriptions();
|
||||
|
||||
connect(parent, &GraphicsWindow::BackendChanged, this, &AdvancedWidget::OnBackendChanged);
|
||||
connect(parent, &GraphicsWindow::EmulationStarted, [this] { OnEmulationStateChanged(true); });
|
||||
connect(parent, &GraphicsWindow::EmulationStopped, [this] { OnEmulationStateChanged(false); });
|
||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
|
||||
[=](Core::State state) { OnEmulationStateChanged(state != Core::State::Uninitialized); });
|
||||
|
||||
OnBackendChanged();
|
||||
}
|
||||
|
@ -15,9 +15,11 @@
|
||||
|
||||
#include "Core/Config/GraphicsSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "DolphinQt2/Config/Graphics/GraphicsBool.h"
|
||||
#include "DolphinQt2/Config/Graphics/GraphicsChoice.h"
|
||||
#include "DolphinQt2/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt2/Settings.h"
|
||||
#include "UICommon/VideoUtils.h"
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
@ -32,8 +34,8 @@ GeneralWidget::GeneralWidget(X11Utils::XRRConfiguration* xrr_config, GraphicsWin
|
||||
emit BackendChanged(QString::fromStdString(SConfig::GetInstance().m_strVideoBackend));
|
||||
|
||||
connect(parent, &GraphicsWindow::BackendChanged, this, &GeneralWidget::OnBackendChanged);
|
||||
connect(parent, &GraphicsWindow::EmulationStarted, [this] { OnEmulationStateChanged(true); });
|
||||
connect(parent, &GraphicsWindow::EmulationStopped, [this] { OnEmulationStateChanged(false); });
|
||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
|
||||
[=](Core::State state) { OnEmulationStateChanged(state != Core::State::Uninitialized); });
|
||||
}
|
||||
|
||||
void GeneralWidget::CreateWidgets()
|
||||
|
@ -29,9 +29,6 @@ GraphicsWindow::GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindo
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
OnBackendChanged(QString::fromStdString(SConfig::GetInstance().m_strVideoBackend));
|
||||
|
||||
connect(parent, &MainWindow::EmulationStarted, this, &GraphicsWindow::EmulationStarted);
|
||||
connect(parent, &MainWindow::EmulationStopped, this, &GraphicsWindow::EmulationStopped);
|
||||
}
|
||||
|
||||
void GraphicsWindow::CreateMainLayout()
|
||||
|
@ -33,8 +33,6 @@ public:
|
||||
bool eventFilter(QObject* object, QEvent* event) override;
|
||||
signals:
|
||||
void BackendChanged(const QString& backend);
|
||||
void EmulationStarted();
|
||||
void EmulationStopped();
|
||||
|
||||
private:
|
||||
void CreateMainLayout();
|
||||
|
@ -40,15 +40,9 @@ SettingsWindow::SettingsWindow(QWidget* parent) : QDialog(parent)
|
||||
|
||||
AddTab(m_tabs, tr("General"), new GeneralPane(), "config");
|
||||
AddTab(m_tabs, tr("Interface"), new InterfacePane(), "browse");
|
||||
auto* audio_pane = new AudioPane;
|
||||
m_audio_pane_index = AddTab(m_tabs, tr("Audio"), audio_pane, "play");
|
||||
m_audio_pane_index = AddTab(m_tabs, tr("Audio"), new AudioPane(), "play");
|
||||
AddTab(m_tabs, tr("Paths"), new PathPane(), "browse");
|
||||
|
||||
connect(this, &SettingsWindow::EmulationStarted,
|
||||
[audio_pane] { audio_pane->OnEmulationStateChanged(true); });
|
||||
connect(this, &SettingsWindow::EmulationStopped,
|
||||
[audio_pane] { audio_pane->OnEmulationStateChanged(false); });
|
||||
|
||||
// Dialog box buttons
|
||||
QDialogButtonBox* ok_box = new QDialogButtonBox(QDialogButtonBox::Ok);
|
||||
connect(ok_box, &QDialogButtonBox::accepted, this, &SettingsWindow::accept);
|
||||
|
@ -15,10 +15,6 @@ public:
|
||||
explicit SettingsWindow(QWidget* parent = nullptr);
|
||||
void SelectAudioPane();
|
||||
|
||||
signals:
|
||||
void EmulationStarted();
|
||||
void EmulationStopped();
|
||||
|
||||
private:
|
||||
ListTabWidget* m_tabs;
|
||||
int m_audio_pane_index = -1;
|
||||
|
Reference in New Issue
Block a user