fixing some small bugs

This commit is contained in:
Chris Cochrun 2022-03-16 07:21:30 -05:00
parent c35c0f6550
commit 5a1fa3fc75
5 changed files with 12 additions and 7 deletions

View file

@ -502,7 +502,7 @@ void MpvObject::playPause()
void MpvObject::stop() void MpvObject::stop()
{ {
command(QVariantList() << "stop" << "keep-playlist"); command(QVariantList() << "stop");
} }
void MpvObject::stepBackward() void MpvObject::stepBackward()

View file

@ -110,7 +110,7 @@ Item {
Kirigami.ActionToolBar { Kirigami.ActionToolBar {
height: 40 height: 40
width: parent.width width: parent.width
display: Button.IconOnly display: Controls.Button.IconOnly
visible: selectedLibrary == "songs" visible: selectedLibrary == "songs"
actions: [ actions: [
Kirigami.Action { Kirigami.Action {
@ -455,7 +455,6 @@ Item {
else{ else{
videoLibraryList.currentIndex = index videoLibraryList.currentIndex = index
const video = videosqlmodel.getVideo(videoLibraryList.currentIndex); const video = videosqlmodel.getVideo(videoLibraryList.currentIndex);
/* showPassiveNotification("selected video: " + video); */
if (!editMode) if (!editMode)
editMode = true; editMode = true;
editSwitch("video", video); editSwitch("video", video);
@ -673,6 +672,7 @@ Item {
editMode = true; editMode = true;
editSwitch("video", video); editSwitch("video", video);
} }
} }
Rectangle { Rectangle {

View file

@ -84,6 +84,7 @@ Controls.Page {
id: videoEditorComp id: videoEditorComp
Presenter.VideoEditor { Presenter.VideoEditor {
id: videoEditor id: videoEditor
Controls.StackView.onDeactivating: prePop()
} }
} }
@ -226,12 +227,15 @@ Controls.Page {
if (editMode) { if (editMode) {
switch (editType) { switch (editType) {
case "song" : case "song" :
mainPageArea.pop(Controls.StackView.Immediate);
mainPageArea.push(songEditorComp, Controls.StackView.Immediate); mainPageArea.push(songEditorComp, Controls.StackView.Immediate);
break; break;
case "video" : case "video" :
mainPageArea.pop(Controls.StackView.Immediate);
mainPageArea.push(videoEditorComp, {"video": item}, Controls.StackView.Immediate); mainPageArea.push(videoEditorComp, {"video": item}, Controls.StackView.Immediate);
break; break;
case "image" : case "image" :
mainPageArea.pop(Controls.StackView.Immediate);
mainPageArea.push(imageEditorComp, Controls.StackView.Immediate); mainPageArea.push(imageEditorComp, Controls.StackView.Immediate);
break; break;
default: default:

View file

@ -87,7 +87,7 @@ Item {
border.color: Kirigami.Theme.activeBackgroundColor border.color: Kirigami.Theme.activeBackgroundColor
border.width: 2 border.width: 2
} }
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent closePolicy: Controls.Popup.CloseOnEscape | Controls.Popup.CloseOnPressOutsideParent
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
Controls.ToolButton { Controls.ToolButton {
@ -171,7 +171,6 @@ Item {
onFileLoaded: { onFileLoaded: {
showPassiveNotification(video.title + " has been loaded"); showPassiveNotification(video.title + " has been loaded");
videoPreview.pause(); videoPreview.pause();
/* showPassiveNotification(mpv.getProperty("loop")); */
} }
} }
Rectangle { Rectangle {
@ -202,7 +201,7 @@ Item {
from: 0 from: 0
to: videoPreview.duration to: videoPreview.duration
/* value: videoPreview.postion */ /* value: videoPreview.postion */
live: false live: true
onMoved: videoPreview.seek(value); onMoved: videoPreview.seek(value);
} }
} }
@ -224,4 +223,6 @@ Item {
/* showPassiveNotification(video[0]); */ /* showPassiveNotification(video[0]); */
} }
} }
function prePop() { videoPreview.stop() }
} }

View file

@ -159,7 +159,7 @@ void VideoSqlModel::updateFilePath(const int &row, const QUrl &filePath) {
QVariantList VideoSqlModel::getVideo(const int &row) { QVariantList VideoSqlModel::getVideo(const int &row) {
qDebug() << "Row we are getting is " << row; qDebug() << "Row we are getting is " << row;
QVariantList video; QVariantList video;
QSqlRecord rec = record(row - 1); QSqlRecord rec = record(row);
qDebug() << rec.value("title"); qDebug() << rec.value("title");
video.append(rec.value("title")); video.append(rec.value("title"));
video.append(rec.value("filePath")); video.append(rec.value("filePath"));