loadFinished = true;
addNavigationBar();
onSettingsChanged("scheme");
+ emit chapterLoaded(contentIndex);
if (restore) {
restore = false;
if (ok && mBook) {
void BookView::addNavigationBar()
{
- QWebFrame *frame = page()->currentFrame();
- frame->addToJavaScriptWindowObject("bv", this);
+ if (!mBook) {
+ return;
+ }
QString naviPrev =
"<a href=\"javascript:bv.goPrevious();\">"
+ tmpPath() +
"/next.png\" />"
"</a>";
-
if (contentIndex == 0) {
naviPrev = "";
}
naviNext = "";
}
+ QWebFrame *frame = page()->currentFrame();
+ frame->addToJavaScriptWindowObject("bv", this);
QString headerScript = "document.body.innerHTML = '" +
naviPrev + naviNext + "<br />" + "' + document.body.innerHTML;";
QString trailerScript = "document.body.innerHTML += '<br /><br />" +
frame->evaluateJavaScript(headerScript);
frame->evaluateJavaScript(trailerScript);
-
- // qDebug() << page()->currentFrame()->toHtml();
}
QString BookView::tmpPath()