From f69d17d08b7fe7ac3f004f70fa5e6d6454210bcc Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Wed, 28 Sep 2022 11:26:28 -0500 Subject: [PATCH] allow for udpating video and pres titles --- src/qml/presenter/PresentationEditor.qml | 14 +++++++++++++- src/qml/presenter/VideoEditor.qml | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/qml/presenter/PresentationEditor.qml b/src/qml/presenter/PresentationEditor.qml index a4239f0..dc2fec6 100644 --- a/src/qml/presenter/PresentationEditor.qml +++ b/src/qml/presenter/PresentationEditor.qml @@ -126,7 +126,7 @@ Item { placeholderText: "Title..." text: presentation.title padding: 10 - /* onEditingFinished: updateTitle(text); */ + onEditingFinished: updateTitle(text); } Item { @@ -187,4 +187,16 @@ Item { root.presentation = presentation; print(presentation.filePath.toString()); } + + function updateTitle(text) { + changeTitle(text, false); + pressqlmodel.updateTitle(presentation.id, text); + showPassiveNotification(presentation.title); + } + + function changeTitle(text, updateBox) { + if (updateBox) + presentationTitleField.text = text; + presentation.title = text; + } } diff --git a/src/qml/presenter/VideoEditor.qml b/src/qml/presenter/VideoEditor.qml index 04cfbae..0e4f4a1 100644 --- a/src/qml/presenter/VideoEditor.qml +++ b/src/qml/presenter/VideoEditor.qml @@ -140,7 +140,7 @@ Item { placeholderText: "Song Title..." text: video.title padding: 10 - /* onEditingFinished: updateTitle(text); */ + onEditingFinished: updateTitle(text); } RowLayout { @@ -275,4 +275,16 @@ Item { videoPreview.pause(); print("quit mpv"); } + + function updateTitle(text) { + changeTitle(text, false); + videosqlmodel.updateTitle(video.id, text); + showPassiveNotification(video.title); + } + + function changeTitle(text, updateBox) { + if (updateBox) + videoTitleField.text = text; + video.title = text; + } }