From 6dc43f9ed1a51d5811c01d316726ea3149c2ff7c Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 20 May 2019 10:59:51 +0200 Subject: [PATCH] Hide override button if it can't be overridden Contributes to CL-1259 --- .../resources/qml/MonitorConfigOverrideDialog.qml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index 1c61504103..d380915633 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -32,18 +32,23 @@ UM.Dialog } visible: { + // Don't show the button if we're missing a printer or print job 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++) { 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