From b41b98f058d650c923957553414971cf49e62e70 Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Wed, 26 Oct 2016 16:50:04 +0200 Subject: [PATCH] OSX would get stuck and act like there was a modal dialog open if we do the callback processing immediately. Delay it slightly. CURA-2801 CLONE - Cura in freeze mode when printing via WiFi --- NetworkPrinterOutputDevice.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/NetworkPrinterOutputDevice.py b/NetworkPrinterOutputDevice.py index f61486e53b..f70acc0513 100644 --- a/NetworkPrinterOutputDevice.py +++ b/NetworkPrinterOutputDevice.py @@ -574,10 +574,14 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self.startPrint() def _configurationMismatchMessageCallback(self, button): - if button == QMessageBox.Yes: - self.startPrint() - else: - Application.getInstance().showPrintMonitor.emit(False) + def delayedCallback(): + if button == QMessageBox.Yes: + self.startPrint() + else: + Application.getInstance().showPrintMonitor.emit(False) + # For some unknown reason Cura on OSX will hang if we do the call back code + # immediately without first returning and leaving QML's event system. + QTimer.singleShot(100, delayedCallback) def isConnected(self): return self._connection_state != ConnectionState.closed and self._connection_state != ConnectionState.error