mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Hide options for Support, Anti overhang, etc Mesh if their settings are disabled
This commit is contained in:
parent
8bd6afad1f
commit
fbe128bbb7
1 changed files with 43 additions and 7 deletions
|
@ -42,6 +42,13 @@ Item {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UM.SettingPropertyProvider
|
||||||
|
{
|
||||||
|
id: meshTypePropertyProvider
|
||||||
|
containerStackId: Cura.MachineManager.activeMachineId
|
||||||
|
watchedProperties: [ "enabled" ]
|
||||||
|
}
|
||||||
|
|
||||||
ComboBox
|
ComboBox
|
||||||
{
|
{
|
||||||
id: meshTypeSelection
|
id: meshTypeSelection
|
||||||
|
@ -52,36 +59,55 @@ Item {
|
||||||
model: ListModel
|
model: ListModel
|
||||||
{
|
{
|
||||||
id: meshTypeModel
|
id: meshTypeModel
|
||||||
Component.onCompleted:
|
Component.onCompleted: meshTypeSelection.populateModel()
|
||||||
|
}
|
||||||
|
|
||||||
|
function populateModel()
|
||||||
{
|
{
|
||||||
meshTypeModel.append({
|
meshTypeModel.append({
|
||||||
type: "",
|
type: "",
|
||||||
text: catalog.i18nc("@label", "Normal model")
|
text: catalog.i18nc("@label", "Normal model")
|
||||||
});
|
});
|
||||||
|
meshTypePropertyProvider.key = "support_mesh";
|
||||||
|
if(meshTypePropertyProvider.properties.enabled == "True")
|
||||||
|
{
|
||||||
meshTypeModel.append({
|
meshTypeModel.append({
|
||||||
type: "support_mesh",
|
type: "support_mesh",
|
||||||
text: catalog.i18nc("@label", "Print as support")
|
text: catalog.i18nc("@label", "Print as support")
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
meshTypePropertyProvider.key = "anti_overhang_mesh";
|
||||||
|
if(meshTypePropertyProvider.properties.enabled == "True")
|
||||||
|
{
|
||||||
meshTypeModel.append({
|
meshTypeModel.append({
|
||||||
type: "anti_overhang_mesh",
|
type: "anti_overhang_mesh",
|
||||||
text: catalog.i18nc("@label", "Don't support overlap with other models")
|
text: catalog.i18nc("@label", "Don't support overlap with other models")
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
meshTypePropertyProvider.key = "cutting_mesh";
|
||||||
|
if(meshTypePropertyProvider.properties.enabled == "True")
|
||||||
|
{
|
||||||
meshTypeModel.append({
|
meshTypeModel.append({
|
||||||
type: "cutting_mesh",
|
type: "cutting_mesh",
|
||||||
text: catalog.i18nc("@label", "Modify settings for overlap with other models")
|
text: catalog.i18nc("@label", "Modify settings for overlap with other models")
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
meshTypePropertyProvider.key = "infill_mesh";
|
||||||
|
if(meshTypePropertyProvider.properties.enabled == "True")
|
||||||
|
{
|
||||||
meshTypeModel.append({
|
meshTypeModel.append({
|
||||||
type: "infill_mesh",
|
type: "infill_mesh",
|
||||||
text: catalog.i18nc("@label", "Modify settings for infill of other models")
|
text: catalog.i18nc("@label", "Modify settings for infill of other models")
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
meshTypeSelection.updateCurrentIndex();
|
meshTypeSelection.updateCurrentIndex();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function updateCurrentIndex()
|
function updateCurrentIndex()
|
||||||
{
|
{
|
||||||
var mesh_type = UM.ActiveTool.properties.getValue("MeshType");
|
var mesh_type = UM.ActiveTool.properties.getValue("MeshType");
|
||||||
|
meshTypeSelection.currentIndex = -1;
|
||||||
for(var index=0; index < meshTypeSelection.model.count; index++)
|
for(var index=0; index < meshTypeSelection.model.count; index++)
|
||||||
{
|
{
|
||||||
if(meshTypeSelection.model.get(index).type == mesh_type)
|
if(meshTypeSelection.model.get(index).type == mesh_type)
|
||||||
|
@ -94,6 +120,16 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: Cura.MachineManager
|
||||||
|
onGlobalContainerChanged:
|
||||||
|
{
|
||||||
|
meshTypeSelection.model.clear();
|
||||||
|
meshTypeSelection.populateModel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections
|
Connections
|
||||||
{
|
{
|
||||||
target: UM.Selection
|
target: UM.Selection
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue