Browse Source

Hide the Override button if it is not an option

CL-1259
Simon Edwards 5 years ago
parent
commit
d70acc793f

+ 15 - 0
plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml

@@ -30,6 +30,21 @@ UM.Dialog
                 OutputDevice.forceSendJob(printer.activePrintJob.key)
                 overrideConfirmationDialog.close()
             }
+            visible:
+            {
+                if (!printer || !printer.activePrintJob)
+                {
+                    return true
+                }
+
+                var canOverride = false
+                for (var i = 0; i < printer.activePrintJob.configurationChanges.length; i++)
+                {
+                    var change = printer.activePrintJob.configurationChanges[i]
+                    canOverride = canOverride || change.typeOfChange === "material_change";
+                }
+                return canOverride
+            }
         },
         Button
         {