Commit b96902b4 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Port away from deprecated KMessageBox::sorry

parent 37dd6659
Pipeline #209006 passed with stage
in 6 minutes and 50 seconds
......@@ -157,7 +157,7 @@ void PixmapPreviewSelector::selectCustomStamp()
if (!customStampFile.isEmpty()) {
QPixmap pixmap = Okular::AnnotationUtils::loadStamp(customStampFile, m_previewSize);
if (pixmap.isNull()) {
KMessageBox::sorry(this, xi18nc("@info", "Could not load the file <filename>%1</filename>", customStampFile), i18nc("@title:window", "Invalid file"));
KMessageBox::error(this, xi18nc("@info", "Could not load the file <filename>%1</filename>", customStampFile), i18nc("@title:window", "Invalid file"));
} else {
m_comboItems->setEditText(customStampFile);
}
......
......@@ -386,22 +386,22 @@ void AnnotWindow::renderLatex(bool render)
GuiUtils::LatexRenderer::Error errorCode = m_latexRenderer->renderLatexInHtml(contents, fontColor, fontSize, Okular::Utils::realDpi(nullptr).width(), latexOutput);
switch (errorCode) {
case GuiUtils::LatexRenderer::LatexNotFound:
KMessageBox::sorry(this, i18n("Cannot find latex executable."), i18n("LaTeX rendering failed"));
KMessageBox::error(this, i18n("Cannot find latex executable."), i18n("LaTeX rendering failed"));
m_title->uncheckLatexButton();
renderLatex(false);
break;
case GuiUtils::LatexRenderer::DvipngNotFound:
KMessageBox::sorry(this, i18n("Cannot find dvipng executable."), i18n("LaTeX rendering failed"));
KMessageBox::error(this, i18n("Cannot find dvipng executable."), i18n("LaTeX rendering failed"));
m_title->uncheckLatexButton();
renderLatex(false);
break;
case GuiUtils::LatexRenderer::LatexFailed:
KMessageBox::detailedSorry(this, i18n("A problem occurred during the execution of the 'latex' command."), latexOutput, i18n("LaTeX rendering failed"));
KMessageBox::detailedError(this, i18n("A problem occurred during the execution of the 'latex' command."), latexOutput, i18n("LaTeX rendering failed"));
m_title->uncheckLatexButton();
renderLatex(false);
break;
case GuiUtils::LatexRenderer::DvipngFailed:
KMessageBox::sorry(this, i18n("A problem occurred during the execution of the 'dvipng' command."), i18n("LaTeX rendering failed"));
KMessageBox::error(this, i18n("A problem occurred during the execution of the 'dvipng' command."), i18n("LaTeX rendering failed"));
m_title->uncheckLatexButton();
renderLatex(false);
break;
......
......@@ -2649,7 +2649,7 @@ bool Part::saveAs(const QUrl &saveUrl, SaveAsFlags flags)
// as to if it can save changes even if the open file has been modified,
// since we only have poppler as saving backend for now we're skipping that check
if (m_fileLastModified != QFileInfo(localFilePath()).lastModified()) {
KMessageBox::sorry(widget(), i18n("The file '%1' has been modified by another program, which means it can no longer be saved.", url().fileName()), i18n("File Changed"));
KMessageBox::error(widget(), i18n("The file '%1' has been modified by another program, which means it can no longer be saved.", url().fileName()), i18n("File Changed"));
return false;
}
......@@ -2829,7 +2829,7 @@ bool Part::saveAs(const QUrl &saveUrl, SaveAsFlags flags)
srcUrl = KUrl::fromPath(tempFile->fileName());
#else
const QString msg = i18n("Okular cannot copy %1 to the specified location.\n\nThe document does not exist anymore.", localFilePath());
KMessageBox::sorry(widget(), msg);
KMessageBox::error(widget(), msg);
return false;
#endif
} else {
......
Supports Markdown
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