Update configuration mismatch dialog layout and wording

Also return to settings tab when not continuing with the print
CURA-2285
This commit is contained in:
fieldOfView 2016-09-08 11:26:01 +02:00
parent 65a2cedf9c
commit 9bd4d3c0a8

View file

@ -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 = "<ul>"
text = i18n_catalog.i18nc("@label", "Are you sure you wish to print with the selected configuration?")
informative_text = i18n_catalog.i18nc("@label", "There is a mismatch between the configuration of the printer and Cura. "
"For the best result, always slice for the PrintCores and materials that are inserted in your printer.")
detailed_text = ""
for warning in warnings:
detailed_text += "<li>" + warning + "</li>"
detailed_text += warning + "\n"
detailed_text += "</ul>"
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()