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; + } }