Merge pull request #5606 from Ultimaker/CL-1325_pass_output_device_to_cloud_check

CL-1325 Pass output device (or not) to cloud check method
This commit is contained in:
Simon Edwards 2019-04-12 10:57:34 +02:00 committed by GitHub
commit 474aff2d4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,7 @@ from UM.Version import Version
from . import ClusterUM3OutputDevice, LegacyUM3OutputDevice
from .Cloud.CloudOutputDeviceManager import CloudOutputDeviceManager
from .Cloud.CloudOutputDevice import CloudOutputDevice # typing
if TYPE_CHECKING:
from PyQt5.QtNetwork import QNetworkReply
@ -181,7 +182,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
um_network_key = CuraApplication.getInstance().getGlobalContainerStack().getMetaDataEntry("um_network_key")
if key == um_network_key:
self.getOutputDeviceManager().addOutputDevice(self._discovered_devices[key])
self.checkCloudFlowIsPossible()
self.checkCloudFlowIsPossible(None)
else:
self.getOutputDeviceManager().removeOutputDevice(key)
if key.startswith("manual:"):
@ -488,7 +489,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
return True
## Check if the prerequsites are in place to start the cloud flow
def checkCloudFlowIsPossible(self) -> None:
def checkCloudFlowIsPossible(self, cluster: Optional[CloudOutputDevice]) -> None:
Logger.log("d", "Checking if cloud connection is possible...")
# Pre-Check: Skip if active machine already has been cloud connected or you said don't ask again
@ -595,7 +596,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
self._cloud_flow_complete_message.hide()
# Check for cloud flow again with newly selected machine
self.checkCloudFlowIsPossible()
self.checkCloudFlowIsPossible(None)
def _createCloudFlowStartMessage(self):
self._start_cloud_flow_message = Message(