Warn portable users if they download the wrong version

This commit is contained in:
Cameron Gutman
2018-09-22 14:16:48 -07:00
parent 97e5acecd7
commit 926b192722
3 changed files with 25 additions and 0 deletions
+14
View File
@@ -37,6 +37,9 @@ GridView {
if (prefs.isRunningWayland()) { if (prefs.isRunningWayland()) {
waylandDialog.open() waylandDialog.open()
} }
else if (prefs.isWow64()) {
wow64Dialog.open()
}
else if (!prefs.hasAnyHardwareAcceleration()) { else if (!prefs.hasAnyHardwareAcceleration()) {
noHwDecoderDialog.open() 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 { MessageDialog {
id: pairDialog id: pairDialog
// don't allow edits to the rest of the window while open // don't allow edits to the rest of the window while open
+9
View File
@@ -89,6 +89,15 @@ bool StreamingPreferences::isRunningWayland()
return qgetenv("XDG_SESSION_TYPE") == QByteArray("wayland"); 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() int StreamingPreferences::getMaximumStreamingFrameRate()
{ {
// Never let the maximum drop below 60 FPS // Never let the maximum drop below 60 FPS
+2
View File
@@ -19,6 +19,8 @@ public:
Q_INVOKABLE static bool isRunningWayland(); Q_INVOKABLE static bool isRunningWayland();
Q_INVOKABLE static bool isWow64();
Q_INVOKABLE static int getMaximumStreamingFrameRate(); Q_INVOKABLE static int getMaximumStreamingFrameRate();
Q_INVOKABLE QRect getDesktopResolution(int displayIndex); Q_INVOKABLE QRect getDesktopResolution(int displayIndex);