mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 04:36:01 +08:00
Merge branch 'master' of https://github.com/Ultimaker/JediWifiPrintingPlugin
This commit is contained in:
commit
58d31beeb8
@ -36,8 +36,7 @@ class DiscoverUM3Action(MachineAction):
|
|||||||
def startDiscovery(self):
|
def startDiscovery(self):
|
||||||
if not self._network_plugin:
|
if not self._network_plugin:
|
||||||
self._network_plugin = Application.getInstance().getOutputDeviceManager().getOutputDevicePlugin("JediWifiPrintingPlugin")
|
self._network_plugin = Application.getInstance().getOutputDeviceManager().getOutputDevicePlugin("JediWifiPrintingPlugin")
|
||||||
self._network_plugin.addPrinterSignal.connect(self._onPrinterDiscoveryChanged)
|
self._network_plugin.printerListChanged.connect(self._onPrinterDiscoveryChanged)
|
||||||
self._network_plugin.removePrinterSignal.connect(self._onPrinterDiscoveryChanged)
|
|
||||||
self.printersChanged.emit()
|
self.printersChanged.emit()
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
|
@ -30,6 +30,7 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
|
|||||||
|
|
||||||
addPrinterSignal = Signal()
|
addPrinterSignal = Signal()
|
||||||
removePrinterSignal = Signal()
|
removePrinterSignal = Signal()
|
||||||
|
printerListChanged = Signal()
|
||||||
|
|
||||||
## Start looking for devices on network.
|
## Start looking for devices on network.
|
||||||
def start(self):
|
def start(self):
|
||||||
@ -73,6 +74,7 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
|
|||||||
if printer.getKey() not in self._old_printers: # Was the printer already connected, but a re-scan forced?
|
if printer.getKey() not in self._old_printers: # Was the printer already connected, but a re-scan forced?
|
||||||
self._printers[printer.getKey()].connect()
|
self._printers[printer.getKey()].connect()
|
||||||
printer.connectionStateChanged.connect(self._onPrinterConnectionStateChanged)
|
printer.connectionStateChanged.connect(self._onPrinterConnectionStateChanged)
|
||||||
|
self.printerListChanged.emit()
|
||||||
|
|
||||||
def removePrinter(self, name):
|
def removePrinter(self, name):
|
||||||
printer = self._printers.pop(name, None)
|
printer = self._printers.pop(name, None)
|
||||||
@ -80,6 +82,7 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
|
|||||||
if printer.isConnected():
|
if printer.isConnected():
|
||||||
printer.connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged)
|
printer.connectionStateChanged.disconnect(self._onPrinterConnectionStateChanged)
|
||||||
printer.disconnect()
|
printer.disconnect()
|
||||||
|
self.printerListChanged.emit()
|
||||||
|
|
||||||
## Handler for when the connection state of one of the detected printers changes
|
## Handler for when the connection state of one of the detected printers changes
|
||||||
def _onPrinterConnectionStateChanged(self, key):
|
def _onPrinterConnectionStateChanged(self, key):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user