mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 15:45:52 +08:00
Disable configuration menu if there are no configurations
This then prevents you from dropping down into an empty menu. Contributes to issue CURA-5876.
This commit is contained in:
parent
1e69960464
commit
298c68c93b
@ -102,6 +102,23 @@ Cura.ExpandableComponent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Disable the menu if there are no materials, variants or build plates to change.
|
||||||
|
function updateEnabled()
|
||||||
|
{
|
||||||
|
var active_definition_id = Cura.MachineManager.activeMachine.definition.id;
|
||||||
|
var has_materials = Cura.ContainerManager.getContainerMetaDataEntry(active_definition_id, "has_materials");
|
||||||
|
var has_variants = Cura.ContainerManager.getContainerMetaDataEntry(active_definition_id, "has_variants");
|
||||||
|
var has_buildplates = Cura.ContainerManager.getContainerMetaDataEntry(active_definition_id, "has_variant_buildplates");
|
||||||
|
base.enabled = has_materials || has_variants || has_buildplates; //Only let it drop down if there is any configuration that you could change.
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: Cura.MachineManager
|
||||||
|
onGlobalContainerChanged: base.updateEnabled();
|
||||||
|
}
|
||||||
|
Component.onCompleted: updateEnabled();
|
||||||
|
|
||||||
popupItem: Column
|
popupItem: Column
|
||||||
{
|
{
|
||||||
id: popupItem
|
id: popupItem
|
||||||
|
Loading…
x
Reference in New Issue
Block a user