mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Rendering error reporting dialog
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
#include "pdfstreamfilters.h"
|
||||
#include "pdfdrawwidget.h"
|
||||
#include "pdfdrawspacecontroller.h"
|
||||
#include "pdfrenderingerrorswidget.h"
|
||||
|
||||
#include <QSettings>
|
||||
#include <QFileDialog>
|
||||
@ -76,6 +77,7 @@ PDFViewerMainWindow::PDFViewerMainWindow(QWidget *parent) :
|
||||
setFocusProxy(m_pdfWidget);
|
||||
|
||||
connect(m_pdfWidget->getDrawWidgetProxy(), &pdf::PDFDrawWidgetProxy::pageLayoutChanged, this, &PDFViewerMainWindow::updatePageLayoutActions);
|
||||
connect(m_pdfWidget, &pdf::PDFWidget::pageRenderingErrorsChanged, this, &PDFViewerMainWindow::onPageRenderingErrorsChanged, Qt::QueuedConnection);
|
||||
|
||||
readSettings();
|
||||
updatePageLayoutActions();
|
||||
@ -105,6 +107,14 @@ void PDFViewerMainWindow::onActionQuitTriggered()
|
||||
close();
|
||||
}
|
||||
|
||||
void PDFViewerMainWindow::onPageRenderingErrorsChanged(pdf::PDFInteger pageIndex, int errorsCount)
|
||||
{
|
||||
if (errorsCount > 0)
|
||||
{
|
||||
statusBar()->showMessage(tr("Rendering of page %1: %2 errors occured.").arg(pageIndex + 1).arg(errorsCount), 4000);
|
||||
}
|
||||
}
|
||||
|
||||
void PDFViewerMainWindow::readSettings()
|
||||
{
|
||||
QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
|
||||
@ -287,4 +297,10 @@ void PDFViewerMainWindow::on_actionFirstPageOnRightSide_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
void PDFViewerMainWindow::on_actionRendering_Errors_triggered()
|
||||
{
|
||||
pdf::PDFRenderingErrorsWidget renderingErrorsDialog(this, m_pdfWidget);
|
||||
renderingErrorsDialog.exec();
|
||||
}
|
||||
|
||||
} // namespace pdfviewer
|
||||
|
Reference in New Issue
Block a user