| 522 | } |
| 523 | |
| 524 | void PDFDocumentWindow::reload() |
| 525 | { |
| 526 | QApplication::setOverrideCursor(Qt::WaitCursor); |
| 527 | |
| 528 | clearSyncHighlight(); |
| 529 | if (pdfWidget->load(curFile)) { |
| 530 | QSharedPointer<QtPDF::Backend::Document> doc = pdfWidget->document().toStrongRef(); |
| 531 | if (doc) { |
| 532 | Tw::Settings settings; |
| 533 | doc->setPaperColor(settings.value(QStringLiteral("pdfPaperColor"), QVariant::fromValue<QColor>(kDefault_PaperColor)).value<QColor>()); |
| 534 | } |
| 535 | loadSyncData(); |
| 536 | emit reloaded(); |
| 537 | } |
| 538 | else { |
| 539 | statusBar()->showMessage(tr("Failed to load file \"%1\"; perhaps it is not a valid PDF document.").arg(Tw::Utils::WindowManager::strippedName(curFile))); |
| 540 | } |
| 541 | updateTypesettingAction(); |
| 542 | QApplication::restoreOverrideCursor(); |
| 543 | } |
| 544 | |
| 545 | void PDFDocumentWindow::loadSyncData() |
| 546 | { |
no test coverage detected