allow for udpating video and pres titles

This commit is contained in:
Chris Cochrun 2022-09-28 11:26:28 -05:00
parent a43a2ab39b
commit f69d17d08b
2 changed files with 26 additions and 2 deletions

View file

@ -126,7 +126,7 @@ Item {
placeholderText: "Title..." placeholderText: "Title..."
text: presentation.title text: presentation.title
padding: 10 padding: 10
/* onEditingFinished: updateTitle(text); */ onEditingFinished: updateTitle(text);
} }
Item { Item {
@ -187,4 +187,16 @@ Item {
root.presentation = presentation; root.presentation = presentation;
print(presentation.filePath.toString()); 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;
}
} }

View file

@ -140,7 +140,7 @@ Item {
placeholderText: "Song Title..." placeholderText: "Song Title..."
text: video.title text: video.title
padding: 10 padding: 10
/* onEditingFinished: updateTitle(text); */ onEditingFinished: updateTitle(text);
} }
RowLayout { RowLayout {
@ -275,4 +275,16 @@ Item {
videoPreview.pause(); videoPreview.pause();
print("quit mpv"); 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;
}
} }