From 28f9de31d5df34db82ce026addf983df334e392e Mon Sep 17 00:00:00 2001 From: Bent Witthold Date: Wed, 8 Apr 2026 17:23:50 +0200 Subject: [PATCH] Clean up and formatting. --- Main.qml | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/Main.qml b/Main.qml index 09941f8..e04cb96 100644 --- a/Main.qml +++ b/Main.qml @@ -4,13 +4,12 @@ import QtQuick.Layouts import QtQml.Models Window { + id: window property bool discardChangesOnExit: false property bool isDataModified: !appUndoStack.isClean property string titleClean: `${Application.name}` property string titleDirty: `${Application.name}` + " *" - - id: window width: 480 height: 800 visible: true @@ -50,16 +49,16 @@ Window { // // } // } onClosing: event => { - if (appUndoStack.clean) { - console.debug("Closing on a clean undo stack.") - } else { - console.debug("Closing on an unclean undo stack!") - if (!window.discardChangesOnExit) { - event.accepted = false - exitOnUnsavedChangesDialog.open() - } - } - } + if (appUndoStack.clean) { + console.debug("Closing on a clean undo stack."); + } else { + console.debug("Closing on an unclean undo stack!"); + if (!window.discardChangesOnExit) { + event.accepted = false; + exitOnUnsavedChangesDialog.open(); + } + } + } Dialog { id: exitOnUnsavedChangesDialog @@ -70,20 +69,20 @@ Window { standardButtons: Dialog.Yes | Dialog.Cancel | Dialog.Discard contentItem: Label { - text: "Do you want save your changes?" + text: "Do you want save your changes?\n" + "Or discard them?" } onAccepted: { - core.saveItems() - window.close() + core.saveItems(); + window.close(); } onDiscarded: { - window.discardChangesOnExit = true - window.close() + window.discardChangesOnExit = true; + window.close(); } onRejected: { - console.debug("Canceling exit...") + console.debug("Canceling exit..."); } } }