summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-03-09 16:10:14 +0100
committerGitHub <noreply@github.com>2023-03-09 16:10:14 +0100
commit8c7997d6caeca76d663fbb45ab7e3099bd4dda6b (patch)
tree8f3a5da7e26bfbd2a5210337b7fd9efca8b9076d /Source
parent234c5dd90e31cbbe6782b4a6c6ae5f2f578e199b (diff)
parentd18735e82ea3372d407bb313b0af65692ca5ad05 (diff)
Merge pull request #11601 from Dentomologist/bluetooth_adapter_missing_message
Config: Restore Bluetooth adapter missing message in Controller Settings
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp5
-rw-r--r--Source/Core/Core/HW/WiimoteReal/WiimoteReal.h1
-rw-r--r--Source/Core/DolphinQt/Config/ControllersWindow.cpp6
-rw-r--r--Source/Core/DolphinQt/Config/ControllersWindow.h4
-rw-r--r--Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp9
-rw-r--r--Source/Core/DolphinQt/Config/WiimoteControllersWidget.h3
6 files changed, 28 insertions, 0 deletions
diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp
index 10fa8f2686..abd90979f7 100644
--- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp
+++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp
@@ -131,6 +131,11 @@ void ProcessWiimotePool()
}
}
+bool IsScannerReady()
+{
+ return s_wiimote_scanner.IsReady();
+}
+
void AddWiimoteToPool(std::unique_ptr<Wiimote> wiimote)
{
// Our real wiimote class requires an index.
diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h
index e597d774bc..39f13f0f44 100644
--- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h
+++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h
@@ -223,4 +223,5 @@ void InitAdapterClass();
void HandleWiimotesInControllerInterfaceSettingChange();
void PopulateDevices();
void ProcessWiimotePool();
+bool IsScannerReady();
} // namespace WiimoteReal
diff --git a/Source/Core/DolphinQt/Config/ControllersWindow.cpp b/Source/Core/DolphinQt/Config/ControllersWindow.cpp
index 52c8e25f9a..2470910e8e 100644
--- a/Source/Core/DolphinQt/Config/ControllersWindow.cpp
+++ b/Source/Core/DolphinQt/Config/ControllersWindow.cpp
@@ -23,6 +23,12 @@ ControllersWindow::ControllersWindow(QWidget* parent) : QDialog(parent)
ConnectWidgets();
}
+void ControllersWindow::showEvent(QShowEvent* event)
+{
+ QDialog::showEvent(event);
+ m_wiimote_controllers->UpdateBluetoothAvailableStatus();
+}
+
void ControllersWindow::CreateMainLayout()
{
auto* layout = new QVBoxLayout();
diff --git a/Source/Core/DolphinQt/Config/ControllersWindow.h b/Source/Core/DolphinQt/Config/ControllersWindow.h
index 159efdfe88..234110e804 100644
--- a/Source/Core/DolphinQt/Config/ControllersWindow.h
+++ b/Source/Core/DolphinQt/Config/ControllersWindow.h
@@ -8,6 +8,7 @@
class CommonControllersWidget;
class GamecubeControllersWidget;
class QDialogButtonBox;
+class QShowEvent;
class WiimoteControllersWidget;
class ControllersWindow final : public QDialog
@@ -16,6 +17,9 @@ class ControllersWindow final : public QDialog
public:
explicit ControllersWindow(QWidget* parent);
+protected:
+ void showEvent(QShowEvent* event) override;
+
private:
void CreateMainLayout();
void ConnectWidgets();
diff --git a/Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp b/Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp
index 21b0fc1b33..28f15a46d7 100644
--- a/Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp
+++ b/Source/Core/DolphinQt/Config/WiimoteControllersWidget.cpp
@@ -50,6 +50,11 @@ WiimoteControllersWidget::WiimoteControllersWidget(QWidget* parent) : QWidget(pa
LoadSettings(Core::GetState());
}
+void WiimoteControllersWidget::UpdateBluetoothAvailableStatus()
+{
+ m_bluetooth_unavailable->setHidden(WiimoteReal::IsScannerReady());
+}
+
static int GetRadioButtonIndicatorWidth()
{
const QStyle* style = QApplication::style();
@@ -151,6 +156,10 @@ void WiimoteControllersWidget::CreateLayout()
m_wiimote_layout->addWidget(m_wiimote_continuous_scanning, continuous_scanning_row, 0, 1, 3);
m_wiimote_layout->addWidget(m_wiimote_refresh, continuous_scanning_row, 3);
+ m_bluetooth_unavailable = new QLabel(tr("A supported Bluetooth device could not be found.\n"
+ "You must manually connect your Wii Remote."));
+ m_wiimote_layout->addWidget(m_bluetooth_unavailable, m_wiimote_layout->rowCount(), 1, 1, -1);
+
auto* layout = new QVBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
layout->setAlignment(Qt::AlignTop);
diff --git a/Source/Core/DolphinQt/Config/WiimoteControllersWidget.h b/Source/Core/DolphinQt/Config/WiimoteControllersWidget.h
index e8cf91ce4b..d81e6f0653 100644
--- a/Source/Core/DolphinQt/Config/WiimoteControllersWidget.h
+++ b/Source/Core/DolphinQt/Config/WiimoteControllersWidget.h
@@ -27,6 +27,8 @@ class WiimoteControllersWidget final : public QWidget
public:
explicit WiimoteControllersWidget(QWidget* parent);
+ void UpdateBluetoothAvailableStatus();
+
private:
void SaveSettings();
void OnBluetoothPassthroughSyncPressed();
@@ -55,4 +57,5 @@ private:
QCheckBox* m_wiimote_speaker_data;
QCheckBox* m_wiimote_ciface;
QPushButton* m_wiimote_refresh;
+ QLabel* m_bluetooth_unavailable;
};