Implemented auto-loading and save button

This commit is contained in:
2023-02-21 21:51:15 +01:00
parent 0fc128b369
commit f3f369e044
7 changed files with 237 additions and 100 deletions

View File

@@ -1,5 +1,6 @@
import QtQuick
import QtQuick.Controls.Material
import QtQuick.Dialogs
import QtQuick.Layouts
Pane {
@@ -20,6 +21,33 @@ Pane {
font.pixelSize: 72
}
Button {
text: "\ue161"
font.family: materialIcons.font.family
font.pixelSize: 20
onPressed: {
if (typeof __controller.settings.lastProjectFile == "string" && __controller.settings.lastProjectFile !== "") {
console.log(__controller.settings.lastProjectFile);
if (!__controller.saveProject(__controller.settings.lastProjectFile)) {
console.warn('failed to save');
}
} else {
fileDialog.open();
}
}
FileDialog {
id: fileDialog
title: qsTr("Please select where to save the project file")
fileMode: FileDialog.SaveFile
onAccepted: {
if (!__controller.saveProject(fileDialog.selectedFile)) {
console.warn('failed to save');
}
}
}
}
Label {
Layout.fillWidth: true
Layout.fillHeight: true