ui is done for asynchronous saving

This commit is contained in:
Chris Cochrun 2024-04-21 13:42:50 -05:00
parent 1105a061bf
commit 99178dbfe4
3 changed files with 22 additions and 17 deletions

View file

@ -112,13 +112,11 @@ Kirigami.ApplicationWindow {
Controls.ProgressBar {
id: footerSaveProgress
anchors.left: footerFilePathLabel.left
anchors.right: footerFilePathLabel.right
anchors.rightMargin: footerFilePathLabel.rightMargin
anchors.fill: parent
from: 0.0
to: 100.0
value: Math.min(ServiceItemModel.saveProgess, 100.0)
/* visible: mainPage.progress > 0 */
value: mainPage.progress
visible: mainPage.progress > 0
}
}
/* Item { */
@ -292,11 +290,18 @@ Kirigami.ApplicationWindow {
let path = file.toString();
path = path.replace(/^(file:\/{2})/,"");
let cleanPath = decodeURIComponent(path);
showPassiveNotification("Saved to ", + cleanPath);
showPassiveNotification("Saved to " + cleanPath, 2000);
resetSavedTimer.restart();
}
}
}
Timer {
id: resetSavedTimer
interval: 2000
onTriggered: ServiceItemModel.saveProgress = 0;
}
/* function finalSave(file) { */
/* const saved = mainPage.serviceItems.save(file); */
/* } */

View file

@ -39,7 +39,7 @@ Controls.Page {
property int dragItemSlideNumber
property bool editing: true
property int progress: 0
property int progress: ServiceItemModel.saveProgress
property Item slideItem
property var song