Merge branch 'master' into WIP_onboarding

This commit is contained in:
Ghostkeeper 2019-04-03 11:53:40 +02:00
commit ae9395aebb
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
13 changed files with 69 additions and 104 deletions

View file

@ -145,9 +145,17 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice):
## Checks whether the given network key is found in the cloud's host name
def matchesNetworkKey(self, network_key: str) -> bool:
# A network key looks like "ultimakersystem-aabbccdd0011._ultimaker._tcp.local."
# Typically, a network key looks like "ultimakersystem-aabbccdd0011._ultimaker._tcp.local."
# the host name should then be "ultimakersystem-aabbccdd0011"
return network_key.startswith(self.clusterData.host_name)
if network_key.startswith(self.clusterData.host_name):
return True
# However, for manually added printers, the local IP address is used in lieu of a proper
# network key, so check for that as well
if self.clusterData.host_internal_ip is not None and network_key.find(self.clusterData.host_internal_ip):
return True
return False
## Set all the interface elements and texts for this output device.
def _setInterfaceElements(self) -> None:

View file

@ -16,13 +16,14 @@ class CloudClusterResponse(BaseCloudModel):
# \param status: The status of the cluster authentication (active or inactive).
# \param host_version: The firmware version of the cluster host. This is where the Stardust client is running on.
def __init__(self, cluster_id: str, host_guid: str, host_name: str, is_online: bool, status: str,
host_version: Optional[str] = None, **kwargs) -> None:
host_internal_ip: Optional[str] = None, host_version: Optional[str] = None, **kwargs) -> None:
self.cluster_id = cluster_id
self.host_guid = host_guid
self.host_name = host_name
self.status = status
self.is_online = is_online
self.host_version = host_version
self.host_internal_ip = host_internal_ip
super().__init__(**kwargs)
# Validates the model, raising an exception if the model is invalid.

View file

@ -77,13 +77,15 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
self.setIconName("print")
if PluginRegistry.getInstance() is not None:
self._output_controller = LegacyUM3PrinterOutputController(self)
def _createMonitorViewFromQML(self) -> None:
if self._monitor_view_qml_path is None and PluginRegistry.getInstance() is not None:
self._monitor_view_qml_path = os.path.join(
PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
"resources", "qml", "MonitorStage.qml"
)
self._output_controller = LegacyUM3PrinterOutputController(self)
super()._createMonitorViewFromQML()
def _onAuthenticationStateChanged(self):
# We only accept commands if we are authenticated.