better debugging: all print statements are now console.log

This commit is contained in:
Chris Cochrun 2023-01-17 05:52:34 -06:00
parent d868571d72
commit d6da3b546c
16 changed files with 109 additions and 109 deletions

View file

@ -64,7 +64,7 @@ Item {
if (Math.abs(listItem.y - mouseArea.startY) > height && newIndex > -1 &&
newIndex !== index) {
print("old index is: " + index + " and new index is: " + newIndex);
console.log("old index is: " + index + " and new index is: " + newIndex);
root.moveRequested(index, newIndex);
}
}

View file

@ -39,7 +39,7 @@ Kirigami.ActionToolBar {
icon.name: "view-presentation"
text: presenting ? "Presenting" : "Go Live"
onTriggered: {
print("Window is loading");
console.log("Window is loading");
togglePresenting();
}
},

View file

@ -126,7 +126,7 @@ Item {
function changeImage(image) {
root.image = image;
print(image.filePath.toString());
console.log(image.filePath.toString());
}
function updateTitle(text) {

View file

@ -38,7 +38,7 @@ ColumnLayout {
Layout.fillHeight: true
Layout.fillWidth: true
onDropped: (drag) => {
print("DROPPED AT END");
console.log("DROPPED AT END");
appendItem(dragItemTitle,
dragItemType,
dragItemBackground,
@ -113,8 +113,8 @@ ColumnLayout {
/* onExited: dropHighlightLine.visible = false; */
onDropped: (drag) => {
print("DROPPED IN ITEM AREA: " + drag.keys);
print(dragItemIndex + " " + index);
console.log("DROPPED IN ITEM AREA: " + drag.keys);
console.log(dragItemIndex + " " + index);
const hlIndex = serviceItemList.currentIndex;
if (drag.keys[0] === "library") {
addItem(index,
@ -238,7 +238,7 @@ ColumnLayout {
}
onReleased: {
print("should drop");
console.log("should drop");
visServiceItem.Drag.drop();
}
}
@ -284,7 +284,7 @@ ColumnLayout {
return;
if (newIndex === -1)
newIndex = 0;
print("moveRequested: ", oldIndex, newIndex);
console.log("moveRequested: ", oldIndex, newIndex);
visualModel.items.move(oldIndex, newIndex);
indexDragged = newIndex;
serviceItemList.currentIndex = indexDragged;
@ -370,7 +370,7 @@ ColumnLayout {
Component.onCompleted: {
totalServiceItems = serviceItemList.count;
print("THE TOTAL SERVICE ITEMS: " + totalServiceItems);
console.log("THE TOTAL SERVICE ITEMS: " + totalServiceItems);
}
function removeItem(index) {
@ -381,7 +381,7 @@ ColumnLayout {
function addItem(index, name, type,
background, backgroundType, text, itemID) {
const newtext = songsqlmodel.getLyricList(itemID);
print("adding: " + name + " of type " + type);
console.log("adding: " + name + " of type " + type);
serviceItemModel.insertItem(index, name,
type, background,
backgroundType, newtext);
@ -389,16 +389,16 @@ ColumnLayout {
}
function appendItem(name, type, background, backgroundType, text, itemID) {
print("adding: " + name + " of type " + type);
console.log("adding: " + name + " of type " + type);
let lyrics;
if (type === "song") {
print(itemID);
console.log(itemID);
lyrics = songsqlmodel.getLyricList(itemID);
print(lyrics);
console.log(lyrics);
}
print(background);
print(backgroundType);
console.log(background);
console.log(backgroundType);
serviceItemModel.addItem(name, type, background,
backgroundType, lyrics);

View file

@ -75,7 +75,7 @@ Item {
selectedLibrary = ""
else
selectedLibrary = "songs"
print(selectedLibrary)
console.log(selectedLibrary)
}
}
}
@ -369,7 +369,7 @@ Item {
selectedLibrary = ""
else
selectedLibrary = "videos"
print(selectedLibrary)
console.log(selectedLibrary)
}
}
}
@ -652,7 +652,7 @@ Item {
selectedLibrary = ""
else
selectedLibrary = "images"
print(selectedLibrary)
console.log(selectedLibrary)
}
}
}
@ -934,7 +934,7 @@ Item {
selectedLibrary = ""
else
selectedLibrary = "presentations"
print(selectedLibrary)
console.log(selectedLibrary)
}
}
}
@ -1186,7 +1186,7 @@ Item {
selectedLibrary = ""
else
selectedLibrary = "slides"
print(selectedLibrary)
console.log(selectedLibrary)
}
}
}
@ -1309,15 +1309,15 @@ Item {
anchors.fill: parent
onDropped: drop => {
overlay = false;
print("dropped");
print(drop.urls);
console.log("dropped");
console.log(drop.urls);
/* thumbnailer.loadFile(drop.urls[0]); */
if (drop.urls.length > 1){
addFiles(drop.urls);
} else if (drop.urls.length === 1)
addFile(drop.urls[0]);
else if (drop.urls.length === 0)
print("stoppp it ya dum dum");
console.log("stoppp it ya dum dum");
}
onEntered: {
if (isDragFile(drag.urls[0]))
@ -1329,7 +1329,7 @@ Item {
videosqlmodel.newVideo(url);
selectedLibrary = "videos";
videoLibraryList.currentIndex = videosqlmodel.rowCount();
print(videosqlmodel.getVideo(videoLibraryList.currentIndex));
console.log(videosqlmodel.getVideo(videoLibraryList.currentIndex));
const video = videosqlmodel.getVideo(videoLibraryList.currentIndex);
showPassiveNotification("newest video: " + video.title);
if (!editMode)
@ -1341,7 +1341,7 @@ Item {
imagesqlmodel.newImage(url);
selectedLibrary = "images";
imageLibraryList.currentIndex = imagesqlmodel.rowCount();
print(imagesqlmodel.getImage(imageLibraryList.currentIndex));
console.log(imagesqlmodel.getImage(imageLibraryList.currentIndex));
const image = imagesqlmodel.getImage(imageLibraryList.currentIndex);
showPassiveNotification("newest image: " + image.title);
if (!editMode)
@ -1350,16 +1350,16 @@ Item {
}
function addPres(url) {
print(pdf.status);
console.log(pdf.status);
pdf.source = url;
while (pdf.status != 2) {
print(pdf.status);
print("PAGECOUNT: " + pdf.pageCount);
console.log(pdf.status);
console.log("PAGECOUNT: " + pdf.pageCount);
}
pressqlmodel.newPresentation(url, pdf.pageCount);
selectedLibrary = "presentations";
presentationLibraryList.currentIndex = pressqlmodel.rowCount();
print(pressqlmodel.getPresentation(presentationLibraryList.currentIndex));
console.log(pressqlmodel.getPresentation(presentationLibraryList.currentIndex));
const presentation = pressqlmodel.getImage(presentationLibraryList.currentIndex);
showPassiveNotification("newest image: " + presentation.title);
if (!editMode)
@ -1373,7 +1373,7 @@ Item {
var valid = false;
if(extension) {
print(extension);
console.log(extension);
valid = true;
}
@ -1440,10 +1440,10 @@ Item {
enableAudio: false
width: 0
height: 0
Component.onCompleted: print("ready")
Component.onCompleted: console.log("ready")
onFileLoaded: {
thumbnailer.pause();
print("FILE: " + thumbnailer.mediaTitle);
console.log("FILE: " + thumbnailer.mediaTitle);
thumbnailer.screenshotToFile(thumbnailFile(thumbnailer.mediaTitle));
showPassiveNotification("Screenshot Taken to: " + thumbnailFile(thumbnailer.mediaTitle));
thumbnailer.stop();

View file

@ -157,13 +157,13 @@ Controls.Page {
function changeServiceItem(index) {
const item = serviceItemModel.getItem(index);
currentServiceItem = index;
print("index grabbed: " + index);
print(item);
console.log("index grabbed: " + index);
console.log(item);
presentation.stopVideo();
pWindow.stopVideo();
/* presentation.itemType = item.type; */
print("Time to start changing");
console.log("Time to start changing");
serviceItemModel.activate(index);
SlideObject.changeSlide(item);
@ -177,7 +177,7 @@ Controls.Page {
/* serviceItemModel.select(index); */
/* presentation.changeSlide(); */
print("Slide changed to: " + item.name);
console.log("Slide changed to: " + item.name);
}
function loopVideo() {
@ -256,10 +256,10 @@ Controls.Page {
if (present)
{
presentation.loadVideo();
print("For window: Screen is: " + pWindow.screen + " And selected screen is: " + presentationScreen);
console.log("For window: Screen is: " + pWindow.screen + " And selected screen is: " + presentationScreen);
pWindow.showFullScreen();
/* pWindow.screen = presentationScreen; */
print("For window: Screen is: " + pWindow.screen + " And selected screen is: " + presentationScreen);
console.log("For window: Screen is: " + pWindow.screen + " And selected screen is: " + presentationScreen);
}
else
pWindow.close();

View file

@ -253,14 +253,14 @@ FocusScope {
function nextSlideAction() {
keyHandler.forceActiveFocus();
print(currentServiceItem);
console.log(currentServiceItem);
const nextServiceItemIndex = currentServiceItem + 1;
const nextItem = serviceItemModel.getItem(nextServiceItemIndex);
print("currentServiceItem " + currentServiceItem);
print("nextServiceItem " + nextServiceItemIndex);
print(nextItem.name);
console.log("currentServiceItem " + currentServiceItem);
console.log("nextServiceItem " + nextServiceItemIndex);
console.log(nextItem.name);
const change = SlideObject.next(nextItem);
print(change);
console.log(change);
if (currentServiceItem === totalServiceItems - 1 & change)
return;
if (change) {
@ -273,18 +273,18 @@ FocusScope {
function nextSlide() {
changeServiceItem(currentServiceItem++);
print(slideItem);
console.log(slideItem);
}
function previousSlideAction() {
keyHandler.forceActiveFocus();
const prevServiceItemIndex = currentServiceItem - 1;
const prevItem = serviceItemModel.getItem(prevServiceItemIndex);
print("currentServiceItem " + currentServiceItem);
print("prevServiceItem " + prevServiceItemIndex);
print(prevItem.name);
console.log("currentServiceItem " + currentServiceItem);
console.log("prevServiceItem " + prevServiceItemIndex);
console.log(prevItem.name);
const change = SlideObject.previous(prevItem);
print(change);
console.log(change);
if (currentServiceItem === 0 & change) {
return;
};
@ -298,13 +298,13 @@ FocusScope {
function previousSlide() {
changeServiceItem(--currentServiceItem);
print(slideItem);
console.log(slideItem);
}
function changeSlide() {
if (itemType === "song") {
SlideObject.setText(root.text[textIndex]);
print(root.text[textIndex]);
console.log(root.text[textIndex]);
textIndex++;
} else if (itemType === "video") {
clearText();

View file

@ -149,7 +149,7 @@ Item {
function changePresentation(presentation) {
root.presentation = presentation;
print(presentation.filePath.toString());
console.log(presentation.filePath.toString());
updatePageCount(presentationPreview.frameCount);
console.log("page count " + presentation.pageCount);
}

View file

@ -28,7 +28,7 @@ Window {
}
Component.onCompleted: {
print(screen.name);
console.log(screen.name);
}
Presenter.Slide {
@ -71,7 +71,7 @@ Window {
}
function stopVideo() {
print("####I STOPPING####");
console.log("####I STOPPING####");
presentationSlide.stopVideo()
}

View file

@ -39,8 +39,8 @@ Item {
model: outerModelData.slideNumber === 0 ? 1 : outerModelData.slideNumber
Component.onCompleted: {
if (name === "Death Was Arrested") {
showPassiveNotification("Number of slides: " + outerModelData.slideNumber);
showPassiveNotification("model number: " + model);
console.log("Number of slides: " + outerModelData.slideNumber);
console.log("model number: " + model);
}
}
/* Rectangle { width: 20; height: 20; radius: 10; color: "green" } */

View file

@ -59,7 +59,7 @@ Item {
Layout.fillHeight: true
Layout.fillWidth: true
onDropped: (drag) => {
print("DROPPED AT END");
console.log("DROPPED AT END");
showPassiveNotification(drag.source.title);
appendItem(dragItemTitle,
dragItemType,
@ -105,8 +105,8 @@ Item {
}
onDropped: (drag) => {
print("DROPPED IN ITEM AREA: " + drag.keys);
print(dragItemIndex + " " + index);
console.log("DROPPED IN ITEM AREA: " + drag.keys);
console.log(dragItemIndex + " " + index);
const hlIndex = serviceItemList.currentIndex;
if (drag.keys[0] === "library") {
addItem(index,
@ -251,7 +251,7 @@ Item {
}
onReleased: {
print("should drop");
console.log("should drop");
visServiceItem.Drag.drop();
}
}
@ -347,7 +347,7 @@ Item {
/* } */
/* function moveRequested(oldIndex, newIndex) { */
/* print("moveRequested: ", oldIndex, newIndex); */
/* console.log("moveRequested: ", oldIndex, newIndex); */
/* serviceItemModel.moveRows(oldIndex, newIndex, 1); */
/* indexDragged = newIndex; */
/* serviceItemList.currentIndex = newIndex; */
@ -373,7 +373,7 @@ Item {
contextType: "2d"
renderStrategy: Canvas.Threaded
onPaint: {
print(Kirigami.Theme.hoverColor.name());
console.log(Kirigami.Theme.hoverColor.name());
var ctx = getContext("2d");
ctx.fillRule = Qt.OddEvenFill
ctx.fillStyle = Kirigami.Theme.hoverColor.rgb();
@ -495,7 +495,7 @@ Item {
Component.onCompleted: {
totalServiceItems = serviceItemList.count;
print("THE TOTAL SERVICE ITEMS: " + totalServiceItems);
console.log("THE TOTAL SERVICE ITEMS: " + totalServiceItems);
}
function removeItem(index) {
@ -508,7 +508,7 @@ Item {
font, fontSize, itemID) {
if (type === "song") {
const newtext = songsqlmodel.getLyricList(itemID);
print("adding: " + name + " of type " + type + " with " + newtext.length + " slides");
console.log("adding: " + name + " of type " + type + " with " + newtext.length + " slides");
serviceItemModel.insertItem(index, name,
type, background,
backgroundType, newtext,
@ -517,7 +517,7 @@ Item {
return;
}
if (type === "presentation") {
print("adding: " + name + " of type " + type + " with " + dragItemSlideNumber + " slides");
console.log("adding: " + name + " of type " + type + " with " + dragItemSlideNumber + " slides");
serviceItemModel.insertItem(index, name,
type, background,
backgroundType, "",
@ -525,7 +525,7 @@ Item {
totalServiceItems++;
return;
}
print("adding: " + name + " of type " + type);
console.log("adding: " + name + " of type " + type);
serviceItemModel.insertItem(index, name,
type, background,
backgroundType);
@ -534,13 +534,13 @@ Item {
function appendItem(name, type, background, backgroundType,
text, audio, font, fontSize, itemID) {
print("adding: " + name + " of type " + type);
console.log("adding: " + name + " of type " + type);
let lyrics;
if (type === "song") {
print("THIS IS A SONG!!!!!");
print(itemID);
console.log("THIS IS A SONG!!!!!");
console.log(itemID);
lyrics = songsqlmodel.getLyricList(itemID);
print(lyrics);
console.log(lyrics);
serviceItemModel.addItem(name, type, background,
backgroundType, lyrics,
audio, font, fontSize);
@ -548,8 +548,8 @@ Item {
return;
};
print(background);
print(backgroundType);
console.log(background);
console.log(backgroundType);
serviceItemModel.addItem(name, type, background,
backgroundType);

View file

@ -79,7 +79,7 @@ Item {
/* showPassiveNotification("YIPPEEE!") */
mpv.loadFile(videoSource.toString());
if (editMode) {
print("WHY AREN'T YOU PASUING!");
console.log("WHY AREN'T YOU PASUING!");
pauseTimer.restart();
}
blackTimer.restart();
@ -194,7 +194,7 @@ Item {
function stopVideo() {
mpv.stop();
black.visible = true;
print("Stopped video");
console.log("Stopped video");
}
function seek(pos) {

View file

@ -109,8 +109,8 @@ Item {
}
function appendVerse(verse) {
/* print("Let's append some verses") */
/* print(verse); */
/* console.log("Let's append some verses") */
/* console.log(verse); */
songModel.append({"verse": verse})
}
@ -147,7 +147,7 @@ Item {
function playPauseSlide() {
firstItem = slideList.itemAtIndex(0);
print(firstItem);
console.log(firstItem);
playingVideo = !playingVideo;
/* firstItem.editMode = false; */
firstItem.playPauseVideo();
@ -166,7 +166,7 @@ Item {
for (var i = 0; i < slideList.count; ++i) {
slideList.currentIndex = i;
slideList.currentItem.representation.loadVideo();
print(slideList.currentItem);
console.log(slideList.currentItem);
}
}

View file

@ -278,10 +278,10 @@ Item {
nameFilters: ["Audio files (*.mp3 *.flac *.wav *.opus *.MP3 *.FLAC *.WAV *.OPUS)"]
onAccepted: {
updateAudioFile(audioFileDialog.fileUrls[0]);
print("audio = " + audioFileDialog.fileUrls[0]);
console.log("audio = " + audioFileDialog.fileUrls[0]);
}
onRejected: {
print("Canceled")
console.log("Canceled")
}
}
@ -294,10 +294,10 @@ Item {
nameFilters: ["Video files (*.mp4 *.mkv *.mov *.wmv *.avi *.MP4 *.MOV *.MKV)"]
onAccepted: {
updateBackground(videoFileDialog.fileUrls[0], "video");
print("video background = " + videoFileDialog.fileUrls[0]);
console.log("video background = " + videoFileDialog.fileUrls[0]);
}
onRejected: {
print("Canceled")
console.log("Canceled")
}
}
@ -310,17 +310,17 @@ Item {
nameFilters: ["Image files (*.jpg *.jpeg *.png *.JPG *.JPEG *.PNG)"]
onAccepted: {
updateBackground(imageFileDialog.fileUrls[0], "image");
print("image background = " + imageFileDialog.fileUrls[0]);
console.log("image background = " + imageFileDialog.fileUrls[0]);
}
onRejected: {
print("Canceled")
console.log("Canceled")
}
}
function changeSong(index) {
clearSlides();
print(index);
console.log(index);
const s = songsqlmodel.getSong(index);
song = s;
songLyrics = s.lyrics;
@ -340,7 +340,7 @@ Item {
changeSlideFont(song.font, true);
changeSlideFontSize(song.fontSize, true)
changeSlideText(songIndex);
print(s.title);
console.log(s.title);
}
function updateLyrics(lyrics) {
@ -379,7 +379,7 @@ Item {
song.background = background;
songsqlmodel.updateBackground(songIndex, background);
songsqlmodel.updateBackgroundType(songIndex, backgroundType);
print("changed background");
console.log("changed background");
if (backgroundType === "image") {
//todo
slideEditor.videoBackground = "";
@ -467,7 +467,7 @@ Item {
}
function changeSlideText(id) {
/* print("Here are the verses: " + verses); */
/* console.log("Here are the verses: " + verses); */
const verses = songsqlmodel.getLyricList(id);
verses.forEach(slideEditor.appendVerse);
/* slideEditor.loadVideo(); */

View file

@ -223,9 +223,9 @@ Item {
}
function stop() {
print("stopping video");
console.log("stopping video");
videoPreview.pause();
print("quit mpv");
console.log("quit mpv");
}
function updateEndTime(value) {