diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py index 43232da725..b94ca45763 100755 --- a/cura/Settings/GlobalStack.py +++ b/cura/Settings/GlobalStack.py @@ -90,7 +90,6 @@ class GlobalStack(CuraContainerStack): @pyqtProperty("QVariantList", notify=configuredConnectionTypesChanged) def configuredConnectionTypes(self) -> List[int]: """The configured connection types can be used to find out if the global - stack is configured to be connected with a printer, without having to know all the details as to how this is exactly done (and without actually setting the stack to be active). diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index fc11beb2c8..d091ab9f6f 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Ultimaker B.V. +# Copyright (c) 2022 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import time @@ -531,9 +531,9 @@ class MachineManager(QObject): def printerConnected(self) -> bool: return bool(self._printer_output_devices) - @pyqtProperty(bool, notify = printerConnectedStatusChanged) - def activeMachineIsAbstract(self) -> bool: - return (self.activeMachine is not None) and parseBool(self.activeMachine.getMetaDataEntry("is_abstract_machine", False)) + @pyqtProperty(bool, notify = globalContainerChanged) + def activeMachineIsAbstractCloudPrinter(self) -> bool: + return len(self._printer_output_devices) == 1 and self._printer_output_devices[0].__class__.__name__ == "AbstractCloudOutputDevice" @pyqtProperty(bool, notify = printerConnectedStatusChanged) def activeMachineIsGroup(self) -> bool: @@ -559,8 +559,6 @@ class MachineManager(QObject): @pyqtProperty(bool, notify = printerConnectedStatusChanged) def activeMachineHasCloudRegistration(self) -> bool: - if self.activeMachineIsAbstract: - return any(m.getMetaDataEntry("is_online", False) for m in self.getMachinesWithDefinition(self.activeMachine.definition.getId(), True)) return self.activeMachine is not None and ConnectionType.CloudConnection in self.activeMachine.configuredConnectionTypes @pyqtProperty(bool, notify = printerConnectedStatusChanged) diff --git a/plugins/MonitorStage/MonitorMain.qml b/plugins/MonitorStage/MonitorMain.qml index 768366c664..a89938530c 100644 --- a/plugins/MonitorStage/MonitorMain.qml +++ b/plugins/MonitorStage/MonitorMain.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -12,7 +12,6 @@ Rectangle id: viewportOverlay property bool isConnected: Cura.MachineManager.activeMachineHasNetworkConnection || Cura.MachineManager.activeMachineHasCloudConnection - property bool isAbstractCloudPrinter: Cura.MachineManager.activeMachineIsAbstract property bool isNetworkConfigurable: { if(Cura.MachineManager.activeMachine === null) @@ -97,7 +96,7 @@ Rectangle { horizontalCenter: parent.horizontalCenter } - visible: isNetworkConfigured && !isConnected && !isAbstractCloudPrinter + visible: isNetworkConfigured && !isConnected text: catalog.i18nc("@info", "Please make sure your printer has a connection:\n- Check if the printer is turned on.\n- Check if the printer is connected to the network.\n- Check if you are signed in to discover cloud-connected printers.") font: UM.Theme.getFont("medium") width: contentWidth @@ -110,62 +109,19 @@ Rectangle { horizontalCenter: parent.horizontalCenter } - visible: !isNetworkConfigured && isNetworkConfigurable && !isAbstractCloudPrinter + visible: !isNetworkConfigured && isNetworkConfigurable text: catalog.i18nc("@info", "Please connect your printer to the network.") font: UM.Theme.getFont("medium") width: contentWidth } - Rectangle - { - id: sendToFactoryCard - visible: isAbstractCloudPrinter - color: UM.Theme.getColor("detail_background") - height: childrenRect.height + UM.Theme.getSize("default_margin").height * 2 - width: childrenRect.width + UM.Theme.getSize("wide_margin").width * 2 - Column - { - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - spacing: UM.Theme.getSize("wide_margin").height - padding: UM.Theme.getSize("default_margin").width - topPadding: 0 - - Image - { - id: sendToFactoryImage - anchors.horizontalCenter: parent.horizontalCenter - source: UM.Theme.getImage("illustration_connect_printers") - } - - UM.Label - { - anchors.horizontalCenter: parent.horizontalCenter - text: catalog.i18nc("@info", "Monitor your printers from everywhere using Ultimaker Digital Factory") - font: UM.Theme.getFont("medium") - width: sendToFactoryImage.width - wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - - Cura.PrimaryButton - { - id: sendToFactoryButton - anchors.horizontalCenter: parent.horizontalCenter - text: catalog.i18nc("@button", "View printers in Digital Factory") - onClicked: Qt.openUrlExternally("https://digitalfactory.ultimaker.com/app/print-jobs?utm_source=cura&utm_medium=software&utm_campaign=monitor-view-cloud-printer-type") - } - } - } - Item { anchors { left: noNetworkLabel.left } - visible: !isNetworkConfigured && isNetworkConfigurable && !isAbstractCloudPrinter + visible: !isNetworkConfigured && isNetworkConfigurable width: childrenRect.width height: childrenRect.height diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml index 64aa4e7a9c..c0662cfc82 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml @@ -153,7 +153,7 @@ Item MonitorPrinterPill { - text: printJob.configuration.printerType + text: printJob ? printJob.configuration.printerType : "" } } } @@ -173,7 +173,7 @@ Item id: printerConfiguration anchors.verticalCenter: parent.verticalCenter buildplate: catalog.i18nc("@label", "Glass") - configurations: base.printJob.configuration.extruderConfigurations + configurations: base.printJob ? base.printJob.configuration.extruderConfigurations : null height: Math.round(72 * screenScaleFactor) // TODO: Theme! } diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml index 6e8f6b4ebd..c55c00f378 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml @@ -1,8 +1,8 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import UM 1.3 as UM +import QtQuick 2.15 +import UM 1.5 as UM import Cura 1.0 as Cura // This is the root component for the monitor stage. @@ -37,6 +37,7 @@ Component Item { id: printers + visible: !Cura.MachineManager.activeMachineIsAbstractCloudPrinter anchors { top: parent.top @@ -69,14 +70,66 @@ Component top: printers.bottom topMargin: 48 * screenScaleFactor // TODO: Theme! } - visible: OutputDevice.supportsPrintJobQueue && OutputDevice.canReadPrintJobs + visible: OutputDevice.supportsPrintJobQueue && OutputDevice.canReadPrintJobs && !Cura.MachineManager.activeMachineIsAbstractCloudPrinter } PrinterVideoStream { anchors.fill: parent cameraUrl: OutputDevice.activeCameraUrl - visible: OutputDevice.activeCameraUrl != "" + visible: OutputDevice.activeCameraUrl != "" && !Cura.MachineManager.activeMachineIsAbstractCloudPrinter + } + + Rectangle + { + id: sendToFactoryCard + + visible: Cura.MachineManager.activeMachineIsAbstractCloudPrinter + + color: UM.Theme.getColor("detail_background") + height: childrenRect.height + UM.Theme.getSize("default_margin").height * 2 + width: childrenRect.width + UM.Theme.getSize("wide_margin").width * 2 + anchors + { + horizontalCenter: parent.horizontalCenter + top: parent.top + topMargin: UM.Theme.getSize("wide_margin").height * screenScaleFactor * 2 + } + + Column + { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + spacing: UM.Theme.getSize("wide_margin").height + padding: UM.Theme.getSize("default_margin").width + topPadding: 0 + + Image + { + id: sendToFactoryImage + anchors.horizontalCenter: parent.horizontalCenter + source: UM.Theme.getImage("cura_connected_printers") + } + + UM.Label + { + anchors.horizontalCenter: parent.horizontalCenter + text: catalog.i18nc("@info", "Monitor your printers from everywhere using Ultimaker Digital Factory") + font: UM.Theme.getFont("medium") + width: sendToFactoryImage.width + wrapMode: Text.WordWrap + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + + Cura.PrimaryButton + { + id: sendToFactoryButton + anchors.horizontalCenter: parent.horizontalCenter + text: catalog.i18nc("@button", "View printers in Digital Factory") + onClicked: Qt.openUrlExternally("https://digitalfactory.ultimaker.com/app/print-jobs?utm_source=cura&utm_medium=software&utm_campaign=monitor-view-cloud-printer-type") + } + } } } } diff --git a/resources/qml/PrinterSelector/MachineListButton.qml b/resources/qml/PrinterSelector/MachineListButton.qml index b158cb20c0..70e7564aa9 100644 --- a/resources/qml/PrinterSelector/MachineListButton.qml +++ b/resources/qml/PrinterSelector/MachineListButton.qml @@ -118,11 +118,11 @@ Loader { top: buttonText.top bottom: buttonText.bottom } - visible: model.isAbstractMachine + visible: model.isAbstractMachine ? model.isAbstractMachine : false UM.Label { - text: model.machineCount + text: model.machineCount ? model.machineCount : "" anchors.centerIn: parent font: UM.Theme.getFont("default_bold") } diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 869d536a00..0008529408 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -223,7 +223,6 @@ Cura.ExpandablePopup id: buttonRow anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter anchors.left: parent.left anchors.right: parent.right diff --git a/resources/themes/cura-dark/images/cura_connected_printers.svg b/resources/themes/cura-dark/images/cura_connected_printers.svg new file mode 100644 index 0000000000..d7d0dc9d23 --- /dev/null +++ b/resources/themes/cura-dark/images/cura_connected_printers.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/themes/cura-light/images/illustration_connect_printers.svg b/resources/themes/cura-light/images/cura_connected_printers.svg similarity index 100% rename from resources/themes/cura-light/images/illustration_connect_printers.svg rename to resources/themes/cura-light/images/cura_connected_printers.svg