Only update printer list after printer is added/removed

This makes it emit a signal only after addPrinter and removePrinter has completed executing, so we know that updating the list is done by the time it refreshes the list view in QML.

Contributes to issue CURA-2393.
This commit is contained in:
Ghostkeeper 2016-09-26 12:01:54 +02:00
parent c0839bcfbb
commit b4ba7a64a9
No known key found for this signature in database
GPG key ID: 701948C5954A7385
2 changed files with 4 additions and 2 deletions

View file

@ -36,8 +36,7 @@ class DiscoverUM3Action(MachineAction):
def startDiscovery(self):
if not self._network_plugin:
self._network_plugin = Application.getInstance().getOutputDeviceManager().getOutputDevicePlugin("JediWifiPrintingPlugin")
self._network_plugin.addPrinterSignal.connect(self._onPrinterDiscoveryChanged)
self._network_plugin.removePrinterSignal.connect(self._onPrinterDiscoveryChanged)
self._network_plugin.printerListChanged.connect(self._onPrinterDiscoveryChanged)
self.printersChanged.emit()
@pyqtSlot()