mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Fix refresh button functionality for network printing
This commit is contained in:
parent
5bdef34121
commit
11ef53905b
2 changed files with 11 additions and 3 deletions
|
@ -57,10 +57,14 @@ class LocalClusterOutputDeviceManager:
|
|||
## Stop network discovery and clean up discovered devices.
|
||||
def stop(self) -> None:
|
||||
self._zero_conf_client.stop()
|
||||
# Cleanup all manual devices.
|
||||
for instance_name in list(self._discovered_devices):
|
||||
self._onDiscoveredDeviceRemoved(instance_name)
|
||||
|
||||
## Restart discovery on the local network.
|
||||
def startDiscovery(self):
|
||||
self.stop()
|
||||
self.start()
|
||||
|
||||
## Add a networked printer manually by address.
|
||||
def addManualDevice(self, address: str, callback: Optional[Callable[[bool, str], None]] = None) -> None:
|
||||
api_client = ClusterApiClient(address, lambda error: print(error))
|
||||
|
@ -210,12 +214,12 @@ class LocalClusterOutputDeviceManager:
|
|||
if Version(device.firmwareVersion) < self.MIN_SUPPORTED_CLUSTER_VERSION:
|
||||
LegacyDeviceNoLongerSupportedMessage().show()
|
||||
return
|
||||
|
||||
|
||||
# Tell the user that they cannot connect to a non-host printer.
|
||||
if device.clusterSize < 1:
|
||||
NotClusterHostMessage().show()
|
||||
return
|
||||
|
||||
|
||||
device.connect()
|
||||
machine.addConfiguredConnectionType(device.connectionType.value)
|
||||
CuraApplication.getInstance().getOutputDeviceManager().addOutputDevice(device)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue