From 9bd4d3c0a8d005f0aae0fc8086046347f2738acf Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 8 Sep 2016 11:26:01 +0200 Subject: [PATCH 1/2] Update configuration mismatch dialog layout and wording Also return to settings tab when not continuing with the print CURA-2285 --- NetworkPrinterOutputDevice.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/NetworkPrinterOutputDevice.py b/NetworkPrinterOutputDevice.py index de78a03467..e6964d9715 100644 --- a/NetworkPrinterOutputDevice.py +++ b/NetworkPrinterOutputDevice.py @@ -440,27 +440,35 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): material = extruder_manager.getExtruderStack(0).findContainer({"type": "material"}) if material: if material.getMetaDataEntry("GUID") != self._json_printer_state["heads"][0]["extruders"][index]["active_material"]["GUID"]: - warnings.append(i18n_catalog.i18nc("@label", "Different material selected for extruder {0}").format(index + 1)) + warnings.append(i18n_catalog.i18nc("@label", "Different material selected for extruder {0}").format(index + 1)) if warnings: - text = i18n_catalog.i18nc("@label", "A number of configurations are mismatched. Are you sure you wish to print with the selected configuration?") - detailed_text = "" Application.getInstance().messageBox(i18n_catalog.i18nc("@window:title", "Mismatched configuration"), text, + informative_text, detailed_text, buttons=QMessageBox.Yes + QMessageBox.No, icon=QMessageBox.Question, - callback=self._configurationCallback + callback=self._configurationMismatchMessageCallback ) return self.startPrint() + def _configurationMismatchMessageCallback(self, button): + if button == QMessageBox.Yes: + self.startPrint() + else: + Application.getInstance().showPrintMonitor.emit(False) + def isConnected(self): return self._connection_state != ConnectionState.closed and self._connection_state != ConnectionState.error @@ -788,7 +796,3 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): icon=QMessageBox.Question, callback=callback ) - - def _configurationCallback(self, button): - if button == QMessageBox.Yes: - self.startPrint() From 28bfc364725c8c5feefc42d1d9693b25503c30ee Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 8 Sep 2016 16:37:10 +0200 Subject: [PATCH 2/2] Recreate network manager count is now always increased once --- NetworkPrinterOutputDevice.py | 1 + 1 file changed, 1 insertion(+) diff --git a/NetworkPrinterOutputDevice.py b/NetworkPrinterOutputDevice.py index de78a03467..b119f5ff8b 100644 --- a/NetworkPrinterOutputDevice.py +++ b/NetworkPrinterOutputDevice.py @@ -246,6 +246,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): # Re-creating the QNetworkManager seems to fix this issue. if self._last_response_time and self._connection_state_before_timeout: if time_since_last_response > self._recreate_network_manager_time * self._recreate_network_manager_count: + self._recreate_network_manager_count += 1 # It can happen that we had a very long timeout (multiple times the recreate time). # In that case we should jump through the point that the next update won't be right away. while time_since_last_response - self._recreate_network_manager_time * self._recreate_network_manager_count > self._recreate_network_manager_time: