Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2022-06-01 12:07:01 +0300
committerJaime van Kessel <nallath@gmail.com>2022-06-01 12:07:01 +0300
commite6551821aaf6ab69f2fb4e1f735427506ead22b5 (patch)
tree92debbbddf76c1aecd4bbd605a40b1025c53acf2
parent8579a6baf34b7f55e7453112770de041aa2d6380 (diff)
Use intent category if no translation is availableCURA-9297_show_custom_intent_names
Previously we would only accept intents that had a translation. If we could not find one, we would use "unknown" as the intent category. However, we didn't really do this consistently. In some places it would show unkown and in others we'd show the intent type. This should make the behavior the same across the board. It will try to get a translation for the intent category and show that. If it's unable to find that it will use the category instead. Note that it will use the python title function to ensure it has nice capitalisation CURA-9297
-rw-r--r--cura/Machines/Models/IntentCategoryModel.py2
-rw-r--r--cura/Machines/Models/QualityManagementModel.py3
-rwxr-xr-xcura/Settings/MachineManager.py2
3 files changed, 4 insertions, 3 deletions
diff --git a/cura/Machines/Models/IntentCategoryModel.py b/cura/Machines/Models/IntentCategoryModel.py
index 14e3c4d35e..e94bbe6d00 100644
--- a/cura/Machines/Models/IntentCategoryModel.py
+++ b/cura/Machines/Models/IntentCategoryModel.py
@@ -111,7 +111,7 @@ class IntentCategoryModel(ListModel):
except ValueError:
weight = 99
result.append({
- "name": IntentCategoryModel.translation(category, "name", category),
+ "name": IntentCategoryModel.translation(category, "name", category.title()),
"description": IntentCategoryModel.translation(category, "description", None),
"intent_category": category,
"weight": weight,
diff --git a/cura/Machines/Models/QualityManagementModel.py b/cura/Machines/Models/QualityManagementModel.py
index 8db8719784..b4fb8b38b5 100644
--- a/cura/Machines/Models/QualityManagementModel.py
+++ b/cura/Machines/Models/QualityManagementModel.py
@@ -358,8 +358,9 @@ class QualityManagementModel(ListModel):
"quality_type": quality_type,
"quality_changes_group": None,
"intent_category": intent_category,
- "section_name": catalog.i18nc("@label", intent_translations.get(intent_category, {}).get("name", catalog.i18nc("@label", "Unknown"))),
+ "section_name": catalog.i18nc("@label", intent_translations.get(intent_category, {}).get("name", catalog.i18nc("@label", intent_category.title()))),
})
+
# Sort by quality_type for each intent category
intent_translations_list = list(intent_translations)
diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py
index 1c7a8f0e98..9b98179bff 100755
--- a/cura/Settings/MachineManager.py
+++ b/cura/Settings/MachineManager.py
@@ -1611,7 +1611,7 @@ class MachineManager(QObject):
if intent_category != "default":
intent_display_name = IntentCategoryModel.translation(intent_category,
"name",
- catalog.i18nc("@label", "Unknown"))
+ intent_category.title())
display_name = "{intent_name} - {the_rest}".format(intent_name = intent_display_name,
the_rest = display_name)