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:
authorDiego Prado Gesto <d.pradogesto@ultimaker.com>2017-09-20 09:50:58 +0300
committerDiego Prado Gesto <d.pradogesto@ultimaker.com>2017-09-20 09:50:58 +0300
commitebd180bfdcb0d16fa251149d601ac1e921858881 (patch)
treeb51b81890aa1da090388d8f367a43f087b454525 /cura/Settings
parentc4f5c970e5632c8851e19262cef1b0ed2d51f0fe (diff)
Custom profiles are now shown in the preference panel - CURA-4327
Diffstat (limited to 'cura/Settings')
-rw-r--r--cura/Settings/ProfilesModel.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/cura/Settings/ProfilesModel.py b/cura/Settings/ProfilesModel.py
index 2942577fc6..4df362cdef 100644
--- a/cura/Settings/ProfilesModel.py
+++ b/cura/Settings/ProfilesModel.py
@@ -125,11 +125,22 @@ class ProfilesModel(InstanceContainersModel):
for key in reversed(tmp_all_quality_items.keys()):
all_quality_items[key] = tmp_all_quality_items[key]
+ # First the suitable containers are set in the model
+ containers = []
for data_item in all_quality_items.values():
- item = data_item["suitable_container"]
- if item is None:
- item = data_item["all_containers"][0]
+ suitable_item = data_item["suitable_container"]
+ if suitable_item is None:
+ suitable_item = data_item["all_containers"][0]
+ containers.append(suitable_item)
+ # Once the suitable containers are collected, the rest of the containers are appended
+ for data_item in all_quality_items.values():
+ for item in data_item["all_containers"]:
+ if item not in containers:
+ containers.append(item)
+
+ # Now all the containers are set
+ for item in containers:
profile = container_registry.findContainers(id = item["id"])
if not profile:
item["layer_height"] = "" #Can't update a profile that is unknown.