mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 05:15: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 = {
|
item = {
|
||||||
"id": "",
|
"id": "",
|
||||||
"name": catalog.i18nc("@menuitem", "Not overridden"),
|
"name": catalog.i18nc("@menuitem", "Not overridden"),
|
||||||
|
"enabled": True,
|
||||||
"color": "#ffffff",
|
"color": "#ffffff",
|
||||||
"index": -1,
|
"index": -1,
|
||||||
"definition": ""
|
"definition": ""
|
||||||
|
@ -208,14 +208,9 @@ class XmlMaterialProfile(InstanceContainer):
|
|||||||
machine_variant_map = {}
|
machine_variant_map = {}
|
||||||
|
|
||||||
variant_manager = CuraApplication.getInstance().getVariantManager()
|
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.
|
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 = registry.findInstanceContainers(base_file = root_material_id)
|
||||||
|
|
||||||
all_containers = []
|
|
||||||
for node in [material_group.root_material_node] + material_group.derived_material_node_list:
|
|
||||||
all_containers.append(node.getContainer())
|
|
||||||
|
|
||||||
for container in all_containers:
|
for container in all_containers:
|
||||||
definition_id = container.getMetaDataEntry("definition")
|
definition_id = container.getMetaDataEntry("definition")
|
||||||
@ -242,7 +237,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||||||
|
|
||||||
for definition_id, container in machine_container_map.items():
|
for definition_id, container in machine_container_map.items():
|
||||||
definition_id = container.getMetaDataEntry("definition")
|
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
|
product = definition_id
|
||||||
for product_name, product_id_list in product_id_map.items():
|
for product_name, product_id_list in product_id_map.items():
|
||||||
|
@ -215,7 +215,8 @@ SettingItem
|
|||||||
{
|
{
|
||||||
text: model.name
|
text: model.name
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
color: {
|
color:
|
||||||
|
{
|
||||||
if (model.enabled) {
|
if (model.enabled) {
|
||||||
UM.Theme.getColor("setting_control_text")
|
UM.Theme.getColor("setting_control_text")
|
||||||
} else {
|
} else {
|
||||||
|
@ -26,9 +26,20 @@ SettingItem
|
|||||||
textRole: "name"
|
textRole: "name"
|
||||||
|
|
||||||
onActivated:
|
onActivated:
|
||||||
|
{
|
||||||
|
if (model.getItem(index).enabled)
|
||||||
{
|
{
|
||||||
forceActiveFocus();
|
forceActiveFocus();
|
||||||
propertyProvider.setPropertyValue("value", model.getItem(index).index);
|
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:
|
onActiveFocusChanged:
|
||||||
@ -192,7 +203,14 @@ SettingItem
|
|||||||
{
|
{
|
||||||
text: model.name
|
text: model.name
|
||||||
renderType: Text.NativeRendering
|
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")
|
font: UM.Theme.getFont("default")
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user