diff --git a/app/gui/CliQuitStreamSegue.qml b/app/gui/CliQuitStreamSegue.qml
index 2afc4e61..b2663d19 100644
--- a/app/gui/CliQuitStreamSegue.qml
+++ b/app/gui/CliQuitStreamSegue.qml
@@ -50,11 +50,12 @@ Item {
}
}
- MessageDialog {
+ ErrorMessageDialog {
id: errorDialog
- modality:Qt.WindowModal
- icon: StandardIcon.Critical
- standardButtons: StandardButton.Ok
+
+ onHelp: {
+ Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting");
+ }
onVisibleChanged: {
if (!visible) {
diff --git a/app/gui/CliStartStreamSegue.qml b/app/gui/CliStartStreamSegue.qml
index 7571495e..75f150ee 100644
--- a/app/gui/CliStartStreamSegue.qml
+++ b/app/gui/CliStartStreamSegue.qml
@@ -64,14 +64,13 @@ Item {
}
}
- MessageDialog {
+ ErrorMessageDialog {
id: errorDialog
- modality:Qt.WindowModal
- icon: StandardIcon.Critical
- standardButtons: StandardButton.Ok | StandardButton.Help
+
onHelp: {
Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting");
}
+
onVisibleChanged: {
if (!visible) {
Qt.quit();
diff --git a/app/gui/ErrorMessageDialog.qml b/app/gui/ErrorMessageDialog.qml
new file mode 100644
index 00000000..4e1289e0
--- /dev/null
+++ b/app/gui/ErrorMessageDialog.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QtQuick.Dialogs 1.2
+
+import SystemProperties 1.0
+
+MessageDialog {
+ property string helpText
+
+ informativeText: SystemProperties.hasBrowser ? helpText : ""
+ icon: StandardIcon.Critical
+ standardButtons: StandardButton.Ok |
+ (SystemProperties.hasBrowser ? StandardButton.Help : 0)
+}
diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml
index 3969b5f0..c544a7bc 100644
--- a/app/gui/PcView.qml
+++ b/app/gui/PcView.qml
@@ -54,6 +54,7 @@ GridView {
// Display a failed dialog if we got an error
if (error !== undefined) {
errorDialog.text = error
+ errorDialog.helpText = ""
errorDialog.open()
}
}
@@ -61,7 +62,8 @@ GridView {
function addComplete(success)
{
if (!success) {
- errorDialog.text = "Unable to connect to the specified PC. Click the Help button for possible solutions."
+ errorDialog.text = "Unable to connect to the specified PC."
+ errorDialog.helpText = "Click the Help button for possible solutions."
errorDialog.open()
}
}
@@ -171,6 +173,7 @@ GridView {
else {
// cannot pair while something is streaming or attempting to pair
errorDialog.text = "You cannot pair while a previous session is still running on the host PC. Quit any running games or reboot the host PC, then try pairing again."
+ errorDialog.helpText = ""
errorDialog.open()
}
}
@@ -210,12 +213,8 @@ GridView {
}
}
- MessageDialog {
+ ErrorMessageDialog {
id: errorDialog
- // don't allow edits to the rest of the window while open
- modality:Qt.WindowModal
- icon: StandardIcon.Critical
- standardButtons: StandardButton.Ok | StandardButton.Help
onHelp: {
// Using Setup-Guide here instead of Troubleshooting because it's likely that users
// will arrive here by forgetting to enable GameStream or not forwarding ports.
diff --git a/app/gui/QuitSegue.qml b/app/gui/QuitSegue.qml
index 1958ff95..aa87df44 100644
--- a/app/gui/QuitSegue.qml
+++ b/app/gui/QuitSegue.qml
@@ -69,10 +69,10 @@ Item {
}
}
- MessageDialog {
+ ErrorMessageDialog {
id: errorDialog
- modality:Qt.WindowModal
- icon: StandardIcon.Critical
- standardButtons: StandardButton.Ok
+ onHelp: {
+ Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting");
+ }
}
}
diff --git a/app/gui/StreamSegue.qml b/app/gui/StreamSegue.qml
index 312423b1..e8ecb29c 100644
--- a/app/gui/StreamSegue.qml
+++ b/app/gui/StreamSegue.qml
@@ -174,24 +174,17 @@ Item {
wrapMode: Text.Wrap
}
- MessageDialog {
+ ErrorMessageDialog {
id: errorDialog
- modality:Qt.WindowModal
- icon: StandardIcon.Critical
- standardButtons: StandardButton.Ok | StandardButton.Help
- onAccepted: {
- if (quitAfter) {
+ onVisibleChanged: {
+ if (!visible) {
Qt.quit()
}
}
onHelp: {
Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting");
-
- if (quitAfter) {
- Qt.quit()
- }
}
}
}
diff --git a/app/gui/main.qml b/app/gui/main.qml
index 83b6c564..43122940 100644
--- a/app/gui/main.qml
+++ b/app/gui/main.qml
@@ -256,6 +256,7 @@ ApplicationWindow {
NavigableToolButton {
id: helpButton
+ visible: SystemProperties.hasBrowser
Image {
source: "qrc:/res/question_mark.svg"
@@ -342,26 +343,23 @@ ApplicationWindow {
}
}
- MessageDialog {
+ ErrorMessageDialog {
id: noHwDecoderDialog
- modality:Qt.WindowModal
icon: StandardIcon.Warning
- standardButtons: StandardButton.Ok | StandardButton.Help
text: "No functioning hardware accelerated H.264 video decoder was detected by Moonlight. " +
- "Your streaming performance may be severely degraded in this configuration. " +
- "Click the Help button for more information on solving this problem."
+ "Your streaming performance may be severely degraded in this configuration."
+ helpText: "Click the Help button for more information on solving this problem."
onHelp: {
Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-docs/wiki/Fixing-Hardware-Decoding-Problems");
}
}
- MessageDialog {
+ ErrorMessageDialog {
id: waylandDialog
- modality:Qt.WindowModal
icon: StandardIcon.Warning
- standardButtons: StandardButton.Ok | StandardButton.Help
text: "Moonlight does not support hardware acceleration on Wayland. Continuing on Wayland may result in poor streaming performance. " +
"Please switch to an X session for optimal performance."
+ helpText: "Click the Help button for more information."
onHelp: {
Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-docs/wiki/Fixing-Hardware-Decoding-Problems");
}
@@ -369,7 +367,6 @@ ApplicationWindow {
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."
@@ -378,15 +375,12 @@ ApplicationWindow {
}
}
- MessageDialog {
+ ErrorMessageDialog {
id: unmappedGamepadDialog
property string unmappedGamepads : ""
- modality:Qt.WindowModal
icon: StandardIcon.Warning
- standardButtons: StandardButton.Ok | StandardButton.Help
- text: "Moonlight detected gamepads without a proper mapping. " +
- "The following gamepads will not function until this is resolved: " + unmappedGamepads + "\n\n" +
- "Click the Help button for information on how to map your gamepads."
+ text: "Moonlight detected gamepads without a mapping:\n" + unmappedGamepads
+ helpText: "Click the Help button for information on how to map your gamepads."
onHelp: {
Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-docs/wiki/Gamepad-Mapping");
}
@@ -395,7 +389,6 @@ ApplicationWindow {
// This dialog appears when quitting via keyboard or gamepad button
MessageDialog {
id: quitConfirmationDialog
- modality:Qt.WindowModal
icon: StandardIcon.Warning
standardButtons: StandardButton.Yes | StandardButton.No
text: "Are you sure you want to quit?"
diff --git a/app/qml.qrc b/app/qml.qrc
index 73d49baf..af31c758 100644
--- a/app/qml.qrc
+++ b/app/qml.qrc
@@ -14,5 +14,6 @@
gui/CliStartStreamSegue.qml
gui/AutoResizingComboBox.qml
gui/NavigableMenu.qml
+ gui/ErrorMessageDialog.qml