mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
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.
This commit is contained in:
parent
8b504c8acc
commit
1bcdc0357e
1 changed files with 10 additions and 1 deletions
|
@ -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.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
|
@ -25,6 +25,15 @@ UM.Dialog
|
||||||
width: minimumWidth
|
width: minimumWidth
|
||||||
height: minimumHeight
|
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:
|
onVisibilityChanged:
|
||||||
{
|
{
|
||||||
// Reset selection and machine name
|
// Reset selection and machine name
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue