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
}
}
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 { */
/* Layout.fillWidth: true */
@ -276,10 +287,14 @@ Kirigami.ApplicationWindow {
function finalSave(file) {
const saved = mainPage.serviceItems.save(file);
saved ? RSettings.setSaveFile(file)
: console.log("File: " + file + " wasn't saved");
saved ? showPassiveNotification("SAVED! " + file)
: showPassiveNotification("Didn't save file");
if (saved) {
RSettings.setSaveFile(file);
showPassiveNotification("SAVED! " + file);
mainPage.progress = 0;
} else {
console.log("File: " + file + " wasn't saved");
showPassiveNotification("Didn't save file");
}
}
function load() {

View file

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