This DVI file refers to external graphic files which are not in PostScript format, and cannot be handled by the "
- "dvips program that Okular uses internally to print or to export to PostScript. The functionality that "
- "you require is therefore unavailable in this version of Okular.
"
- "As a workaround, you can use the File/Export As-Menu to save this file in PDF format, and then use "
- "a PDF viewer.
"
- "It is planned to add this functionality at a later date.
") ,
- i18n("Functionality Unavailable"));
+ emit error(i18n("This DVI file refers to external graphic files which are not in PostScript format, and cannot be handled by the "
+ "'dvips' program that Okular uses internally to print or to export to PostScript. The functionality that "
+ "you require is therefore unavailable in this version of Okular."), -1);
return;
}
if (KStandardDirs::findExe("dvips").isEmpty()) {
- KMessageBox::sorry(parent_widget,
- i18n("Okular could not locate the program 'dvips' on your computer. That program is "
- "essential for the export function to work.\n"
- "Hint to the perplexed system administrator: Okular uses the PATH environment variable "
- "when looking for programs."));
+ emit error(i18n("Okular could not locate the program 'dvips' on your computer. That program is "
+ "essential for the export function to work.\n"
+ "Hint to the perplexed system administrator: Okular uses the PATH environment variable "
+ "when looking for programs."), -1);
return;
}
diff --git a/generators/dvi/dviexport.h b/generators/dvi/dviexport.h
index 32656452c..4ae5c6546 100644
--- a/generators/dvi/dviexport.h
+++ b/generators/dvi/dviexport.h
@@ -45,6 +45,9 @@ public:
*/
bool started() const { return started_; }
+Q_SIGNALS:
+ void error( const QString &message, int duration );
+
protected:
/** @param parent is stored internally in order to inform the parent
* that the external process has finished and that this variable
diff --git a/generators/dvi/generator_dvi.cpp b/generators/dvi/generator_dvi.cpp
index c66693338..ba4e71fce 100644
--- a/generators/dvi/generator_dvi.cpp
+++ b/generators/dvi/generator_dvi.cpp
@@ -81,6 +81,9 @@ bool DviGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
(void)userMutex();
m_dviRenderer = new dviRenderer(documentMetaData("TextHinting", QVariant()).toBool());
+ connect( m_dviRenderer, SIGNAL( error(QString,int) ), this, SIGNAL( error(QString,int) ) );
+ connect( m_dviRenderer, SIGNAL( warning(QString,int) ), this, SIGNAL( warning(QString,int) ) );
+ connect( m_dviRenderer, SIGNAL( notice(QString,int) ), this, SIGNAL( notice(QString,int) ) );
#ifdef DVI_OPEN_BUSYLOOP
static const ushort s_waitTime = 800; // milliseconds
static const int s_maxIterations = 10;
diff --git a/generators/dvi/psgs.cpp b/generators/dvi/psgs.cpp
index f54d78ecf..5d6b807c5 100644
--- a/generators/dvi/psgs.cpp
+++ b/generators/dvi/psgs.cpp
@@ -16,7 +16,6 @@
#include "pageNumber.h"
#include