mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Finish adding cloud flow checks
Contributes to CL-1222
This commit is contained in:
parent
b29f3d3bd0
commit
70c384bd4e
1 changed files with 31 additions and 22 deletions
|
@ -389,31 +389,40 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||||
|
|
||||||
## Check if the prerequsites are in place to start the cloud flow
|
## Check if the prerequsites are in place to start the cloud flow
|
||||||
def checkCloudFlowIsPossible(self):
|
def checkCloudFlowIsPossible(self):
|
||||||
Logger.log("d", "Checking if cloud connection is possible...")
|
active_machine = self._application.getMachineManager().activeMachine
|
||||||
|
|
||||||
# TODO: Skip if already using cloud connection
|
if active_machine:
|
||||||
|
# Skip if already complete
|
||||||
|
# if active_machine.getMetaDataEntry("cloud_flow_complete", "value") is not None:
|
||||||
|
# return
|
||||||
|
|
||||||
# Check #1: User is logged in with an Ultimaker account
|
# # Skip if user said don't remind me
|
||||||
if not self._account.isLoggedIn:
|
# if active_machine.getMetaDataEntry("show_cloud_message", "value") is False:
|
||||||
Logger.log("d", "Cloud Flow not possible: User not logged in!")
|
# return
|
||||||
return
|
|
||||||
|
|
||||||
# Check #2: Machine has a network connection
|
Logger.log("d", "Checking if cloud connection is possible...")
|
||||||
if not self._application.getMachineManager().activeMachineHasActiveNetworkConnection:
|
|
||||||
Logger.log("d", "Cloud Flow not possible: Machine is not connected!")
|
# Check #1: User is logged in with an Ultimaker account
|
||||||
return
|
if not self._account.isLoggedIn:
|
||||||
|
Logger.log("d", "Cloud Flow not possible: User not logged in!")
|
||||||
# Check #3: Machine has correct firmware version
|
return
|
||||||
# firmware_version = self._application.getMachineManager().activeMachineFirmwareVersion
|
|
||||||
# if not Version(firmware_version) > self._min_cloud_version:
|
# Check #2: Machine has a network connection
|
||||||
# Logger.log("d", "Cloud Flow not possible: Machine firmware (%s) is too low! (Requires version %s)",
|
if not self._application.getMachineManager().activeMachineHasActiveNetworkConnection:
|
||||||
# firmware_version,
|
Logger.log("d", "Cloud Flow not possible: Machine is not connected!")
|
||||||
# self._min_cloud_version)
|
return
|
||||||
# return
|
|
||||||
# TODO: Un-comment out, only by-passed for development purposes
|
# Check #3: Machine has correct firmware version
|
||||||
|
# firmware_version = self._application.getMachineManager().activeMachineFirmwareVersion
|
||||||
Logger.log("d", "Cloud flow is ready to go!")
|
# if not Version(firmware_version) > self._min_cloud_version:
|
||||||
self.cloudFlowIsPossible.emit()
|
# Logger.log("d", "Cloud Flow not possible: Machine firmware (%s) is too low! (Requires version %s)",
|
||||||
|
# firmware_version,
|
||||||
|
# self._min_cloud_version)
|
||||||
|
# return
|
||||||
|
# TODO: Un-comment out, only by-passed for development purposes
|
||||||
|
|
||||||
|
Logger.log("d", "Cloud flow is possible!")
|
||||||
|
self.cloudFlowIsPossible.emit()
|
||||||
|
|
||||||
def _onCloudFlowPossible(self):
|
def _onCloudFlowPossible(self):
|
||||||
# Cloud flow is possible, so show the message
|
# Cloud flow is possible, so show the message
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue