tweaks to allow better html presentations

This commit is contained in:
Chris Cochrun 2023-08-07 07:21:04 -05:00
parent 50a8b618ad
commit e80f0216ae
3 changed files with 14 additions and 11 deletions

View file

@ -338,12 +338,17 @@ Item {
function addPres(url) { function addPres(url) {
console.log(pdf.status); console.log(pdf.status);
let pageCount = 1; let pageCount = 1;
pdf.source = url;
while (pdf.status != 2) { if (url.endsWith(".pdf")) {
console.log(pdf.status); pdf.source = url;
console.log("PAGECOUNT: " + pdf.pageCount); while (pdf.status != 2) {
pageCount = pdf.pageCount; console.log(pdf.status);
} console.log("PAGECOUNT: " + pdf.pageCount);
pageCount = pdf.pageCount;
}
} else
pageCount = 1;
presProxyModel.presentationModel.newItem(url, pageCount); presProxyModel.presentationModel.newItem(url, pageCount);
selectedLibrary = "presentation"; selectedLibrary = "presentation";
presentationLibrary.libraryList.currentIndex = presProxyModel.presentationModel.count() - 1; presentationLibrary.libraryList.currentIndex = presProxyModel.presentationModel.count() - 1;
@ -377,10 +382,7 @@ Item {
} }
if (presexts.includes(extension)) if (presexts.includes(extension))
{ {
if (file.endsWith(".html")) { addPres(file);
web.url = file;
} else
addPres(file);
} }
} }

View file

@ -128,6 +128,7 @@ Item {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
url: isHtml ? presentation.filePath : "" url: isHtml ? presentation.filePath : ""
visible: isHtml visible: isHtml
settings.playbackRequiresUserGesture: false
} }
RowLayout { RowLayout {
Layout.fillWidth: true; Layout.fillWidth: true;

View file

@ -20,7 +20,7 @@ pub fn count_slides_and_fragments(html_file_path: &str) -> i32 {
let total = num_slides + num_fragments; let total = num_slides + num_fragments;
println!( println!(
"SLIDE_NUMBERS: {:?}, {:?}, {:?}", "SLIDE_NUMBERS: slides: {:?}, fragments: {:?}, total: {:?}",
num_slides, num_fragments, total num_slides, num_fragments, total
); );