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) {
console.log(pdf.status);
let pageCount = 1;
if (url.endsWith(".pdf")) {
pdf.source = url;
while (pdf.status != 2) {
console.log(pdf.status);
console.log("PAGECOUNT: " + pdf.pageCount);
pageCount = pdf.pageCount;
}
} else
pageCount = 1;
presProxyModel.presentationModel.newItem(url, pageCount);
selectedLibrary = "presentation";
presentationLibrary.libraryList.currentIndex = presProxyModel.presentationModel.count() - 1;
@ -377,9 +382,6 @@ Item {
}
if (presexts.includes(extension))
{
if (file.endsWith(".html")) {
web.url = file;
} else
addPres(file);
}

View file

@ -128,6 +128,7 @@ Item {
Layout.alignment: Qt.AlignCenter
url: isHtml ? presentation.filePath : ""
visible: isHtml
settings.playbackRequiresUserGesture: false
}
RowLayout {
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;
println!(
"SLIDE_NUMBERS: {:?}, {:?}, {:?}",
"SLIDE_NUMBERS: slides: {:?}, fragments: {:?}, total: {:?}",
num_slides, num_fragments, total
);