From 2bbeeb3389a2f699f342b0aa361d17dd486bfaa2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Aug 2016 10:36:21 +0200 Subject: [PATCH] There is now a hard and a soft discovery mode CURA-2086 --- DiscoverUM3Action.py | 6 +++++- DiscoverUM3Action.qml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DiscoverUM3Action.py b/DiscoverUM3Action.py index 4ca500dc48..7115822582 100644 --- a/DiscoverUM3Action.py +++ b/DiscoverUM3Action.py @@ -23,8 +23,12 @@ class DiscoverUM3Action(MachineAction): self._network_plugin.addPrinterSignal.connect(self._onPrinterDiscoveryChanged) self._network_plugin.removePrinterSignal.connect(self._onPrinterDiscoveryChanged) self.printersChanged.emit() + + @pyqtSlot() + def restartDiscovery(self): + if not self._network_plugin: + self.startDiscovery() else: - # Restart bonjour discovery self._network_plugin.startDiscovery() def _onPrinterDiscoveryChanged(self, *args): diff --git a/DiscoverUM3Action.qml b/DiscoverUM3Action.qml index 4dcb5e074d..dcfd76792b 100644 --- a/DiscoverUM3Action.qml +++ b/DiscoverUM3Action.qml @@ -70,7 +70,7 @@ Cura.MachineAction { id: rediscoverButton text: catalog.i18nc("@title", "Refresh") - onClicked: manager.startDiscovery() + onClicked: manager.restartDiscovery() anchors.right: parent.right anchors.rightMargin: parent.width * 0.5 }