mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Show cloud flow pop-up if machine is removed from cloud
Contributes to CL-1222
This commit is contained in:
parent
162fdad4e4
commit
fcb52dd1cf
2 changed files with 8 additions and 2 deletions
|
@ -33,6 +33,7 @@ class CloudOutputDeviceManager:
|
||||||
I18N_CATALOG = i18nCatalog("cura")
|
I18N_CATALOG = i18nCatalog("cura")
|
||||||
|
|
||||||
addedCloudCluster = Signal()
|
addedCloudCluster = Signal()
|
||||||
|
removedCloudCluster = Signal()
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
# Persistent dict containing the remote clusters for the authenticated user.
|
# Persistent dict containing the remote clusters for the authenticated user.
|
||||||
|
@ -85,6 +86,7 @@ class CloudOutputDeviceManager:
|
||||||
removed_cluster.disconnect()
|
removed_cluster.disconnect()
|
||||||
removed_cluster.close()
|
removed_cluster.close()
|
||||||
self._output_device_manager.removeOutputDevice(removed_cluster.key)
|
self._output_device_manager.removeOutputDevice(removed_cluster.key)
|
||||||
|
self.removedCloudCluster.emit()
|
||||||
del self._remote_clusters[removed_cluster.key]
|
del self._remote_clusters[removed_cluster.key]
|
||||||
|
|
||||||
# Add an output device for each new remote cluster.
|
# Add an output device for each new remote cluster.
|
||||||
|
|
|
@ -45,8 +45,6 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||||
# Create a cloud output device manager that abstracts all cloud connection logic away.
|
# Create a cloud output device manager that abstracts all cloud connection logic away.
|
||||||
self._cloud_output_device_manager = CloudOutputDeviceManager()
|
self._cloud_output_device_manager = CloudOutputDeviceManager()
|
||||||
|
|
||||||
self._cloud_output_device_manager.addedCloudCluster.connect(self._onCloudPrintingConfigured)
|
|
||||||
|
|
||||||
# Because the model needs to be created in the same thread as the QMLEngine, we use a signal.
|
# Because the model needs to be created in the same thread as the QMLEngine, we use a signal.
|
||||||
self.addDeviceSignal.connect(self._onAddDevice)
|
self.addDeviceSignal.connect(self._onAddDevice)
|
||||||
self.removeDeviceSignal.connect(self._onRemoveDevice)
|
self.removeDeviceSignal.connect(self._onRemoveDevice)
|
||||||
|
@ -96,6 +94,12 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||||
# Listen for when cloud flow is possible
|
# Listen for when cloud flow is possible
|
||||||
self.cloudFlowIsPossible.connect(self._onCloudFlowPossible)
|
self.cloudFlowIsPossible.connect(self._onCloudFlowPossible)
|
||||||
|
|
||||||
|
# Listen if cloud cluster was added
|
||||||
|
self._cloud_output_device_manager.addedCloudCluster.connect(self._onCloudPrintingConfigured)
|
||||||
|
|
||||||
|
# Listen if cloud cluster was removed
|
||||||
|
self._cloud_output_device_manager.removedCloudCluster.connect(self.checkCloudFlowIsPossible)
|
||||||
|
|
||||||
self._start_cloud_flow_message = None # type: Optional[Message]
|
self._start_cloud_flow_message = None # type: Optional[Message]
|
||||||
self._cloud_flow_complete_message = None # type: Optional[Message]
|
self._cloud_flow_complete_message = None # type: Optional[Message]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue