From 1bcdc0357e4d1ad0e1e4d05c39fa56d825c39b5c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 29 Dec 2017 14:32:43 +0100 Subject: [PATCH] If there is no added printer, disallow closing the window The state of having no printer added is very weird to the user. Let's prevent that from happening by accident. Contributes to issue CURA-4736. --- resources/qml/AddMachineDialog.qml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/qml/AddMachineDialog.qml b/resources/qml/AddMachineDialog.qml index 109ea07695..a635f1f8d1 100644 --- a/resources/qml/AddMachineDialog.qml +++ b/resources/qml/AddMachineDialog.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Ultimaker B.V. +// Copyright (c) 2017 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 @@ -25,6 +25,15 @@ UM.Dialog width: minimumWidth height: minimumHeight + flags: { + var window_flags = Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint; + if (Cura.MachineManager.activeDefinitionId !== "") //Disallow closing the window if we have no active printer yet. You MUST add a printer. + { + window_flags |= Qt.WindowCloseButtonHint; + } + return window_flags; + } + onVisibilityChanged: { // Reset selection and machine name