diff options
author | Ruben D <rubend@tutanota.com> | 2018-03-22 03:43:06 +0300 |
---|---|---|
committer | Ruben D <rubend@tutanota.com> | 2018-03-22 03:43:06 +0300 |
commit | 8e6ee411241cf54430f8bcd35a8afad1386f5b55 (patch) | |
tree | b75c5ef27d3bc0950eec33ffd3c3dc95852f9657 /plugins/ModelChecker | |
parent | 329a0b121d8831c47f730c8db72d5654b90d4a74 (diff) |
Let shrinkage check set its own message
Another attempt to keep the shrinkage check contained to functions related to shrinkage more.
Contributes to issue CURA-4557.
Diffstat (limited to 'plugins/ModelChecker')
-rw-r--r-- | plugins/ModelChecker/ModelChecker.py | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/plugins/ModelChecker/ModelChecker.py b/plugins/ModelChecker/ModelChecker.py index 5f3f7a8430..e5a09f7ea1 100644 --- a/plugins/ModelChecker/ModelChecker.py +++ b/plugins/ModelChecker/ModelChecker.py @@ -62,7 +62,15 @@ class ModelChecker(QObject, Extension): if bbox.width >= warning_size_xy or bbox.depth >= warning_size_xy or bbox.height >= warning_size_z: warning_nodes.append(node) - return warning_nodes + self._caution_message.setText(catalog.i18nc( + "@info:status", + "Some models may not be printed optimal due to object size and chosen material for models: {model_names}.\n" + "Tips that may be useful to improve the print quality:\n" + "1) Use rounded corners\n" + "2) Turn the fan off (only if the are no tiny details on the model)\n" + "3) Use a different material").format(model_names = ", ".join([n.getName() for n in warning_nodes]))) + + return len(warning_nodes) > 0 def sliceableNodes(self): # Add all sliceable scene nodes to check @@ -86,18 +94,9 @@ class ModelChecker(QObject, Extension): @pyqtProperty(bool, notify = onChanged) def runChecks(self): - warning_nodes = self.checkObjectsForShrinkage() - if warning_nodes: - self._caution_message.setText(catalog.i18nc( - "@info:status", - "Some models may not be printed optimal due to object size and chosen material for models: {model_names}.\n" - "Tips that may be useful to improve the print quality:\n" - "1) Use rounded corners\n" - "2) Turn the fan off (only if the are no tiny details on the model)\n" - "3) Use a different material").format(model_names = ", ".join([n.getName() for n in warning_nodes]))) - return True - else: - return False + danger_shrinkage = self.checkObjectsForShrinkage() + + return any((danger_shrinkage, )) #If any of the checks fail, show the warning button. @pyqtSlot() def showWarnings(self): |