mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 04:54:04 -06: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
1 changed files with 17 additions and 0 deletions
|
@ -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
|
||||
{
|
||||
id: popupItem
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue