mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 06:05:52 +08:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
b44f32ad1d
@ -210,6 +210,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
||||
item = {
|
||||
"id": "",
|
||||
"name": catalog.i18nc("@menuitem", "Not overridden"),
|
||||
"enabled": True,
|
||||
"color": "#ffffff",
|
||||
"index": -1,
|
||||
"definition": ""
|
||||
|
@ -208,14 +208,9 @@ class XmlMaterialProfile(InstanceContainer):
|
||||
machine_variant_map = {}
|
||||
|
||||
variant_manager = CuraApplication.getInstance().getVariantManager()
|
||||
material_manager = CuraApplication.getInstance().getMaterialManager()
|
||||
|
||||
root_material_id = self.getMetaDataEntry("base_file") # if basefile is self.getId, this is a basefile.
|
||||
material_group = material_manager.getMaterialGroup(root_material_id)
|
||||
|
||||
all_containers = []
|
||||
for node in [material_group.root_material_node] + material_group.derived_material_node_list:
|
||||
all_containers.append(node.getContainer())
|
||||
all_containers = registry.findInstanceContainers(base_file = root_material_id)
|
||||
|
||||
for container in all_containers:
|
||||
definition_id = container.getMetaDataEntry("definition")
|
||||
@ -242,7 +237,7 @@ class XmlMaterialProfile(InstanceContainer):
|
||||
|
||||
for definition_id, container in machine_container_map.items():
|
||||
definition_id = container.getMetaDataEntry("definition")
|
||||
definition_metadata = ContainerRegistry.getInstance().findDefinitionContainersMetadata(id = definition_id)[0]
|
||||
definition_metadata = registry.findDefinitionContainersMetadata(id = definition_id)[0]
|
||||
|
||||
product = definition_id
|
||||
for product_name, product_id_list in product_id_map.items():
|
||||
|
@ -215,7 +215,8 @@ SettingItem
|
||||
{
|
||||
text: model.name
|
||||
renderType: Text.NativeRendering
|
||||
color: {
|
||||
color:
|
||||
{
|
||||
if (model.enabled) {
|
||||
UM.Theme.getColor("setting_control_text")
|
||||
} else {
|
||||
|
@ -26,9 +26,20 @@ SettingItem
|
||||
textRole: "name"
|
||||
|
||||
onActivated:
|
||||
{
|
||||
if (model.getItem(index).enabled)
|
||||
{
|
||||
forceActiveFocus();
|
||||
propertyProvider.setPropertyValue("value", model.getItem(index).index);
|
||||
} else
|
||||
{
|
||||
if (propertyProvider.properties.value == -1)
|
||||
{
|
||||
control.currentIndex = model.rowCount() - 1; // we know the last item is "Not overriden"
|
||||
} else {
|
||||
control.currentIndex = propertyProvider.properties.value; // revert to the old value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onActiveFocusChanged:
|
||||
@ -192,7 +203,14 @@ SettingItem
|
||||
{
|
||||
text: model.name
|
||||
renderType: Text.NativeRendering
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
color:
|
||||
{
|
||||
if (model.enabled) {
|
||||
UM.Theme.getColor("setting_control_text")
|
||||
} else {
|
||||
UM.Theme.getColor("action_button_disabled_text");
|
||||
}
|
||||
}
|
||||
font: UM.Theme.getFont("default")
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
Loading…
x
Reference in New Issue
Block a user