mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 17:27:51 -06:00
Check for IP addresses used as network keys
Contributes to CL-1266
This commit is contained in:
parent
11ea568d0b
commit
35a9a0a058
1 changed files with 10 additions and 2 deletions
|
@ -140,9 +140,17 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice):
|
||||||
|
|
||||||
## Checks whether the given network key is found in the cloud's host name
|
## Checks whether the given network key is found in the cloud's host name
|
||||||
def matchesNetworkKey(self, network_key: str) -> bool:
|
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"
|
# 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 network_key == self.clusterData.host_internal_ip:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
## Set all the interface elements and texts for this output device.
|
## Set all the interface elements and texts for this output device.
|
||||||
def _setInterfaceElements(self) -> None:
|
def _setInterfaceElements(self) -> None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue