Commit 6d6e40ee authored by Laurent Montel's avatar Laurent Montel
Browse files

KMessageBox::sorry is deprecated in kf5.97

parent 82305419
Pipeline #210022 passed with stage
in 10 minutes
......@@ -780,7 +780,7 @@ void ComposerPageCharsetTab::slotVerifyCharset(QString &charset)
return;
}
KMessageBox::sorry(this, i18n("This charset is not supported."));
KMessageBox::error(this, i18n("This charset is not supported."));
charset.clear();
}
......
......@@ -2070,7 +2070,7 @@ void KMComposerWin::slotSendFailed(const QString &msg, MessageComposer::Composer
{
setEnabled(true);
if (!msg.isEmpty()) {
KMessageBox::sorry(mMainWidget,
KMessageBox::error(mMainWidget,
msg,
(type == MessageComposer::ComposerViewBase::AutoSave) ? i18n("Autosave Message Failed") : i18n("Sending Message Failed"));
}
......@@ -2313,7 +2313,7 @@ bool KMComposerWin::insertFromMimeData(const QMimeData *source, bool forceAttach
}
attName = attName.trimmed();
if (attName.isEmpty()) {
KMessageBox::sorry(this, i18n("Attachment name can't be empty"), i18n("Invalid Attachment Name"));
KMessageBox::error(this, i18n("Attachment name can't be empty"), i18n("Invalid Attachment Name"));
return true;
}
......@@ -2533,7 +2533,7 @@ void KMComposerWin::setEncryption(bool encrypt, bool setByUser)
// an encryption key for the current identity
else if (encrypt && encryptToSelf() && !mLastIdentityHasEncryptionKey) {
if (setByUser) {
KMessageBox::sorry(this,
KMessageBox::error(this,
i18n("<qt><p>You have requested that messages be "
"encrypted to yourself, but the currently selected "
"identity does not define an (OpenPGP or S/MIME) "
......@@ -2604,7 +2604,7 @@ void KMComposerWin::setSigning(bool sign, bool setByUser)
// check if the user defined a signing key for the current identity
if (sign && !mLastIdentityHasSigningKey) {
if (setByUser) {
KMessageBox::sorry(this,
KMessageBox::error(this,
i18n("<qt><p>In order to be able to sign "
"this message you first have to "
"define the (OpenPGP or S/MIME) signing key "
......@@ -2770,7 +2770,7 @@ void KMComposerWin::doSend(MessageComposer::MessageSender::SendMethod method, Me
rethinkFields(false);
}
mEdtFrom->setFocus();
KMessageBox::sorry(this,
KMessageBox::error(this,
i18n("You must enter your email address in the "
"From: field. You should also set your email "
"address for all identities, so that you do "
......
......@@ -687,7 +687,7 @@ void IdentityDialog::slotAccepted()
}
if (!KEmailAddress::isValidSimpleAddress(alias)) {
const QString errorMsg(KEmailAddress::simpleEmailAddressErrorMsg());
KMessageBox::sorry(this, errorMsg, i18n("Invalid Email Alias \"%1\"", alias));
KMessageBox::error(this, errorMsg, i18n("Invalid Email Alias \"%1\"", alias));
return;
}
}
......@@ -696,7 +696,7 @@ void IdentityDialog::slotAccepted()
const QString email = mEmailEdit->text().trimmed();
if (!KEmailAddress::isValidSimpleAddress(email)) {
const QString errorMsg(KEmailAddress::simpleEmailAddressErrorMsg());
KMessageBox::sorry(this, errorMsg, i18n("Invalid Email Address"));
KMessageBox::error(this, errorMsg, i18n("Invalid Email Address"));
return;
}
......
......@@ -77,13 +77,13 @@ void AddressValidationJob::slotAliasExpansionDone(KJob *job)
"Distribution lists %2 are empty, they cannot be used.",
numberOfDistributionList,
listOfDistributionList);
KMessageBox::sorry(mParentWidget, errorMsg, i18n("Invalid Email Address"));
KMessageBox::error(mParentWidget, errorMsg, i18n("Invalid Email Address"));
mIsValid = false;
} else {
if (!(errorCode == KEmailAddress::AddressOk || errorCode == KEmailAddress::AddressEmpty)) {
const QString errorMsg(QLatin1String("<qt><p><b>") + brokenAddress + QLatin1String("</b></p><p>")
+ KEmailAddress::emailParseResultToString(errorCode) + QLatin1String("</p></qt>"));
KMessageBox::sorry(mParentWidget, errorMsg, i18n("Invalid Email Address"));
KMessageBox::error(mParentWidget, errorMsg, i18n("Invalid Email Address"));
mIsValid = false;
}
}
......
......@@ -721,7 +721,7 @@ void KMOpenMsgCommand::slotDataArrived(KIO::Job *, const QByteArray &data)
void KMOpenMsgCommand::doesNotContainMessage()
{
KMessageBox::sorry(parentWidget(), i18n("The file does not contain a message."));
KMessageBox::error(parentWidget(), i18n("The file does not contain a message."));
setResult(Failed);
Q_EMIT completed(this);
// Emulate closing of a secondary window so that KMail exits in case it
......
......@@ -1067,7 +1067,7 @@ void KMKernel::recoverDeadLetters()
autoSaveWin->show();
autoSaveFile.close();
} else {
KMessageBox::sorry(nullptr,
KMessageBox::error(nullptr,
i18n("Failed to open autosave file at %1.\nReason: %2", file.absoluteFilePath(), autoSaveFile.errorString()),
i18n("Opening Autosave File Failed"));
}
......
......@@ -609,7 +609,7 @@ void KMReaderMainWin::slotCopyItem(QAction *action)
void KMReaderMainWin::slotCopyMoveResult(KJob *job)
{
if (job->error()) {
KMessageBox::sorry(this, i18n("Cannot copy item. %1", job->errorString()));
KMessageBox::error(this, i18n("Cannot copy item. %1", job->errorString()));
}
}
......
......@@ -529,7 +529,7 @@ void SearchWindow::searchDone(KJob *job)
mUi.mProgressIndicator->hide();
if (job->error()) {
qCDebug(KMAIL_LOG) << job->errorString();
KMessageBox::sorry(this, i18n("Cannot get search result. %1", job->errorString()));
KMessageBox::error(this, i18n("Cannot get search result. %1", job->errorString()));
enableGUI();
mUi.mSearchFolderEdt->setEnabled(true);
mUi.mStatusLbl->setText(i18n("Search failed."));
......
......@@ -100,14 +100,14 @@ void UndoStack::undo()
delete info;
} else {
// Sorry.. stack is empty..
KMessageBox::sorry(kmkernel->mainWin(), i18n("There is nothing to undo."));
KMessageBox::error(kmkernel->mainWin(), i18n("There is nothing to undo."));
}
}
void UndoStack::slotMoveResult(KJob *job)
{
if (job->error()) {
KMessageBox::sorry(kmkernel->mainWin(), i18n("Cannot move message. %1", job->errorString()));
KMessageBox::error(kmkernel->mainWin(), i18n("Cannot move message. %1", job->errorString()));
}
}
......
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