mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 22:35:54 +08:00
Fix refresh button functionality for network printing
This commit is contained in:
parent
5bdef34121
commit
11ef53905b
@ -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))
|
||||
|
@ -37,6 +37,10 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||
self._network_output_device_manager.stop()
|
||||
self._cloud_output_device_manager.stop()
|
||||
|
||||
## Restart network discovery.
|
||||
def startDiscovery(self) -> None:
|
||||
self._network_output_device_manager.startDiscovery()
|
||||
|
||||
## Force refreshing the network connections.
|
||||
def refreshConnections(self) -> None:
|
||||
self._network_output_device_manager.refreshConnections()
|
||||
|
Loading…
x
Reference in New Issue
Block a user