Rendering error reporting dialog

This commit is contained in:
Jakub Melka
2019-02-24 19:42:00 +01:00
parent 60bb835a4e
commit 0666f976b1
11 changed files with 330 additions and 2 deletions

View File

@ -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