Commit ee48c037 authored by Laurent Montel's avatar Laurent Montel
Browse files

Adapt to new api (scripted)

parent e87fbec6
Pipeline #248524 passed with stage
in 15 minutes and 40 seconds
......@@ -31,6 +31,7 @@
#include <QMenu>
#include <QPointer>
#include <QTreeView>
#include <kwidgetsaddons_version.h>
#include "messagecomposer_debug.h"
#include <KActionCollection>
......@@ -175,13 +176,21 @@ void AttachmentControllerBase::AttachmentControllerBasePrivate::compressJobResul
AttachmentPart::Ptr compressedPart = ajob->compressedPart();
if (ajob->isCompressedPartLarger()) {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int result = KMessageBox::questionTwoActions(wParent,
#else
const int result = KMessageBox::questionYesNo(wParent,
i18n("The compressed attachment is larger than the original. "
"Do you want to keep the original one?"),
QString(/*caption*/),
KGuiItem(i18nc("Do not compress", "Keep")),
KGuiItem(i18n("Compress")));
#endif
i18n("The compressed attachment is larger than the original. "
"Do you want to keep the original one?"),
QString(/*caption*/),
KGuiItem(i18nc("Do not compress", "Keep")),
KGuiItem(i18n("Compress")));
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (result == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (result == KMessageBox::Yes) {
#endif
// The user has chosen to keep the uncompressed file.
return;
}
......@@ -843,12 +852,20 @@ void AttachmentControllerBase::attachmentProperties(const AttachmentPart::Ptr &p
void AttachmentControllerBase::attachDirectory(const QUrl &url)
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int rc = KMessageBox::warningTwoActions(d->wParent,
#else
const int rc = KMessageBox::warningYesNo(d->wParent,
i18n("Do you really want to attach this directory \"%1\"?", url.toLocalFile()),
i18nc("@title:window", "Attach directory"),
KGuiItem(i18nc("@action:button", "Attach")),
KStandardGuiItem::cancel());
#endif
i18n("Do you really want to attach this directory \"%1\"?", url.toLocalFile()),
i18nc("@title:window", "Attach directory"),
KGuiItem(i18nc("@action:button", "Attach")),
KStandardGuiItem::cancel());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (rc == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (rc == KMessageBox::Yes) {
#endif
addAttachment(url);
}
}
......@@ -901,12 +918,20 @@ void AttachmentControllerBase::showAddAttachmentFileDialog()
QMimeDatabase mimeDb;
const auto mimeType = mimeDb.mimeTypeForUrl(urlWithEncoding);
if (mimeType.name() == QLatin1String("inode/directory")) {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int rc = KMessageBox::warningTwoActions(d->wParent,
#else
const int rc = KMessageBox::warningYesNo(d->wParent,
i18n("Do you really want to attach this directory \"%1\"?", url.toLocalFile()),
i18nc("@title:window", "Attach directory"),
KGuiItem(i18nc("@action:button", "Attach")),
KStandardGuiItem::cancel());
#endif
i18n("Do you really want to attach this directory \"%1\"?", url.toLocalFile()),
i18nc("@title:window", "Attach directory"),
KGuiItem(i18nc("@action:button", "Attach")),
KStandardGuiItem::cancel());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (rc == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (rc == KMessageBox::Yes) {
#endif
addAttachment(urlWithEncoding);
}
} else {
......
......@@ -21,6 +21,7 @@
#include <KMessageBox>
#include <KMime/Content>
#include <kwidgetsaddons_version.h>
using namespace MessageComposer;
......@@ -96,14 +97,22 @@ bool MainTextJobPrivate::chooseCharsetAndEncode()
// No good charset was found.
if (q->globalPart()->isGuiEnabled() && textPart->warnBadCharset()) {
// Warn the user and give them a chance to go back.
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
int result = KMessageBox::warningTwoActions(q->globalPart()->parentWidgetForGui(),
#else
int result = KMessageBox::warningYesNo(q->globalPart()->parentWidgetForGui(),
i18n("Encoding the message with %1 will lose some characters.\n"
"Do you want to continue?",
QString::fromLatin1(charsets.first())),
i18n("Some Characters Will Be Lost"),
KGuiItem(i18n("Lose Characters")),
KGuiItem(i18n("Change Encoding")));
#endif
i18n("Encoding the message with %1 will lose some characters.\n"
"Do you want to continue?",
QString::fromLatin1(charsets.first())),
i18n("Some Characters Will Be Lost"),
KGuiItem(i18n("Lose Characters")),
KGuiItem(i18n("Change Encoding")));
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (result == KMessageBox::ButtonCode::SecondaryAction) {
#else
if (result == KMessageBox::No) {
#endif
q->setError(JobBase::UserCancelledError);
q->setErrorText(i18n("User decided to change the encoding."));
return false;
......
......@@ -32,6 +32,7 @@
#include <KMime/Headers>
#include <MailTransportAkonadi/MessageQueueJob>
#include <MessageCore/StringUtil>
#include <kwidgetsaddons_version.h>
KMime::Content *setBodyAndCTE(QByteArray &encodedBody, KMime::Headers::ContentType *contentType, KMime::Content *ret)
{
......@@ -289,13 +290,22 @@ bool MessageComposer::Util::sendMailDispatcherIsOnline(QWidget *parent)
{
Akonadi::AgentInstance instance = Akonadi::AgentManager::self()->instance(QStringLiteral("akonadi_maildispatcher_agent"));
if (!instance.isValid()) {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int rc =
KMessageBox::warningTwoActions(parent,
#else
const int rc = KMessageBox::warningYesNo(parent,
i18n("The mail dispatcher is not set up, so mails cannot be sent. Do you want to create a mail dispatcher?"),
i18n("No mail dispatcher."),
KGuiItem(i18nc("@action:button", "Create Mail Dispatcher")),
KStandardGuiItem::cancel(),
QStringLiteral("no_maildispatcher"));
#endif
i18n("The mail dispatcher is not set up, so mails cannot be sent. Do you want to create a mail dispatcher?"),
i18n("No mail dispatcher."),
KGuiItem(i18nc("@action:button", "Create Mail Dispatcher")),
KStandardGuiItem::cancel(),
QStringLiteral("no_maildispatcher"));
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (rc == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (rc == KMessageBox::Yes) {
#endif
const Akonadi::AgentType type = Akonadi::AgentManager::self()->type(QStringLiteral("akonadi_maildispatcher_agent"));
Q_ASSERT(type.isValid());
auto job = new Akonadi::AgentInstanceCreateJob(type); // async. We'll have to try again later.
......@@ -306,13 +316,21 @@ bool MessageComposer::Util::sendMailDispatcherIsOnline(QWidget *parent)
if (instance.isOnline()) {
return true;
} else {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int rc = KMessageBox::warningTwoActions(parent,
#else
const int rc = KMessageBox::warningYesNo(parent,
i18n("The mail dispatcher is offline, so mails cannot be sent. Do you want to make it online?"),
i18n("Mail dispatcher offline."),
KGuiItem(i18nc("@action:button", "Set Online")),
KStandardGuiItem::cancel(),
QStringLiteral("maildispatcher_put_online"));
#endif
i18n("The mail dispatcher is offline, so mails cannot be sent. Do you want to make it online?"),
i18n("Mail dispatcher offline."),
KGuiItem(i18nc("@action:button", "Set Online")),
KStandardGuiItem::cancel(),
QStringLiteral("maildispatcher_put_online"));
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (rc == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (rc == KMessageBox::Yes) {
#endif
instance.setIsOnline(true);
return true;
}
......
......@@ -12,6 +12,7 @@
#include <QMenu>
#include <QPointer>
#include <QVBoxLayout>
#include <kwidgetsaddons_version.h>
using namespace MessageList::Core;
ConfigureFiltersWidget::ConfigureFiltersWidget(QWidget *parent)
: QWidget(parent)
......@@ -77,12 +78,20 @@ void ConfigureFiltersWidget::slotCustomContextMenuRequested(const QPoint &pos)
menu.addSeparator();
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Remove"), this, [this, item]() {
const QString identifier = item->identifier();
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int answer = KMessageBox::questionTwoActions(this,
#else
const int answer = KMessageBox::questionYesNo(this,
i18n("Do you want to delete this filter?"),
i18n("Remove Filter"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#endif
i18n("Do you want to delete this filter?"),
i18n("Remove Filter"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (answer == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (answer == KMessageBox::Yes) {
#endif
removeFilterInfo(identifier);
delete item;
}
......
......@@ -18,6 +18,7 @@
#include <QGridLayout>
#include <QMap>
#include <QPushButton>
#include <kwidgetsaddons_version.h>
#include <KConfig>
#include <KConfigGroup>
......@@ -402,8 +403,17 @@ void ConfigureThemesDialog::ConfigureThemesDialogPrivate::deleteThemeButtonClick
return;
}
const QString question = list.count() > 1 ? i18n("Do you want to delete selected themes?") : i18n("Do you want to delete \"%1\"?", list.first()->text());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int answer =
KMessageBox::questionTwoActions(q, question, i18nc("@title:window", "Delete Theme"), KStandardGuiItem::del(), KStandardGuiItem::cancel());
#else
const int answer = KMessageBox::questionYesNo(q, question, i18nc("@title:window", "Delete Theme"), KStandardGuiItem::del(), KStandardGuiItem::cancel());
#endif
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (answer == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (answer == KMessageBox::Yes) {
#endif
mEditor->editTheme(nullptr); // forget it
for (QListWidgetItem *it : list) {
auto item = dynamic_cast<ThemeListWidgetItem *>(it);
......
......@@ -14,6 +14,7 @@
#include "messageviewer_dkimcheckerdebug.h"
#include <KLocalizedString>
#include <KMessageBox>
#include <kwidgetsaddons_version.h>
using namespace MessageViewer;
DKIMCheckFullJob::DKIMCheckFullJob(QObject *parent)
......@@ -114,12 +115,20 @@ void DKIMCheckFullJob::storeInKeyManager(const QString &key, const QString &doma
if (keyStored != key) {
// qDebug() << "storeInKeyManager : keyStored " << keyStored << " key " << key;
// qDebug() << "domain " << domain << " selector " << selector;
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int answer = KMessageBox::warningTwoActions(nullptr,
#else
const int answer = KMessageBox::warningYesNo(nullptr,
i18n("Stored DKIM key is different from the current one. Do you want to store this one too?"),
i18n("Key Changed"),
KGuiItem(i18nc("@action:button", "Store")),
KStandardGuiItem::discard());
#endif
i18n("Stored DKIM key is different from the current one. Do you want to store this one too?"),
i18n("Key Changed"),
KGuiItem(i18nc("@action:button", "Store")),
KStandardGuiItem::discard());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (answer == KMessageBox::ButtonCode::SecondaryAction) {
#else
if (answer == KMessageBox::No) {
#endif
return;
}
}
......
......@@ -16,6 +16,7 @@
#include <QMenu>
#include <QTreeWidget>
#include <QVBoxLayout>
#include <kwidgetsaddons_version.h>
using namespace MessageViewer;
DKIMManagerKeyWidget::DKIMManagerKeyWidget(QWidget *parent)
......@@ -71,12 +72,21 @@ void DKIMManagerKeyWidget::slotCustomContextMenuRequested(const QPoint &pos)
this,
[this, selectedItemsCount]() {
const int answer =
KMessageBox::warningYesNo(this,
i18np("Do you want to delete this key?", "Do you want to delete these keys?", selectedItemsCount),
i18np("Delete Key", "Delete Keys", selectedItemsCount),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
KMessageBox::questionTwoActions(
this,
#else
KMessageBox::warningYesNo(this,
#endif
i18np("Do you want to delete this key?", "Do you want to delete these keys?", selectedItemsCount),
i18np("Delete Key", "Delete Keys", selectedItemsCount),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (answer == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (answer == KMessageBox::Yes) {
#endif
const auto selectedItems = mTreeWidget->selectedItems();
for (QTreeWidgetItem *item : selectedItems) {
delete item;
......@@ -87,12 +97,20 @@ void DKIMManagerKeyWidget::slotCustomContextMenuRequested(const QPoint &pos)
}
if (mTreeWidget->topLevelItemCount() > 0) {
menu.addAction(i18n("Delete All"), this, [this]() {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int answer = KMessageBox::warningTwoActions(this,
#else
const int answer = KMessageBox::warningYesNo(this,
i18n("Do you want to delete all keys?"),
i18n("Delete Keys"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#endif
i18n("Do you want to delete all keys?"),
i18n("Delete Keys"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (answer == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (answer == KMessageBox::Yes) {
#endif
mTreeWidget->clear();
}
});
......
......@@ -17,6 +17,7 @@
#include <QPointer>
#include <QTreeWidget>
#include <QVBoxLayout>
#include <kwidgetsaddons_version.h>
using namespace MessageViewer;
DKIMManageRulesWidgetItem::DKIMManageRulesWidgetItem(QTreeWidget *parent)
: QTreeWidgetItem(parent)
......@@ -205,12 +206,20 @@ void DKIMManageRulesWidget::slotCustomContextMenuRequested(const QPoint &pos)
});
menu.addSeparator();
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Remove Rule"), this, [this, item]() {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int answer = KMessageBox::warningTwoActions(this,
#else
const int answer = KMessageBox::warningYesNo(this,
i18n("Do you want to delete this rule?"),
i18n("Delete Rule"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#endif
i18n("Do you want to delete this rule?"),
i18n("Delete Rule"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (answer == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (answer == KMessageBox::Yes) {
#endif
delete item;
emitUpdateExportButton();
}
......@@ -219,12 +228,20 @@ void DKIMManageRulesWidget::slotCustomContextMenuRequested(const QPoint &pos)
if (mTreeWidget->topLevelItemCount() > 0) {
menu.addSeparator();
menu.addAction(i18n("Delete All"), this, [this]() {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int answer = KMessageBox::warningTwoActions(this,
#else
const int answer = KMessageBox::warningYesNo(this,
i18n("Do you want to delete all the rules?"),
i18n("Delete Rules"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#endif
i18n("Do you want to delete all the rules?"),
i18n("Delete Rules"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (answer == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (answer == KMessageBox::Yes) {
#endif
mTreeWidget->clear();
emitUpdateExportButton();
}
......
......@@ -16,6 +16,7 @@
#include <QPointer>
#include <QTreeWidget>
#include <QVBoxLayout>
#include <kwidgetsaddons_version.h>
using namespace MessageViewer;
......@@ -83,12 +84,20 @@ void RemoteContentConfigureWidget::slotCustomContextMenuRequested(const QPoint &
});
menu.addSeparator();
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Remove Rule"), this, [this, item]() {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int answer = KMessageBox::warningTwoActions(this,
#else
const int answer = KMessageBox::warningYesNo(this,
i18n("Do you want to delete this rule '%1'?", item->text(0)),
i18n("Delete Rule"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#endif
i18n("Do you want to delete this rule '%1'?", item->text(0)),
i18n("Delete Rule"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (answer == KMessageBox::ButtonCode::PrimaryAction) {
#else
if (answer == KMessageBox::Yes) {
#endif
delete item;
}
});
......
......@@ -68,6 +68,7 @@
#include <QRegularExpression>
#include <QTemporaryFile>
#include <QWidget>
#include <kwidgetsaddons_version.h>
using namespace MessageViewer;
/** Checks whether @p str contains external references. To be precise,
......@@ -349,20 +350,34 @@ bool Util::saveContent(QWidget *parent, KMime::Content *content, const QUrl &url
bool bEncryptedParts = mNodeHelper->encryptionState(content)
!= MimeTreeParser::KMMsgNotEncrypted;
if (bEncryptedParts) {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (KMessageBox::questionTwoActions(parent,
#else
if (KMessageBox::questionYesNo(parent,
#endif
i18n(
"The part %1 of the message is encrypted. Do you want to keep the encryption when saving?",
url.fileName()),
i18n("KMail Question"), KGuiItem(i18n("Keep Encryption")),
KGuiItem(i18n("Do Not Keep")))
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
== KMessageBox::ButtonCode::PrimaryAction) {
#else
== KMessageBox::Yes) {
#endif
bSaveEncrypted = true;
}
}
bool bSaveWithSig = true;
if (mNodeHelper->signatureState(content) != MessageViewer::MimeTreeParser::KMMsgNotSigned) {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (KMessageBox::questionTwoActions(parent,
#else
if (KMessageBox::questionYesNo(parent,
#endif
i18n(
"The part %1 of the message is signed. Do you want to keep the signature when saving?",
url.fileName()),
......
......@@ -54,6 +54,7 @@
#include <Libkleo/MessageBox>
#include <chrono>
#include <kwidgetsaddons_version.h>
using namespace std::chrono_literals;
......@@ -889,12 +890,22 @@ bool KRunURLHandler::handleClick(const QUrl &url, ViewerPrivate *w) const
auto mime = mimeDb.mimeTypeForUrl(url);
if (mime.name() == QLatin1String("application/x-desktop") || mime.name() == QLatin1String("application/x-executable")
|| mime.name() == QLatin1String("application/x-ms-dos-executable") || mime.name() == QLatin1String("application/x-shellscript")) {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (KMessageBox::warningTwoActions(
nullptr,
#else
if (KMessageBox::warningYesNo(nullptr,
xi18nc("@info", "Do you really want to execute <filename>%1</filename>?", url.toDisplayString(QUrl::PreferLocalFile)),
QString(),
KGuiItem(i18n("Execute")),
KStandardGuiItem::cancel())
#endif
xi18nc("@info", "Do you really want to execute <filename>%1</filename>?", url.toDisplayString(QUrl::PreferLocalFile)),
QString(),
KGuiItem(i18n("Execute")),
KStandardGuiItem::cancel())
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
!= KMessageBox::ButtonCode::PrimaryAction) {
#else
!= KMessageBox::Yes) {
#endif
return true;
}
}
......
......@@ -157,6 +157,7 @@
#include "remote-content/remotecontentmenu.h"
#include <chrono>
#include <kwidgetsaddons_version.h>
using namespace std::chrono_literals;
using namespace MailTransport;
using namespace MessageViewer;
......@@ -1970,12 +1971,17 @@ void ViewerPrivate::slotCheckedUrlFinished(const QUrl &url, WebEngineViewer::Che
bool ViewerPrivate::urlIsAMalwareButContinue()
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (KMessageBox::ButtonCode::SecondaryAction
== KMessageBox::warningTwoActions(mMainWindow,
#else
if (KMessageBox::No
== KMessageBox::warningYesNo(mMainWindow,
i18n("This web site is a malware, do you want to continue to show it?"),
i18n("Malware"),
KStandardGuiItem::cont(),
KStandardGuiItem::cancel())) {
#endif
i18n("This web site is a malware, do you want to continue to show it?"),
i18n("Malware"),
KStandardGuiItem::cont(),
KStandardGuiItem::cancel())) {
return false;
}
return true;
......
......@@ -15,6 +15,7 @@
#include <KMessageBox>
#include <QWhatsThis>
#include <kwidgetsaddons_version.h>
using namespace TemplateParser;
class TemplateParser::TemplatesConfigurationPrivate
......@@ -96,16 +97,24 @@ void TemplatesConfiguration::slotTextChanged()
void TemplatesConfiguration::resetToDefault()
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const int choice = KMessageBox::questionTwoActionsCancel(nullptr,
#else
const int choice = KMessageBox::questionYesNoCancel(nullptr,
i18n("Do you want to reset current template or all templates to default?"),
i18n("Reset to default"),
KGuiItem(i18n("Reset Current Template")),
KGuiItem(i18n("Reset All Templates")),
KStandardGuiItem::cancel());
#endif
i18n("Do you want to reset current template or all templates to default?"),
i18n("Reset to default"),
KGuiItem(i18n("Reset Current Template")),
KGuiItem(i18n("Reset All Templates")),
KStandardGuiItem::cancel());
if (choice == KMessageBox::Cancel) {
return;
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
} else if (choice == KMessageBox::ButtonCode::PrimaryAction) {
#else
} else if (choice == KMessageBox::Yes) {
#endif
const int toolboxCurrentIndex(toolBox1->currentIndex());
if (toolBox1->widget(toolboxCurrentIndex) == page_new) {
textEdit_new->setPlainText(DefaultTemplates::defaultNewMessage());
......
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