Commit 1dc224bd authored by Laurent Montel's avatar Laurent Montel
Browse files

KMessageBox::sorry is deprecated in kf5.97

parent c45271cd
Pipeline #210193 passed with stage
in 1 minute and 34 seconds
......@@ -84,7 +84,7 @@ KGpgCaffPrivate::reexportKey(const KGpgSignableNode *key)
QFile seclink(m_secringdir);
if (!seclink.link(m_tempdir->path() + QLatin1String("private-keys-v1.d"))) {
KMessageBox::sorry(qobject_cast<QWidget *>(q->parent()),
KMessageBox::error(qobject_cast<QWidget *>(q->parent()),
i18n("This function is not available on this system. The symbolic link to the private GnuPG keys cannot be created."));
return;
}
......
......@@ -279,13 +279,13 @@ bool KgpgEditor::slotFileSave()
QTextCodec *cod = QTextCodec::codecForName(m_textencoding.toLatin1());
if (cod == nullptr) {
KMessageBox::sorry(this, i18n("The document could not been saved, as the selected codec is not supported."));
KMessageBox::error(this, i18n("The document could not been saved, as the selected codec is not supported."));
return false;
}
if (!checkEncoding(cod))
{
KMessageBox::sorry(this, i18n("The document could not been saved, as the selected encoding cannot encode every unicode character in it."));
KMessageBox::error(this, i18n("The document could not been saved, as the selected encoding cannot encode every unicode character in it."));
return false;
}
......@@ -294,7 +294,7 @@ bool KgpgEditor::slotFileSave()
QFile f(filn);
if (!f.open(QIODevice::WriteOnly))
{
KMessageBox::sorry(this, i18n("The document could not be saved, please check your permissions and disk space."));
KMessageBox::error(this, i18n("The document could not be saved, please check your permissions and disk space."));
return false;
}
......@@ -310,7 +310,7 @@ bool KgpgEditor::slotFileSave()
uploadJob->exec();
if(uploadJob->error())
{
KMessageBox::sorry(this, i18n("The document could not be saved, please check your permissions and disk space."));
KMessageBox::error(this, i18n("The document could not be saved, please check your permissions and disk space."));
return false;
}
}
......
......@@ -87,7 +87,7 @@ void Md5Widget::slotApply()
if (!text.isEmpty())
{
if (text.length() != m_md5sum.length())
KMessageBox::sorry(this, i18n("Clipboard content is not a MD5 sum."));
KMessageBox::error(this, i18n("Clipboard content is not a MD5 sum."));
else
if (text == m_md5sum)
{
......
......@@ -94,7 +94,7 @@ void KgpgTextEdit::openDroppedFile(const QUrl &url, const bool probe)
KJobWidgets::setWindow(copyJob , this);
copyJob->exec();
if (copyJob->error()) {
KMessageBox::sorry(this, i18n("Could not download file."));
KMessageBox::error(this, i18n("Could not download file."));
return;
}
tmpFile.setAutoRemove(false);
......@@ -276,7 +276,7 @@ void KgpgTextEdit::slotEncodeUpdate(int result)
const QChar lf = QLatin1Char('\n');
setPlainText(enc->encryptedText().join(lf) + lf);
} else {
KMessageBox::sorry(this, i18n("The encryption failed with error code %1", result),
KMessageBox::error(this, i18n("The encryption failed with error code %1", result),
i18n("Encryption failed."));
}
......@@ -290,7 +290,7 @@ void KgpgTextEdit::slotSignUpdate(int result)
Q_ASSERT(signt != nullptr);
if (result != KGpgTransaction::TS_OK) {
KMessageBox::sorry(this, i18n("Signing not possible: bad passphrase or missing key"));
KMessageBox::error(this, i18n("Signing not possible: bad passphrase or missing key"));
return;
}
......
......@@ -89,7 +89,7 @@ void KeyServer::slotImport()
return;
if (page->qLEimportid->text().isEmpty()) {
KMessageBox::sorry(this, i18n("You must enter a search string."));
KMessageBox::error(this, i18n("You must enter a search string."));
return;
}
......@@ -101,7 +101,7 @@ void KeyServer::startImport(const QStringList &keys, QString server, const QStri
if (server.isEmpty()) {
const QStringList kservers = KeyServer::getServerList();
if (kservers.isEmpty()) {
KMessageBox::sorry(this, i18n("You need to configure keyservers before trying to download keys."),
KMessageBox::error(this, i18n("You need to configure keyservers before trying to download keys."),
i18n("No keyservers defined"));
return;
}
......@@ -179,7 +179,7 @@ void KeyServer::slotSearch()
return;
if (page->qLEimportid->text().isEmpty()) {
KMessageBox::sorry(this, i18n("You must enter a search string."));
KMessageBox::error(this, i18n("You must enter a search string."));
return;
}
......@@ -309,7 +309,7 @@ void KeyServer::slotPreImport()
{
transferKeyID();
if (m_listpop->qLEID->text().isEmpty()) {
KMessageBox::sorry(this, i18n("You must choose a key."));
KMessageBox::error(this, i18n("You must choose a key."));
return;
}
const QStringList keys = m_listpop->qLEID->text().simplified().split(QLatin1Char(' '));
......
......@@ -749,7 +749,7 @@ void KeysManager::refreshKeyFromServer()
if (item->getType() & ITYPE_PAIR) {
keyIDS << item->getId();
} else {
KMessageBox::sorry(this, i18n("You can only refresh primary keys. Please check your selection."));
KMessageBox::error(this, i18n("You can only refresh primary keys. Please check your selection."));
return;
}
}
......@@ -1408,7 +1408,7 @@ void KeysManager::slotExportSecFinished(int result)
i18n("<qt>Your <b>private</b> key \"%1\" was successfully exported to<br/>%2.<br/><b>Do not</b> leave it in an insecure place.</qt>",
exp->getKeyIds().first(), exp->getOutputFile()));
} else {
KMessageBox::sorry(this, i18n("Your secret key could not be exported.\nCheck the key."));
KMessageBox::error(this, i18n("Your secret key could not be exported.\nCheck the key."));
}
}
......@@ -1514,7 +1514,7 @@ void KeysManager::slotExportFinished(int result)
"<qt>The %1 public keys were successfully exported to<br/>%2</qt>",
exp->getKeyIds().count(), exp->getOutputFile()));
} else {
KMessageBox::sorry(this, i18n("Your public key could not be exported\nCheck the key."));
KMessageBox::error(this, i18n("Your public key could not be exported\nCheck the key."));
}
exp->deleteLater();
......@@ -1529,7 +1529,7 @@ void KeysManager::slotProcessExportMail(int result)
if (result == KGpgTransaction::TS_OK) {
QDesktopServices::openUrl(QUrl(QLatin1String("mailto:?body=") + QLatin1String(exp->getOutputData())));
} else {
KMessageBox::sorry(this, i18n("Your public key could not be exported\nCheck the key."));
KMessageBox::error(this, i18n("Your public key could not be exported\nCheck the key."));
}
exp->deleteLater();
......@@ -1543,7 +1543,7 @@ void KeysManager::slotProcessExportClip(int result)
if (result == KGpgTransaction::TS_OK) {
qApp->clipboard()->setText(QLatin1String( exp->getOutputData() ), m_clipboardmode);
} else {
KMessageBox::sorry(this, i18n("Your public key could not be exported\nCheck the key."));
KMessageBox::error(this, i18n("Your public key could not be exported\nCheck the key."));
}
exp->deleteLater();
......@@ -1715,7 +1715,7 @@ void KeysManager::createNewGroup()
if (ndlist.empty())
return;
if (tp & ~ITYPE_PAIR) {
KMessageBox::sorry(this, i18n("<qt>You cannot create a group containing signatures, subkeys or other groups.</qt>"));
KMessageBox::error(this, i18n("<qt>You cannot create a group containing signatures, subkeys or other groups.</qt>"));
return;
}
......@@ -1746,7 +1746,7 @@ void KeysManager::createNewGroup()
iview->selectNode(imodel->addGroup(groupName, keysList));
updateStatusCounter();
} else {
KMessageBox::sorry(this,
KMessageBox::error(this,
i18n("<qt>No valid or trusted key was selected. The group <b>%1</b> will not be created.</qt>",
groupName));
}
......@@ -1795,7 +1795,7 @@ void KeysManager::signkey()
return;
if (tp & ~ITYPE_PAIR) {
KMessageBox::sorry(this, i18n("You can only sign primary keys. Please check your selection."));
KMessageBox::error(this, i18n("You can only sign primary keys. Please check your selection."));
return;
}
......@@ -1874,7 +1874,7 @@ void KeysManager::signuid()
return;
if (tp & ~(ITYPE_PAIR | ITYPE_UID | ITYPE_UAT)) {
KMessageBox::sorry(this, i18n("You can only sign user ids and photo ids. Please check your selection."));
KMessageBox::error(this, i18n("You can only sign user ids and photo ids. Please check your selection."));
return;
}
......@@ -1987,11 +1987,11 @@ void KeysManager::signatureResult(int success)
refreshList.append(nd);
break;
case KGpgTransaction::TS_BAD_PASSPHRASE:
KMessageBox::sorry(this, i18n("<qt>Bad passphrase, key <b>%1 (%2)</b> not signed.</qt>",
KMessageBox::error(this, i18n("<qt>Bad passphrase, key <b>%1 (%2)</b> not signed.</qt>",
nd->getName(), nd->getEmail()));
break;
case KGpgSignTransactionHelper::TS_ALREADY_SIGNED:
KMessageBox::sorry(this, i18n("<qt>The key <b>%1 (%2)</b> is already signed.</qt>",
KMessageBox::error(this, i18n("<qt>The key <b>%1 (%2)</b> is already signed.</qt>",
nd->getName(), nd->getEmail()));
break;
default:
......@@ -2021,7 +2021,7 @@ void KeysManager::caff()
return;
if (tp & ~(ITYPE_PAIR | ITYPE_UID | ITYPE_UAT)) {
KMessageBox::sorry(this, i18n("You can only sign user ids and photo ids. Please check your selection."));
KMessageBox::error(this, i18n("You can only sign user ids and photo ids. Please check your selection."));
return;
}
......@@ -2204,7 +2204,7 @@ void KeysManager::delsignkey()
signMail += QLatin1String( " &lt;" ) + nd->getEmail() + QLatin1String( "&gt;" );
if (parentKey == signID) {
KMessageBox::sorry(this, i18n("Edit key manually to delete a self-signature."));
KMessageBox::error(this, i18n("Edit key manually to delete a self-signature."));
return;
}
......@@ -2230,7 +2230,7 @@ void KeysManager::delsignatureResult(int success)
nd = nd->getParentKeyNode();
imodel->refreshKey(nd->toKeyNode());
} else {
KMessageBox::sorry(this, i18n("Requested operation was unsuccessful, please edit the key manually."));
KMessageBox::error(this, i18n("Requested operation was unsuccessful, please edit the key manually."));
}
}
......
......@@ -83,7 +83,7 @@ bool KGpgApp::newInstance()
// any program part of GnuPG that needs it, so simply assume everything is fine.
if ((gpgver < 0x20100) && KgpgInterface::getGpgBoolSetting(QLatin1String("use-agent"), gpgPath) &&
qEnvironmentVariableIsEmpty("GPG_AGENT_INFO"))
KMessageBox::sorry(nullptr, i18n("<qt>The use of <b>GnuPG Agent</b> is enabled in GnuPG's configuration file (%1).<br />"
KMessageBox::error(nullptr, i18n("<qt>The use of <b>GnuPG Agent</b> is enabled in GnuPG's configuration file (%1).<br />"
"However, the agent does not seem to be running. This could result in problems with signing/decryption.<br />"
"Please disable GnuPG Agent from KGpg settings, or fix the agent.</qt>", gpgPath));
}
......@@ -120,35 +120,35 @@ void KGpgApp::handleArguments(const QCommandLineParser &parser, const QDir &work
if (parser.isSet(QStringLiteral("e"))) {
if (urlList.isEmpty())
KMessageBox::sorry(nullptr, i18n("No files given."));
KMessageBox::error(nullptr, i18n("No files given."));
else if (!directoryInside)
KGpgExternalActions::encryptFiles(s_keyManager, urlList);
else
KGpgExternalActions::encryptFolders(s_keyManager, urlList);
} else if (parser.isSet(QStringLiteral("s"))) {
if (urlList.isEmpty())
KMessageBox::sorry(nullptr, i18n("No files given."));
KMessageBox::error(nullptr, i18n("No files given."));
else if (!directoryInside)
w->showDroppedFile(urlList.first());
else
KMessageBox::sorry(nullptr, i18n("Cannot decrypt and show folder."));
KMessageBox::error(nullptr, i18n("Cannot decrypt and show folder."));
} else if (parser.isSet(QStringLiteral("S"))) {
if (urlList.isEmpty())
KMessageBox::sorry(nullptr, i18n("No files given."));
KMessageBox::error(nullptr, i18n("No files given."));
else if (!directoryInside)
KGpgExternalActions::signFiles(s_keyManager, urlList);
else
KMessageBox::sorry(nullptr, i18n("Cannot sign folder."));
KMessageBox::error(nullptr, i18n("Cannot sign folder."));
} else if (parser.isSet(QStringLiteral("V")) != 0) {
if (urlList.isEmpty())
KMessageBox::sorry(nullptr, i18n("No files given."));
KMessageBox::error(nullptr, i18n("No files given."));
else if (!directoryInside)
w->verifyFile(urlList.first());
else
KMessageBox::sorry(nullptr, i18n("Cannot verify folder."));
KMessageBox::error(nullptr, i18n("Cannot verify folder."));
} else {
if (directoryInside && (urlList.count() > 1)) {
KMessageBox::sorry(nullptr, i18n("Unable to perform requested operation.\nPlease select only one folder, or several files, but do not mix files and folders."));
KMessageBox::error(nullptr, i18n("Unable to perform requested operation.\nPlease select only one folder, or several files, but do not mix files and folders."));
return;
}
......
......@@ -123,7 +123,7 @@ void KGpgExternalActions::encryptFolders(KeysManager *parent, const QList<QUrl>
if (!tmpfolder->open()) {
delete tmpfolder;
KMessageBox::sorry(parent, i18n("Cannot create temporary file for folder compression."), i18n("Temporary File Creation"));
KMessageBox::error(parent, i18n("Cannot create temporary file for folder compression."), i18n("Temporary File Creation"));
return;
}
......@@ -225,7 +225,7 @@ void KGpgExternalActions::slotFolderFinished(KJob *job)
Q_ASSERT(trayinfo != nullptr);
if (trayinfo->error())
KMessageBox::sorry(m_keysmanager, trayinfo->errorString());
KMessageBox::error(m_keysmanager, trayinfo->errorString());
deleteLater();
}
......
......@@ -87,19 +87,19 @@ void KgpgKeyGenerate::slotOk()
{
if (m_kname->text().simplified().isEmpty())
{
KMessageBox::sorry(this, i18n("You must give a name."));
KMessageBox::error(this, i18n("You must give a name."));
return;
}
if (m_kname->text().simplified().length() < 5)
{
KMessageBox::sorry(this, i18n("The name must have at least 5 characters"));
KMessageBox::error(this, i18n("The name must have at least 5 characters"));
return;
}
if (m_kname->text().simplified().at(0).isDigit())
{
KMessageBox::sorry(this, i18n("The name must not start with a digit"));
KMessageBox::error(this, i18n("The name must not start with a digit"));
return;
}
......@@ -113,7 +113,7 @@ void KgpgKeyGenerate::slotOk()
int pos = 0;
if (EmailValidator().validate(vmail, pos) == QValidator::Invalid)
{
KMessageBox::sorry(this, i18n("Email address not valid"));
KMessageBox::error(this, i18n("Email address not valid"));
return;
}
}
......
......@@ -171,7 +171,7 @@ void kgpgOptions::slotChangeHome()
confPath = QLatin1String( "gpg.conf" );
QFile confFile(gpgHome + confPath);
if (!confFile.open(QIODevice::WriteOnly)) {
KMessageBox::sorry(this, i18n("Cannot create configuration file. Please check if destination media is mounted and if you have write access."));
KMessageBox::error(this, i18n("Cannot create configuration file. Please check if destination media is mounted and if you have write access."));
return;
} else {
QTextStream stream(&confFile);
......@@ -194,12 +194,12 @@ bool kgpgOptions::isValidKeyserver(const QString &server)
return false;
if (server.contains(QLatin1Char( ' ' ))) {
KMessageBox::sorry(this, i18n("Key server URLs may not contain whitespace."));
KMessageBox::error(this, i18n("Key server URLs may not contain whitespace."));
return false;
}
if (serverList.contains(server)) {
KMessageBox::sorry(this, i18n("Key server already in the list."));
KMessageBox::error(this, i18n("Key server already in the list."));
return false;
}
......
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