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

Use action texts for buttons of decision/confirmation dialogs

parent 66cdb3d9
Pipeline #94085 passed with stage
in 41 minutes and 7 seconds
......@@ -846,7 +846,9 @@ void AttachmentControllerBase::attachDirectory(const QUrl &url)
{
const int rc = KMessageBox::warningYesNo(d->wParent,
i18n("Do you really want to attach this directory \"%1\"?", url.toLocalFile()),
i18nc("@title:window", "Attach directory"));
i18nc("@title:window", "Attach directory"),
KGuiItem(i18nc("@action:button", "Attach")),
KStandardGuiItem::cancel());
if (rc == KMessageBox::Yes) {
addAttachment(url);
}
......@@ -902,7 +904,9 @@ void AttachmentControllerBase::showAddAttachmentFileDialog()
if (mimeType.name() == QLatin1String("inode/directory")) {
const int rc = KMessageBox::warningYesNo(d->wParent,
i18n("Do you really want to attach this directory \"%1\"?", url.toLocalFile()),
i18nc("@title:window", "Attach directory"));
i18nc("@title:window", "Attach directory"),
KGuiItem(i18nc("@action:button", "Attach")),
KStandardGuiItem::cancel());
if (rc == KMessageBox::Yes) {
addAttachment(urlWithEncoding);
}
......
......@@ -524,8 +524,8 @@ void ComposerViewBase::slotEmailAddressResolved(KJob *job)
const int rc = KMessageBox::warningYesNo(m_parentWidget,
i18n("Do you want to resize images?"),
i18n("Auto Resize Images"),
KStandardGuiItem::yes(),
KStandardGuiItem::no());
KGuiItem(i18nc("@action:button", "Auto Resize")),
KGuiItem(i18nc("@action:button", "Do Not Resize")));
if (rc == KMessageBox::Yes) {
autoresizeImage = true;
} else {
......
......@@ -292,8 +292,8 @@ bool MessageComposer::Util::sendMailDispatcherIsOnline(QWidget *parent)
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."),
KStandardGuiItem::yes(),
KStandardGuiItem::no(),
KGuiItem(i18nc("@action:button", "Create Mail Dispatcher")),
KStandardGuiItem::cancel(),
QStringLiteral("no_maildispatcher"));
if (rc == KMessageBox::Yes) {
const Akonadi::AgentType type = Akonadi::AgentManager::self()->type(QStringLiteral("akonadi_maildispatcher_agent"));
......@@ -309,8 +309,8 @@ bool MessageComposer::Util::sendMailDispatcherIsOnline(QWidget *parent)
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."),
KStandardGuiItem::yes(),
KStandardGuiItem::no(),
KGuiItem(i18nc("@action:button", "Set Online")),
KStandardGuiItem::cancel(),
QStringLiteral("maildispatcher_put_online"));
if (rc == KMessageBox::Yes) {
instance.setIsOnline(true);
......
......@@ -79,7 +79,12 @@ 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 (KMessageBox::questionYesNo(this, i18n("Do you want to delete this filter?"), i18n("Remove Filter")) == KMessageBox::Yes) {
const int answer = KMessageBox::questionYesNo(this,
i18n("Do you want to delete this filter?"),
i18n("Remove Filter"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
if (answer == KMessageBox::Yes) {
removeFilterInfo(identifier);
delete item;
}
......
......@@ -400,11 +400,9 @@ void ConfigureThemesDialog::ConfigureThemesDialogPrivate::deleteThemeButtonClick
if (list.isEmpty()) {
return;
}
if (KMessageBox::Yes
== KMessageBox::questionYesNo(q,
list.count() > 1 ? i18n("Do you want to delete selected themes?")
: i18n("Do you want to delete \"%1\"?", list.first()->text()),
i18nc("@title:window", "Delete Theme"))) {
const QString question = list.count() > 1 ? i18n("Do you want to delete selected themes?") : i18n("Do you want to delete \"%1\"?", list.first()->text());
const int answer = KMessageBox::questionYesNo(q, question, i18nc("@title:window", "Delete Theme"), KStandardGuiItem::del(), KStandardGuiItem::cancel());
if (answer == KMessageBox::Yes) {
mEditor->editTheme(nullptr); // forget it
for (QListWidgetItem *it : list) {
auto item = dynamic_cast<ThemeListWidgetItem *>(it);
......
......@@ -116,10 +116,12 @@ void DKIMCheckFullJob::storeInKeyManager(const QString &key, const QString &doma
if (keyStored != key) {
// qDebug() << "storeInKeyManager : keyStored " << keyStored << " key " << key;
// qDebug() << "domain " << domain << " selector " << selector;
if (KMessageBox::No
== KMessageBox::warningYesNo(nullptr,
i18n("Stored DKIM key is different from the current one. Do you want to store this one too?"),
i18n("Key Changed"))) {
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());
if (answer == KMessageBox::No) {
return;
}
}
......
......@@ -72,10 +72,13 @@ void DKIMManagerKeyWidget::slotCustomContextMenuRequested(const QPoint &pos)
i18np("Remove Key", "Remove Keys", selectedItemsCount),
this,
[this, selectedItemsCount]() {
if (KMessageBox::Yes
== 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))) {
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 (answer == KMessageBox::Yes) {
const auto selectedItems = mTreeWidget->selectedItems();
for (QTreeWidgetItem *item : selectedItems) {
delete item;
......@@ -86,7 +89,12 @@ void DKIMManagerKeyWidget::slotCustomContextMenuRequested(const QPoint &pos)
}
if (mTreeWidget->topLevelItemCount() > 0) {
menu.addAction(i18n("Delete All"), this, [this]() {
if (KMessageBox::Yes == KMessageBox::warningYesNo(this, i18n("Do you want to delete all keys?"), i18n("Delete Keys"))) {
const int answer = KMessageBox::warningYesNo(this,
i18n("Do you want to delete all keys?"),
i18n("Delete Keys"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
if (answer == KMessageBox::Yes) {
mTreeWidget->clear();
}
});
......
......@@ -196,7 +196,12 @@ void DKIMManageRulesWidget::slotCustomContextMenuRequested(const QPoint &pos)
});
menu.addSeparator();
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Remove Rule"), this, [this, item]() {
if (KMessageBox::Yes == KMessageBox::warningYesNo(this, i18n("Do you want to delete this rule?"), i18n("Delete Rule"))) {
const int answer = KMessageBox::warningYesNo(this,
i18n("Do you want to delete this rule?"),
i18n("Delete Rule"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
if (answer == KMessageBox::Yes) {
delete item;
}
});
......@@ -204,7 +209,12 @@ void DKIMManageRulesWidget::slotCustomContextMenuRequested(const QPoint &pos)
if (mTreeWidget->topLevelItemCount() > 0) {
menu.addSeparator();
menu.addAction(i18n("Delete All"), this, [this]() {
if (KMessageBox::Yes == KMessageBox::warningYesNo(this, i18n("Do you want to delete all the rules?"), i18n("Delete Rules"))) {
const int answer = KMessageBox::warningYesNo(this,
i18n("Do you want to delete all the rules?"),
i18n("Delete Rules"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
if (answer == KMessageBox::Yes) {
mTreeWidget->clear();
}
});
......
......@@ -87,7 +87,12 @@ void RemoteContentConfigureWidget::slotCustomContextMenuRequested(const QPoint &
});
menu.addSeparator();
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Remove Rule"), this, [this, item]() {
if (KMessageBox::Yes == KMessageBox::warningYesNo(this, i18n("Do you want to delete this rule '%1'?", item->text(0)), i18n("Delete Rule"))) {
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());
if (answer == KMessageBox::Yes) {
delete item;
}
});
......
......@@ -1945,7 +1945,12 @@ void ViewerPrivate::slotCheckedUrlFinished(const QUrl &url, WebEngineViewer::Che
bool ViewerPrivate::urlIsAMalwareButContinue()
{
if (KMessageBox::No == KMessageBox::warningYesNo(mMainWindow, i18n("This web site is a malware, do you want to continue to show it?"), i18n("Malware"))) {
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())) {
return false;
}
return true;
......
Markdown is supported
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