From 2557cc008c72f0c237b7bd4d27a472959581f88d Mon Sep 17 00:00:00 2001 From: 5axes <5axes@users.noreply.github.com> Date: Mon, 22 Aug 2022 11:05:39 +0200 Subject: [PATCH] V2.1.4 Correction on Error Message --- CalibrationShapes.py | 47 +++++++++++++++++++++++++++++++++----------- plugin.json | 2 +- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/CalibrationShapes.py b/CalibrationShapes.py index 10545fa..b7f9b85 100644 --- a/CalibrationShapes.py +++ b/CalibrationShapes.py @@ -54,6 +54,7 @@ # : Same for fill_outline_gaps Print Thin Walls # V2.1.2 : Supress the function # V2.1.3 : Modification RetractTower + New TempTowerPC +# V2.1.4 : Change for compatibility on Message Text #------------------------------------------------------------------------------------------- VERSION_QT5 = False @@ -604,8 +605,12 @@ def _checkRetract(self, val): key="retraction_enable" definition_key=key + " label" untranslated_label=extruder_stack.getProperty(key,"label") - translated_label=i18n_catalog.i18nc(definition_key, untranslated_label) - Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes"), message_type = Message.MessageType.WARNING).show() + translated_label=i18n_catalog.i18nc(definition_key, untranslated_label) + if self.Major == 4 and self.Minor < 11 : + Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes")).show() + else : + Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes"), message_type = Message.MessageType.WARNING).show() + # Define retraction_enable extruder.setProperty("retraction_enable", "value", True) @@ -617,8 +622,12 @@ def _checkRetract(self, val): key="retraction_amount" definition_key=key + " label" untranslated_label=extruder_stack.getProperty(key,"label") - translated_label=i18n_catalog.i18nc(definition_key, untranslated_label) - Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(1.0)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes"), message_type = Message.MessageType.WARNING).show() + translated_label=i18n_catalog.i18nc(definition_key, untranslated_label) + if self.Major == 4 and self.Minor < 11 : + Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(1.0)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes")).show() + else : + Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(1.0)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes"), message_type = Message.MessageType.WARNING).show() + # Define retraction_amount extruder.setProperty("retraction_amount", "value", 1.0) @@ -638,8 +647,10 @@ def _checkAdaptativ(self, val): definition_key=key + " label" untranslated_label=extruder_stack.getProperty(key,"label") translated_label=i18n_catalog.i18nc(definition_key, untranslated_label) - - Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes"), message_type = Message.MessageType.WARNING).show() + if self.Major == 4 and self.Minor < 11 : + Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes")).show() + else : + Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes"), message_type = Message.MessageType.WARNING).show() # Define adaptive_layer global_container_stack.setProperty("adaptive_layer_height_enabled", "value", False) @@ -663,7 +674,11 @@ def _checkAllRemoveHoles(self, val)-> bool: definition_key=key + " label" untranslated_label=extruder_stack.getProperty(key,"label") translated_label=i18n_catalog.i18nc(definition_key, untranslated_label) - Message(text = "Individual definition for the calibration part of : " + translated_label + "\n(machine_nozzle_size>0.4)\nSet value : %s" % (str(True)), title = catalog.i18nc("@info:title", "Information ! Calibration Shapes"), message_type = Message.MessageType.POSITIVE).show() + if self.Major == 4 and self.Minor < 11 : + Message(text = "Individual definition for the calibration part of : " + translated_label + "\n(machine_nozzle_size>0.4)\nSet value : %s" % (str(True)), title = catalog.i18nc("@info:title", "Information ! Calibration Shapes")).show() + else : + Message(text = "Individual definition for the calibration part of : " + translated_label + "\n(machine_nozzle_size>0.4)\nSet value : %s" % (str(True)), title = catalog.i18nc("@info:title", "Information ! Calibration Shapes"), message_type = Message.MessageType.POSITIVE).show() + # Define adaptive_layer # extruder.setProperty("meshfix_union_all_remove_holes", "value", True) return _Remove @@ -683,7 +698,11 @@ def _checkThinWalls(self, val)-> bool: definition_key=key + " label" untranslated_label=extruder_stack.getProperty(key,"label") translated_label=i18n_catalog.i18nc(definition_key, untranslated_label) - Message(text = "Individual definition for the calibration part of : " + translated_label + "\nSet value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Information ! Calibration Shapes"), message_type = Message.MessageType.POSITIVE).show() + if self.Major == 4 and self.Minor < 11 : + Message(text = "Individual definition for the calibration part of : " + translated_label + "\nSet value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Information ! Calibration Shapes")).show() + else : + Message(text = "Individual definition for the calibration part of : " + translated_label + "\nSet value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Information ! Calibration Shapes"), message_type = Message.MessageType.POSITIVE).show() + thin_wall = val # global_container_stack.setProperty("fill_outline_gaps", "value", val) @@ -703,8 +722,11 @@ def _checkFill_Perimeter_Gaps(self, val): key="fill_perimeter_gaps" definition_key=key + " label" untranslated_label=extruder_stack.getProperty(key,"label") - translated_label=i18n_catalog.i18nc(definition_key, untranslated_label) - Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes"), message_type = Message.MessageType.WARNING).show() + translated_label=i18n_catalog.i18nc(definition_key, untranslated_label) + if self.Major == 4 and self.Minor < 11 : + Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes")).show() + else : + Message(text = "! Modification ! in the current profile of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes"), message_type = Message.MessageType.WARNING).show() # Define adaptive_layer global_container_stack.setProperty("fill_perimeter_gaps", "value", val) @@ -712,7 +734,10 @@ def _checkFill_Perimeter_Gaps(self, val): fill_perimeter_gaps = extruder.getProperty("fill_perimeter_gaps", "value") if fill_perimeter_gaps != val : - Message(text = "! Modification ! for the extruder definition of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes"), message_type = Message.MessageType.WARNING).show() + if self.Major == 4 and self.Minor < 11 : + Message(text = "! Modification ! for the extruder definition of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes")).show() + else : + Message(text = "! Modification ! for the extruder definition of : " + translated_label + "\nNew value : %s" % (str(val)), title = catalog.i18nc("@info:title", "Warning ! Calibration Shapes"), message_type = Message.MessageType.WARNING).show() # Define adaptive_layer extruder.setProperty("fill_perimeter_gaps", "value", val) diff --git a/plugin.json b/plugin.json index 5a14a4e..d0b9e27 100644 --- a/plugin.json +++ b/plugin.json @@ -1,7 +1,7 @@ { "name": "Calibration Shapes", "author": "5axes", - "version": "2.1.3", + "version": "2.1.4", "description": "Adds test parts and simple shapes to the build plate", "api": 7, "supported_sdk_versions": ["7.0.0", "7.1.0", "7.2.0", "7.3.0", "7.4.0", "7.5.0", "7.6.0", "7.7.0", "7.8.0", "7.9.0", "8.0.0"],