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 }