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

Use action texts for buttons of decision/confirmation dialogs

parent 56981074
Pipeline #94370 passed with stage
in 10 minutes and 29 seconds
......@@ -602,7 +602,11 @@ void AutoCorrectionWidget::changeLanguage(int index)
return;
}
if (d->mWasChanged) {
const int rc = KMessageBox::warningYesNo(this, i18n("Language was changed, do you want to save config for previous language?"), i18n("Save config"));
const int rc = KMessageBox::warningYesNo(this,
i18n("Language was changed, do you want to save config for previous language?"),
i18n("Save config"),
KStandardGuiItem::save(),
KStandardGuiItem::discard());
if (rc == KMessageBox::Yes) {
writeConfig();
}
......
......@@ -71,7 +71,12 @@ public:
void slotRemove()
{
if (KMessageBox::Yes == KMessageBox::questionYesNo(q, i18n("Do you want to delete selected template?"), i18n("Delete template"))) {
const int answer = KMessageBox::questionYesNo(q,
i18n("Do you want to delete selected template?"),
i18n("Delete template"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel());
if (answer == KMessageBox::Yes) {
const QList<QListWidgetItem *> lstSelectedItems = q->selectedItems();
for (QListWidgetItem *item : lstSelectedItems) {
if (item->data(TemplateListWidget::DefaultTemplate).toBool() == false) {
......
......@@ -307,7 +307,8 @@ void SimpleStringListEditor::slotRemove()
if (selectedItems.isEmpty()) {
return;
}
if (KMessageBox::Yes == KMessageBox::warningYesNo(this, d->mRemoveDialogLabel, i18n("Remove"))) {
const int answer = KMessageBox::warningYesNo(this, d->mRemoveDialogLabel, i18n("Remove"), KStandardGuiItem::remove(), KStandardGuiItem::cancel());
if (answer == KMessageBox::Yes) {
for (QListWidgetItem *item : selectedItems) {
delete d->mListBox->takeItem(d->mListBox->row(item));
}
......
......@@ -109,10 +109,13 @@ void RecentAddressWidget::slotRemoveItem()
if (selectedItems.isEmpty()) {
return;
}
if (KMessageBox::Yes
== KMessageBox::questionYesNo(this,
i18np("Do you want to remove this email address?", "Do you want to remove %1 email addresses?", selectedItems.count()),
i18n("Remove"))) {
const int answer =
KMessageBox::questionYesNo(this,
i18np("Do you want to remove this email address?", "Do you want to remove %1 email addresses?", selectedItems.count()),
i18n("Remove"),
KStandardGuiItem::remove(),
KStandardGuiItem::cancel());
if (answer == KMessageBox::Yes) {
for (QListWidgetItem *item : selectedItems) {
delete mListView->takeItem(mListView->row(item));
}
......
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