Implemented auto-loading and save button
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user