Changeset View
Changeset View
Standalone View
Standalone View
generators/epub/converter.cpp
Show First 20 Lines • Show All 195 Lines • ▼ Show 20 Line(s) | 168 | { | |||
---|---|---|---|---|---|
196 | 196 | | |||
197 | // iterate over the book | 197 | // iterate over the book | ||
198 | it = epub_get_iterator(mTextDocument->getEpub(), EITERATOR_SPINE, 0); | 198 | it = epub_get_iterator(mTextDocument->getEpub(), EITERATOR_SPINE, 0); | ||
199 | 199 | | |||
200 | // if the background color of the document is non-white it will be handled by QTextDocument::setHtml() | 200 | // if the background color of the document is non-white it will be handled by QTextDocument::setHtml() | ||
201 | bool firstPage = true; | 201 | bool firstPage = true; | ||
202 | QVector<Okular::MovieAnnotation *> movieAnnots; | 202 | QVector<Okular::MovieAnnotation *> movieAnnots; | ||
203 | QVector<Okular::SoundAction *> soundActions; | 203 | QVector<Okular::SoundAction *> soundActions; | ||
204 | | ||||
205 | // HACK BEGIN Get the links without CSS to be blue | ||||
206 | // Remove if Qt ever gets fixed and the code in textdocumentgenerator.cpp works | ||||
207 | const QPalette orig = qApp->palette(); | ||||
208 | QPalette p = orig; | ||||
209 | p.setColor(QPalette::Link, Qt::blue); | ||||
210 | // HACK END | ||||
211 | | ||||
204 | const QSize videoSize(320, 240); | 212 | const QSize videoSize(320, 240); | ||
205 | do{ | 213 | do{ | ||
206 | if(!epub_it_get_curr(it)) { | 214 | if(!epub_it_get_curr(it)) { | ||
207 | continue; | 215 | continue; | ||
208 | } | 216 | } | ||
209 | 217 | | |||
210 | movieAnnots.clear(); | 218 | movieAnnots.clear(); | ||
211 | soundActions.clear(); | 219 | soundActions.clear(); | ||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 282 | while(!audioTags.isEmpty()) { | |||
284 | 292 | | |||
285 | QDomDocument tempDoc; | 293 | QDomDocument tempDoc; | ||
286 | tempDoc.setContent(QStringLiteral("<pre><audio></audio></pre>")); | 294 | tempDoc.setContent(QStringLiteral("<pre><audio></audio></pre>")); | ||
287 | audioTags.at(0).parentNode().replaceChild(tempDoc.documentElement(),audioTags.at(0)); | 295 | audioTags.at(0).parentNode().replaceChild(tempDoc.documentElement(),audioTags.at(0)); | ||
288 | } | 296 | } | ||
289 | htmlContent = dom.toString(); | 297 | htmlContent = dom.toString(); | ||
290 | } | 298 | } | ||
291 | 299 | | |||
292 | // HACK BEGIN Get the links without CSS to be blue | 300 | // HACK BEGIN | ||
293 | // Remove if Qt ever gets fixed and the code in textdocumentgenerator.cpp works | | |||
294 | const QPalette orig = qApp->palette(); | | |||
295 | QPalette p = orig; | | |||
296 | p.setColor(QPalette::Link, Qt::blue); | | |||
297 | qApp->setPalette(p); | 301 | qApp->setPalette(p); | ||
298 | // HACK END | 302 | // HACK END | ||
299 | 303 | | |||
300 | QTextBlock before; | 304 | QTextBlock before; | ||
301 | if(firstPage) { | 305 | if(firstPage) { | ||
302 | // preHtml & postHtml make it possible to have a margin around the content of the page | 306 | // preHtml & postHtml make it possible to have a margin around the content of the page | ||
303 | const QString preHtml = QString::fromLatin1("<html><head></head><body>" | 307 | const QString preHtml = QString::fromLatin1("<html><head></head><body>" | ||
304 | "<table style=\"-qt-table-type: root; margin-top:%1px; margin-bottom:%1px; margin-left:%1px; margin-right:%1px;\">" | 308 | "<table style=\"-qt-table-type: root; margin-top:%1px; margin-bottom:%1px; margin-left:%1px; margin-right:%1px;\">" | ||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |