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
This commit is contained in:
Simon Edwards 2016-10-26 16:50:04 +02:00
parent 4900a8f380
commit b41b98f058

View file

@ -574,10 +574,14 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
self.startPrint() self.startPrint()
def _configurationMismatchMessageCallback(self, button): def _configurationMismatchMessageCallback(self, button):
if button == QMessageBox.Yes: def delayedCallback():
self.startPrint() if button == QMessageBox.Yes:
else: self.startPrint()
Application.getInstance().showPrintMonitor.emit(False) 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): def isConnected(self):
return self._connection_state != ConnectionState.closed and self._connection_state != ConnectionState.error return self._connection_state != ConnectionState.closed and self._connection_state != ConnectionState.error