From 926b19272273ae284a3683cd7bd2d33f8e914716 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 22 Sep 2018 14:16:48 -0700 Subject: [PATCH] Warn portable users if they download the wrong version --- app/gui/PcView.qml | 14 ++++++++++++++ app/settings/streamingpreferences.cpp | 9 +++++++++ app/settings/streamingpreferences.h | 2 ++ 3 files changed, 25 insertions(+) diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index bfdc2e82..6c22d80c 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -37,6 +37,9 @@ GridView { if (prefs.isRunningWayland()) { waylandDialog.open() } + else if (prefs.isWow64()) { + wow64Dialog.open() + } else if (!prefs.hasAnyHardwareAcceleration()) { noHwDecoderDialog.open() } @@ -224,6 +227,17 @@ GridView { } } + MessageDialog { + id: wow64Dialog + modality:Qt.WindowModal + icon: StandardIcon.Warning + standardButtons: StandardButton.Ok | StandardButton.Cancel + text: "This PC is running a 64-bit version of Windows. Please download the x64 version of Moonlight for the best streaming performance." + onAccepted: { + Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-qt/releases"); + } + } + MessageDialog { id: pairDialog // don't allow edits to the rest of the window while open diff --git a/app/settings/streamingpreferences.cpp b/app/settings/streamingpreferences.cpp index 2d5b2a9e..06ed5a38 100644 --- a/app/settings/streamingpreferences.cpp +++ b/app/settings/streamingpreferences.cpp @@ -89,6 +89,15 @@ bool StreamingPreferences::isRunningWayland() return qgetenv("XDG_SESSION_TYPE") == QByteArray("wayland"); } +bool StreamingPreferences::isWow64() +{ +#ifdef Q_OS_WIN32 + return QSysInfo::currentCpuArchitecture() != QSysInfo::buildCpuArchitecture(); +#else + return false; +#endif +} + int StreamingPreferences::getMaximumStreamingFrameRate() { // Never let the maximum drop below 60 FPS diff --git a/app/settings/streamingpreferences.h b/app/settings/streamingpreferences.h index 673fc738..2cd1395f 100644 --- a/app/settings/streamingpreferences.h +++ b/app/settings/streamingpreferences.h @@ -19,6 +19,8 @@ public: Q_INVOKABLE static bool isRunningWayland(); + Q_INVOKABLE static bool isWow64(); + Q_INVOKABLE static int getMaximumStreamingFrameRate(); Q_INVOKABLE QRect getDesktopResolution(int displayIndex);