Port away from deprecated KMessageBox::sorry

This commit is contained in:
Friedrich W. H. Kossebau 2022-07-23 15:01:11 +02:00
parent 37dd665938
commit b96902b40c
3 changed files with 7 additions and 7 deletions

View file

@ -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);
}

View file

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

View file

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