Refactoring to slide_model and service_item getting the data from db

This is kinda a broken commit. There isn't any order to the adding of
the slide anymore. So it'll need to find a way of keeping track of
where all the current slides are and then insert the new ones in the
correct order while moving the others around as well.
This commit is contained in:
Chris Cochrun 2024-10-02 14:48:16 -05:00
parent 6052cd01ac
commit 2c014e242f
9 changed files with 347 additions and 604 deletions

View file

@ -50,12 +50,12 @@ Item {
chosenFont: model.font
text: model.text
pdfIndex: model.slideIndex
Connections {
target: slideModel
function onDataChanged() {
Utils.dbg("hi")
}
}
/* Connections { */
/* target: slideModel */
/* function onDataChanged() { */
/* Utils.dbg("hi") */
/* } */
/* } */
}
/* WebEngineView { */

View file

@ -559,9 +559,7 @@ Item {
const image = imageModel.getItem(itemIndex);
console.log("adding: " + image.title + " of type " + type);
ServiceItemModel.insertItem(index, image.title,
"", type, image.filePath,
"image", "",
"", 0, 0, false, 0.0, 0.0, itemIndex);
type, image.id);
serviceItemList.forceLayout()
return;
}
@ -569,9 +567,7 @@ Item {
const video = videoModel.getItem(itemIndex);
console.log("adding: " + video.title + " of type " + type);
ServiceItemModel.insertItem(index, video.title,
"", type, video.filePath,
"video", "",
"", 0, 0, video.loop, video.startTime, video.endTime, itemIndex);
type, video.id);
serviceItemList.forceLayout()
return;
}
@ -583,10 +579,7 @@ Item {
" of type " + type +
" with " + lyrics.length + " slides");
ServiceItemModel.insertItem(index, song.title,
lyrics, type, song.background,
song.backgroundType,
song.audio, song.font, song.fontSize,
lyrics.length, true, 0.0, 0.0, itemIndex);
type, song.id);
serviceItemList.forceLayout()
return;
}
@ -595,10 +588,7 @@ Item {
console.log("adding: " + pres.title +
" of type " + type +
" with " + pres.pageCount + " slides");
ServiceItemModel.insertItem(index, pres.title,
"", type, pres.filePath,
"image",
"", "", 0, pres.pageCount, false, 0.0, 0.0, itemIndex);
ServiceItemModel.insertItem(index, pres.title, type, pres.id);
serviceItemList.forceLayout()
return;
}
@ -614,9 +604,7 @@ Item {
const image = imageModel.getItem(itemIndex);
console.log("adding: " + image.title + " of type " + type);
ServiceItemModel.addItem(image.title,
type, image.filePath,
"image", "", "",
"", 0, 0, false, 0.0, 0.0, itemIndex);
type, image.id);
serviceItemList.forceLayout()
return;
}
@ -624,9 +612,7 @@ Item {
const video = videoModel.getItem(itemIndex);
console.log("adding: " + video.title + " of type " + type);
ServiceItemModel.addItem(video.title,
type, video.filePath,
"video", "", "",
"", 0, 0, video.loop, video.startTime, video.endTime, itemIndex);
type, video.id);
serviceItemList.forceLayout()
return;
}
@ -637,10 +623,7 @@ Item {
" of type " + type +
" with " + lyrics.length + " slides");
ServiceItemModel.addItem(song.title,
type, song.background,
song.backgroundType, lyrics,
song.audio, song.font, song.fontSize,
lyrics.length, true, 0.0, 0.0, itemIndex);
type, song.id);
serviceItemList.forceLayout()
return;
}
@ -650,10 +633,7 @@ Item {
" of type " + type +
" with " + pres.pageCount + " slides");
ServiceItemModel.addItem(pres.title,
type, pres.filePath,
"image", "",
"", "", 0, pres.pageCount,
false, 0.0, 0.0, itemIndex);
type, pres.id);
serviceItemList.forceLayout()
return;
}