diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 8f1a8bb7f8..effdb3866a 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -490,6 +490,10 @@ class MachineManager(QObject): def activeMachineHasCloudConnection(self) -> bool: # A cloud connection is only available if any output device actually is a cloud connected device. return any(d.connectionType == ConnectionType.CloudConnection for d in self._printer_output_devices) + + @pyqtProperty(bool, notify = printerConnectedStatusChanged) + def activeMachineHasCloudRegistration(self) -> bool: + return self.activeMachine is not None and ConnectionType.CloudConnection in self.activeMachine.configuredConnectionTypes @pyqtProperty(bool, notify = printerConnectedStatusChanged) def activeMachineIsUsingCloudConnection(self) -> bool: diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py index f233e59fe5..5f564bc6ad 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py @@ -106,8 +106,8 @@ class CloudOutputDeviceManager: self._onDevicesDiscovered(new_clusters) removed_device_keys = set(self._remote_clusters.keys()) - set(online_clusters.keys()) - for device_id in removed_device_keys: - self._onDiscoveredDeviceRemoved(device_id) + # for device_id in removed_device_keys: + # self._onDiscoveredDeviceRemoved(device_id) if new_clusters or removed_device_keys: self.discoveredDevicesChanged.emit() diff --git a/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDeviceManager.py b/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDeviceManager.py index 273c64ef4d..3410898269 100644 --- a/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDeviceManager.py @@ -265,7 +265,7 @@ class LocalClusterOutputDeviceManager: ## Nudge the user to start using Ultimaker Cloud. @staticmethod def _showCloudFlowMessage(device: LocalClusterOutputDevice) -> None: - if CuraApplication.getInstance().getMachineManager().activeMachineIsUsingCloudConnection: + if CuraApplication.getInstance().getMachineManager().activeMachineHasCloudRegistration: # This printer is already cloud connected, so we do not bother the user anymore. return if not CuraApplication.getInstance().getCuraAPI().account.isLoggedIn: diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 2a101e4ae3..4cbae378f9 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -5,14 +5,15 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 import UM 1.2 as UM -import Cura 1.0 as Cura +import Cura 1.1 as Cura Cura.ExpandablePopup { id: machineSelector property bool isNetworkPrinter: Cura.MachineManager.activeMachineHasNetworkConnection - property bool isCloudPrinter: Cura.MachineManager.activeMachineHasCloudConnection + property bool isConnectedCloudPrinter: Cura.MachineManager.activeMachineHasCloudConnection + property bool isCloudRegistered: Cura.MachineManager.activeMachineHasCloudRegistration property bool isGroup: Cura.MachineManager.activeMachineIsGroup contentPadding: UM.Theme.getSize("default_lining").width @@ -44,7 +45,7 @@ Cura.ExpandablePopup { return UM.Theme.getIcon("printer_group") } - else if (isNetworkPrinter || isCloudPrinter) + else if (isNetworkPrinter || isCloudRegistered) { return UM.Theme.getIcon("printer_single") } @@ -72,10 +73,14 @@ Cura.ExpandablePopup { return UM.Theme.getIcon("printer_connected") } - else if (isCloudPrinter) + else if (isConnectedCloudPrinter) { return UM.Theme.getIcon("printer_cloud_connected") } + else if (isCloudRegistered) + { + return UM.Theme.getIcon("printer_cloud_not_available") + } else { return "" @@ -85,8 +90,9 @@ Cura.ExpandablePopup width: UM.Theme.getSize("printer_status_icon").width height: UM.Theme.getSize("printer_status_icon").height - color: UM.Theme.getColor("primary") - visible: isNetworkPrinter || isCloudPrinter + color: source == UM.Theme.getIcon("printer_cloud_not_available") ? UM.Theme.getColor("cloud_unavailable") : UM.Theme.getColor("primary") + + visible: isNetworkPrinter || isCloudRegistered // Make a themable circle in the background so we can change it in other themes Rectangle diff --git a/resources/themes/cura-light/icons/printer_cloud_not_available.svg b/resources/themes/cura-light/icons/printer_cloud_not_available.svg new file mode 100644 index 0000000000..248df27338 --- /dev/null +++ b/resources/themes/cura-light/icons/printer_cloud_not_available.svg @@ -0,0 +1,18 @@ + + + + Artboard Copy 4 + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index b870603bd9..0bc09701b2 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -438,7 +438,9 @@ "monitor_shadow": [200, 200, 200, 255], "monitor_carousel_dot": [216, 216, 216, 255], - "monitor_carousel_dot_current": [119, 119, 119, 255] + "monitor_carousel_dot_current": [119, 119, 119, 255], + + "cloud_unavailable": [153, 153, 153, 255] }, "sizes": {