ui for a ProgressBar that shows the state of saving the presentation

This commit is contained in:
Chris Cochrun 2024-04-14 10:48:02 -05:00
parent a2ba6e70bd
commit 77e98c4682
2 changed files with 29 additions and 5 deletions

View file

@ -109,6 +109,17 @@ Kirigami.ApplicationWindow {
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
} }
} }
Controls.ProgressBar {
id: footerSaveProgress
anchors.left: footerFilePathLabel.left
anchors.right: footerFilePathLabel.right
anchors.rightMargin: footerFilePathLabel.rightMargin
from: 0
to: 100
value: mainPage.progress
visible: mainPage.progress > 0
}
} }
/* Item { */ /* Item { */
/* Layout.fillWidth: true */ /* Layout.fillWidth: true */
@ -276,10 +287,14 @@ Kirigami.ApplicationWindow {
function finalSave(file) { function finalSave(file) {
const saved = mainPage.serviceItems.save(file); const saved = mainPage.serviceItems.save(file);
saved ? RSettings.setSaveFile(file) if (saved) {
: console.log("File: " + file + " wasn't saved"); RSettings.setSaveFile(file);
saved ? showPassiveNotification("SAVED! " + file) showPassiveNotification("SAVED! " + file);
: showPassiveNotification("Didn't save file"); mainPage.progress = 0;
} else {
console.log("File: " + file + " wasn't saved");
showPassiveNotification("Didn't save file");
}
} }
function load() { function load() {

View file

@ -39,6 +39,7 @@ Controls.Page {
property int dragItemSlideNumber property int dragItemSlideNumber
property bool editing: true property bool editing: true
property int progress: 0
property Item slideItem property Item slideItem
property var song property var song
@ -54,6 +55,7 @@ Controls.Page {
property var dragHighlightLine property var dragHighlightLine
Component.onCompleted: { Component.onCompleted: {
changeServiceItem(0); changeServiceItem(0);
presentation.forceActiveFocus(); presentation.forceActiveFocus();
@ -180,6 +182,13 @@ Controls.Page {
/* songModel: songProxyModel.songModel() */ /* songModel: songProxyModel.songModel() */
} }
Connections {
target: ServiceItemModel
function saveProgressUpdate(progress) {
mainPage.progress = progress;
}
}
function changeServiceItem(index) { function changeServiceItem(index) {
console.log("change-service-item: " + index); console.log("change-service-item: " + index);
const item = ServiceItemC.getRust(index, ServiceItemModel); const item = ServiceItemC.getRust(index, ServiceItemModel);
@ -314,7 +323,7 @@ Controls.Page {
editMode = false; editMode = false;
refocusPresentation(); refocusPresentation();
footerFirstText = presenting ? "Presenting..." : "Presentation Preview"; footerFirstText = presenting ? "Presenting..." : "Presentation Preview";
footerSecondText = ObsModel.currentProgramScene; footerSecondText = ObsModel.currentProgramScene
} }
} else { } else {
videoEditor.visible = false; videoEditor.visible = false;