bug: fixing insertion bugs of many items

Videos, images, and presentations were all look at the wrong index. I
needed to look for the count - 1 in order to find the right index from
the model when switching to the editMode
This commit is contained in:
Chris Cochrun 2023-05-17 11:09:21 -05:00
parent 085ede2e04
commit 4dc4036dda
2 changed files with 116 additions and 98 deletions

View file

@ -36,6 +36,14 @@ Kirigami.OverlaySheet {
text: ""
onEditingFinished: videoInput.text.startsWith("http") ? loadVideo() : showPassiveNotification("Coach called, this isn't it.");
}
Controls.ToolButton {
id: localButton
text: "Local Video"
icon.name: "fileopen"
hoverEnabled: true
onClicked: videoFileDialog.open()
}
}
}
@ -117,6 +125,24 @@ Kirigami.OverlaySheet {
}
}
FileDialog {
id: videoFileDialog
title: "Please choose a video"
folder: shortcuts.home
selectMultiple: false
nameFilters: ["Video files (*.mp4 *.mkv *.mov *.wmv *.avi *.MP4 *.MOV *.MKV)"]
onAccepted: {
console.log("video = " + videoFileDialog.fileUrls[0]);
addVideo(videoFileDialog.fileUrls[0]);
root.close();
}
onRejected: {
console.log("Canceled")
}
}
}
function loadVideo() {