Browse Source

Merge branch 'CURA-7017_link_to_help' of github.com:Ultimaker/Cura

Jaime van Kessel 5 years ago
parent
commit
ced25adc2b
1 changed files with 7 additions and 2 deletions
  1. 7 2
      resources/qml/WelcomePages/AddPrinterByIpContent.qml

+ 7 - 2
resources/qml/WelcomePages/AddPrinterByIpContent.qml

@@ -159,6 +159,7 @@ Item
                     enabled: !addPrinterByIpScreen.hasRequestInProgress && !addPrinterByIpScreen.isPrinterDiscovered && (hostnameField.state != "invalid" && hostnameField.text != "")
                     onClicked:
                     {
+                        addPrinterByIpScreen.hasRequestFinished = false //In case it's pressed multiple times.
                         const address = hostnameField.text
                         if (!networkingUtil.isValidIP(address))
                         {
@@ -197,17 +198,21 @@ Item
                     renderType: Text.NativeRendering
 
                     visible: addPrinterByIpScreen.hasRequestInProgress || (addPrinterByIpScreen.hasRequestFinished && !addPrinterByIpScreen.isPrinterDiscovered)
+                    textFormat: Text.RichText
                     text:
                     {
                         if (addPrinterByIpScreen.hasRequestFinished)
                         {
-                            catalog.i18nc("@label", "Could not connect to device.")
+                            return catalog.i18nc("@label", "Could not connect to device.") + "<br /><br /><a href=\"https://ultimaker.com/en/resources/52891-set-up-a-cloud-connection\">"
+                                + catalog.i18nc("@label", "Can't connect to your Ultimaker printer?") + "</a>";
                         }
                         else
                         {
-                            catalog.i18nc("@label", "The printer at this address has not responded yet.")
+                            return catalog.i18nc("@label", "The printer at this address has not responded yet.") + "<br /><br /><a href=\"https://ultimaker.com/en/resources/52891-set-up-a-cloud-connection\">"
+                                + catalog.i18nc("@label", "Can't connect to your Ultimaker printer?") + "</a>";
                         }
                     }
+                    onLinkActivated: Qt.openUrlExternally(link)
                 }
 
                 Item