summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPino Toscano <pino@kde.org>2016-12-04 14:53:09 (GMT)
committerPino Toscano <pino@kde.org>2016-12-04 14:53:09 (GMT)
commite024cf2313498baddacbf3c9f004c294eb82ccb2 (patch)
treed4dfb0f7d608b64114caa157f1acbe4592b56a6a
parent52d6c5d4ea688f58fe3ab1940a2a2b7cd014788a (diff)
Make more use of KStandardGuiItem
Use standard items instead of creating them and button texts manually.
-rw-r--r--src/storageservice/dialog/storageservicedeletedialog.cpp3
-rw-r--r--src/widgets/annotationdialog.cpp3
-rw-r--r--src/widgets/renamefiledialog.cpp4
3 files changed, 7 insertions, 3 deletions
diff --git a/src/storageservice/dialog/storageservicedeletedialog.cpp b/src/storageservice/dialog/storageservicedeletedialog.cpp
index 55ef5f0..7c470de 100644
--- a/src/storageservice/dialog/storageservicedeletedialog.cpp
+++ b/src/storageservice/dialog/storageservicedeletedialog.cpp
@@ -25,6 +25,7 @@
#include <KLocalizedString>
#include <KSharedConfig>
+#include <KStandardGuiItem>
#include <QMenu>
#include <QLabel>
@@ -97,7 +98,7 @@ StorageServiceDeleteDialog::StorageServiceDeleteDialog(DeleteType type, PimCommo
mUser1Button = new QPushButton;
buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &StorageServiceDeleteDialog::reject);
- mUser1Button->setText(i18n("Delete"));
+ KStandardGuiItem::assign(mUser1Button, KStandardGuiItem::Delete);
QWidget *w = new QWidget;
QVBoxLayout *vbox = new QVBoxLayout;
diff --git a/src/widgets/annotationdialog.cpp b/src/widgets/annotationdialog.cpp
index 569ae58..1180c12 100644
--- a/src/widgets/annotationdialog.cpp
+++ b/src/widgets/annotationdialog.cpp
@@ -26,6 +26,7 @@
#include <KLocalizedString>
#include <ItemModifyJob>
#include <KSharedConfig>
+#include <KStandardGuiItem>
#include <item.h>
#include <entityannotationsattribute.h>
@@ -144,7 +145,7 @@ void AnnotationEditDialog::slotDeleteNote()
const int answer = KMessageBox::warningContinueCancel(this,
i18n("Do you really want to delete this note?"),
i18nc("@title:window", "Delete Note?"),
- KGuiItem(i18nc("@action:button", "Delete"), QStringLiteral("edit-delete")));
+ KStandardGuiItem::del());
if (answer == KMessageBox::Continue) {
d->mItem.removeAttribute<Akonadi::EntityAnnotationsAttribute>();
new Akonadi::ItemModifyJob(d->mItem);
diff --git a/src/widgets/renamefiledialog.cpp b/src/widgets/renamefiledialog.cpp
index 3e3511e..ccb3efd 100644
--- a/src/widgets/renamefiledialog.cpp
+++ b/src/widgets/renamefiledialog.cpp
@@ -34,6 +34,7 @@
#include <KIO/StatJob>
#include <KJobWidgets>
#include <KMessageBox>
+#include <KStandardGuiItem>
#include <QHBoxLayout>
#include <QCheckBox>
@@ -141,7 +142,8 @@ RenameFileDialog::RenameFileDialog(const QUrl &url, bool multiFiles, QWidget *pa
renameLayout->addWidget(d->suggestNewName);
connect(d->suggestNewName, &QPushButton::clicked, this, &RenameFileDialog::slotSuggestNewNamePressed);
- QPushButton *overWrite = new QPushButton(i18n("&Overwrite"), this);
+ QPushButton *overWrite = new QPushButton(this);
+ KStandardGuiItem::assign(overWrite, KStandardGuiItem::Overwrite);
connect(overWrite, &QPushButton::clicked, this, &RenameFileDialog::slotOverwritePressed);
QPushButton *ignore = new QPushButton(i18n("&Ignore"), this);