Commit 578b5358 authored by Pino Toscano's avatar Pino Toscano

when the user cancels the loading of a non-local document, just show an info...

when the user cancels the loading of a non-local document, just show an info message in the page view instead of an error message box
move the generic error for local files to openUrl()

svn path=/trunk/KDE/kdegraphics/okular/; revision=1166044
parent 5d884feb
......@@ -732,6 +732,16 @@ void Part::slotJobStarted(KIO::Job *job)
{
QStringList supportedMimeTypes = m_document->supportedMimeTypes();
job->addMetaData("accept", supportedMimeTypes.join(", ") + ", */*;q=0.5");
connect(job, SIGNAL(result(KJob*)), this, SLOT(slotJobFinished(KJob*)));
}
}
void Part::slotJobFinished(KJob *job)
{
if ( job->error() == KIO::ERR_USER_CANCELED )
{
m_pageView->noticeMessage( i18n( "The loading of %1 has been canceled.", realUrl().pathOrUrl() ) );
}
}
......@@ -748,10 +758,6 @@ void Part::loadCancelled(const QString &reason)
{
KMessageBox::error( widget(), i18n("Could not open %1. Reason: %2", url().prettyUrl(), reason ) );
}
else
{
KMessageBox::error( widget(), i18n("Could not open %1", url().prettyUrl() ) );
}
}
}
......@@ -1072,6 +1078,10 @@ bool Part::openUrl(const KUrl &_url)
setWindowTitleFromDocument();
}
else
{
KMessageBox::error( widget(), i18n("Could not open %1", url.pathOrUrl() ) );
}
return openOk;
}
......
......@@ -162,6 +162,7 @@ class Part : public KParts::ReadOnlyPart, public Okular::DocumentObserver, publi
void slotShowFindBar();
void slotHideFindBar();
void slotJobStarted(KIO::Job *job);
void slotJobFinished(KJob *job);
void loadCancelled(const QString &reason);
void setWindowTitleFromDocument();
// can be connected to widget elements
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment