mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Hide override button if it can't be overridden
Contributes to CL-1259
This commit is contained in:
parent
3cf2e19692
commit
6dc43f9ed1
1 changed files with 9 additions and 4 deletions
|
@ -32,18 +32,23 @@ UM.Dialog
|
||||||
}
|
}
|
||||||
visible:
|
visible:
|
||||||
{
|
{
|
||||||
|
// Don't show the button if we're missing a printer or print job
|
||||||
if (!printer || !printer.activePrintJob)
|
if (!printer || !printer.activePrintJob)
|
||||||
{
|
{
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
var canOverride = false
|
// Check each required change...
|
||||||
for (var i = 0; i < printer.activePrintJob.configurationChanges.length; i++)
|
for (var i = 0; i < printer.activePrintJob.configurationChanges.length; i++)
|
||||||
{
|
{
|
||||||
var change = printer.activePrintJob.configurationChanges[i]
|
var change = printer.activePrintJob.configurationChanges[i]
|
||||||
canOverride = canOverride || change.typeOfChange === "material_change";
|
// If that type of change is in the list of blocking changes, hide the button
|
||||||
|
if (!change.canOverride)
|
||||||
|
{
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return canOverride
|
return true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Button
|
Button
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue