mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-07 19:11:48 +08:00
WIP: Implement refreshConnections()
This commit is contained in:
parent
20933e8bef
commit
e5b51c8edf
@ -55,7 +55,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||||||
self.addDeviceSignal.connect(self._onAddDevice)
|
self.addDeviceSignal.connect(self._onAddDevice)
|
||||||
self.removeDeviceSignal.connect(self._onRemoveDevice)
|
self.removeDeviceSignal.connect(self._onRemoveDevice)
|
||||||
|
|
||||||
self._application.globalContainerStackChanged.connect(self.reCheckConnections)
|
self._application.globalContainerStackChanged.connect(self.refreshConnections)
|
||||||
|
|
||||||
self._discovered_devices = {}
|
self._discovered_devices = {}
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||||||
self.addManualDevice(address)
|
self.addManualDevice(address)
|
||||||
self.resetLastManualDevice()
|
self.resetLastManualDevice()
|
||||||
|
|
||||||
def reCheckConnections(self):
|
def refreshConnections(self):
|
||||||
active_machine = CuraApplication.getInstance().getGlobalContainerStack()
|
active_machine = CuraApplication.getInstance().getGlobalContainerStack()
|
||||||
if not active_machine:
|
if not active_machine:
|
||||||
return
|
return
|
||||||
@ -233,7 +233,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||||||
# connect the new machine to that network printer
|
# connect the new machine to that network printer
|
||||||
self._application.getMachineManager().associateActiveMachineWithPrinterDevice(discovered_device)
|
self._application.getMachineManager().associateActiveMachineWithPrinterDevice(discovered_device)
|
||||||
# ensure that the connection states are refreshed.
|
# ensure that the connection states are refreshed.
|
||||||
self.reCheckConnections()
|
self.refreshConnections()
|
||||||
|
|
||||||
def _checkManualDevice(self, address):
|
def _checkManualDevice(self, address):
|
||||||
# Check if a UM3 family device exists at this address.
|
# Check if a UM3 family device exists at this address.
|
||||||
|
@ -62,7 +62,7 @@ Item
|
|||||||
|
|
||||||
onRefreshButtonClicked:
|
onRefreshButtonClicked:
|
||||||
{
|
{
|
||||||
// TODO: implement refresh
|
UM.OutputDeviceManager.refreshConnections()
|
||||||
}
|
}
|
||||||
|
|
||||||
onAddByIpButtonClicked:
|
onAddByIpButtonClicked:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user