diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index e2b22312cd..0175d5a2ad 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -90,7 +90,7 @@ Item verticalCenter: parent.verticalCenter } width: 180 * screenScaleFactor // TODO: Theme! - height: printerNameLabel.height + printerFamilyPill.height + 6 * screenScaleFactor // TODO: Theme! + height: childrenRect.height Rectangle { @@ -135,6 +135,54 @@ Item } text: printer ? printer.type : "" } + Item + { + id: managePrinterLink + anchors { + top: printerFamilyPill.bottom + topMargin: 6 * screenScaleFactor + } + height: 18 * screenScaleFactor // TODO: Theme! + width: childrenRect.width + + Label + { + id: managePrinterText + anchors.verticalCenter: managePrinterLink.verticalCenter + color: UM.Theme.getColor("monitor_text_link") + font: UM.Theme.getFont("default") + linkColor: UM.Theme.getColor("monitor_text_link") + text: catalog.i18nc("@label link to Connect and Cloud interfaces", "Manage printer") + renderType: Text.NativeRendering + } + UM.RecolorImage + { + id: externalLinkIcon + anchors + { + left: managePrinterText.right + leftMargin: 6 * screenScaleFactor + verticalCenter: managePrinterText.verticalCenter + } + color: UM.Theme.getColor("monitor_text_link") + source: UM.Theme.getIcon("external_link") + width: 12 * screenScaleFactor + height: 12 * screenScaleFactor + } + } + MouseArea + { + anchors.fill: managePrinterLink + onClicked: OutputDevice.openPrintJobControlPanel() + onEntered: + { + manageQueueText.font.underline = true + } + onExited: + { + manageQueueText.font.underline = false + } + } } MonitorPrinterConfiguration diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index 5f9748c36d..259770857d 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -258,11 +258,11 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice): @pyqtSlot(name="openPrintJobControlPanel") def openPrintJobControlPanel(self) -> None: - QDesktopServices.openUrl(QUrl("https://mycloud.ultimaker.com")) + QDesktopServices.openUrl(QUrl(self.clusterCloudUrl)) @pyqtSlot(name="openPrinterControlPanel") def openPrinterControlPanel(self) -> None: - QDesktopServices.openUrl(QUrl("https://mycloud.ultimaker.com")) + QDesktopServices.openUrl(QUrl(self.clusterCloudUrl)) ## Gets the cluster response from which this device was created. @property @@ -273,3 +273,9 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice): @clusterData.setter def clusterData(self, value: CloudClusterResponse) -> None: self._cluster = value + + ## Gets the URL on which to monitor the cluster via the cloud. + @property + def clusterCloudUrl(self) -> str: + root_url_prefix = "-staging" if self._account.is_staging else "" + return "https://mycloud{}.ultimaker.com/app/jobs/{}".format(root_url_prefix, self.clusterData.cluster_id)