Commit 1b8f8e46 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau Committed by Laurent Montel
Browse files

Use the term "Delete" in UI some more when wiping data

parent 7ecbb693
......@@ -77,7 +77,7 @@ ArchiveMailWidget::ArchiveMailWidget(const KSharedConfigPtr &config, QWidget *pa
connect(mWidget.treeWidget, &QWidget::customContextMenuRequested, this, &ArchiveMailWidget::slotCustomContextMenuRequested);
connect(mWidget.removeItem, &QAbstractButton::clicked, this, &ArchiveMailWidget::slotRemoveItem);
connect(mWidget.deleteItem, &QAbstractButton::clicked, this, &ArchiveMailWidget::slotDeleteItem);
connect(mWidget.modifyItem, &QAbstractButton::clicked, this, &ArchiveMailWidget::slotModifyItem);
connect(mWidget.addItem, &QAbstractButton::clicked, this, &ArchiveMailWidget::slotAddItem);
connect(mWidget.treeWidget, &QTreeWidget::itemChanged, this, &ArchiveMailWidget::slotItemChanged);
......@@ -110,7 +110,7 @@ void ArchiveMailWidget::slotCustomContextMenuRequested(const QPoint &)
menu.addAction(i18n("Open Containing Folder..."), this, &ArchiveMailWidget::slotOpenFolder);
}
menu.addSeparator();
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete"), this, &ArchiveMailWidget::slotRemoveItem);
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete"), this, &ArchiveMailWidget::slotDeleteItem);
}
menu.exec(QCursor::pos());
}
......@@ -119,13 +119,13 @@ void ArchiveMailWidget::updateButtons()
{
const QList<QTreeWidgetItem *> listItems = mWidget.treeWidget->selectedItems();
if (listItems.isEmpty()) {
mWidget.removeItem->setEnabled(false);
mWidget.deleteItem->setEnabled(false);
mWidget.modifyItem->setEnabled(false);
} else if (listItems.count() == 1) {
mWidget.removeItem->setEnabled(true);
mWidget.deleteItem->setEnabled(true);
mWidget.modifyItem->setEnabled(true);
} else {
mWidget.removeItem->setEnabled(true);
mWidget.deleteItem->setEnabled(true);
mWidget.modifyItem->setEnabled(false);
}
}
......@@ -216,10 +216,11 @@ bool ArchiveMailWidget::save() const
return true;
}
void ArchiveMailWidget::slotRemoveItem()
void ArchiveMailWidget::slotDeleteItem()
{
const QList<QTreeWidgetItem *> listItems = mWidget.treeWidget->selectedItems();
if (KMessageBox::warningYesNo(parentWidget(), i18n("Do you want to delete the selected items?"), i18n("Remove items")) == KMessageBox::No) {
if (KMessageBox::warningYesNo(parentWidget(), i18n("Do you want to delete the selected items?"), i18nc("@title:window", "Delete Items"))
== KMessageBox::No) {
return;
}
......
......@@ -52,7 +52,7 @@ private:
bool verifyExistingArchive(ArchiveMailInfo *info) const;
void updateDiffDate(ArchiveMailItem *item, ArchiveMailInfo *info);
void slotRemoveItem();
void slotDeleteItem();
void slotModifyItem();
void slotAddItem();
void updateButtons();
......
......@@ -40,9 +40,9 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="removeItem">
<widget class="QPushButton" name="deleteItem">
<property name="text">
<string>Remove</string>
<string>Delete</string>
</property>
</widget>
</item>
......
......@@ -188,7 +188,7 @@ void FollowUpReminderInfoWidget::slotCustomContextMenuRequested(const QPoint &po
if (result == showMessage) {
openShowMessage(mailItem->info()->answerMessageItemId());
} else if (result == deleteItem) {
removeItem(listItems);
deleteItems(listItems);
}
}
}
......@@ -200,7 +200,7 @@ void FollowUpReminderInfoWidget::openShowMessage(Akonadi::Item::Id id)
job->start();
}
void FollowUpReminderInfoWidget::removeItem(const QList<QTreeWidgetItem *> &mailItemLst)
void FollowUpReminderInfoWidget::deleteItems(const QList<QTreeWidgetItem *> &mailItemLst)
{
if (mailItemLst.isEmpty()) {
qCDebug(FOLLOWUPREMINDERAGENT_LOG) << "Not item selected";
......@@ -208,8 +208,8 @@ void FollowUpReminderInfoWidget::removeItem(const QList<QTreeWidgetItem *> &mail
if (KMessageBox::Yes
== KMessageBox::warningYesNo(
this,
i18np("Do you want to remove this selected item?", "Do you want to remove these %1 selected items?", mailItemLst.count()),
i18n("Delete"))) {
i18np("Do you want to delete this selected item?", "Do you want to delete these %1 selected items?", mailItemLst.count()),
i18nc("@title:window", "Delete Items"))) {
for (QTreeWidgetItem *item : mailItemLst) {
auto mailItem = static_cast<FollowUpReminderInfoItem *>(item);
mListRemoveId << mailItem->info()->uniqueIdentifier();
......
......@@ -49,7 +49,7 @@ public:
private:
void slotCustomContextMenuRequested(const QPoint &pos);
void createOrUpdateItem(FollowUpReminder::FollowUpReminderInfo *info, FollowUpReminderInfoItem *item = nullptr);
void removeItem(const QList<QTreeWidgetItem *> &mailItem);
void deleteItems(const QList<QTreeWidgetItem *> &mailItemLst);
void openShowMessage(Akonadi::Item::Id id);
enum ItemData {
AnswerItemId = Qt::UserRole + 1,
......
......@@ -70,7 +70,7 @@ SendLaterWidget::SendLaterWidget(QWidget *parent)
connect(mWidget->treeWidget, &QTreeWidget::customContextMenuRequested, this, &SendLaterWidget::slotCustomContextMenuRequested);
connect(mWidget->removeItem, &QPushButton::clicked, this, &SendLaterWidget::slotRemoveItem);
connect(mWidget->deleteItem, &QPushButton::clicked, this, &SendLaterWidget::slotDeleteItem);
connect(mWidget->modifyItem, &QPushButton::clicked, this, &SendLaterWidget::slotModifyItem);
connect(mWidget->treeWidget, &QTreeWidget::itemSelectionChanged, this, &SendLaterWidget::updateButtons);
connect(mWidget->treeWidget, &QTreeWidget::itemDoubleClicked, this, &SendLaterWidget::slotModifyItem);
......@@ -92,7 +92,7 @@ void SendLaterWidget::slotCustomContextMenuRequested(const QPoint &)
menu.addAction(i18n("Send now"), this, &SendLaterWidget::slotSendNow);
}
menu.addSeparator();
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete"), this, &SendLaterWidget::slotRemoveItem);
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete"), this, &SendLaterWidget::slotDeleteItem);
menu.exec(QCursor::pos());
}
}
......@@ -120,13 +120,13 @@ void SendLaterWidget::updateButtons()
{
const QList<QTreeWidgetItem *> listItems = mWidget->treeWidget->selectedItems();
if (listItems.isEmpty()) {
mWidget->removeItem->setEnabled(false);
mWidget->deleteItem->setEnabled(false);
mWidget->modifyItem->setEnabled(false);
} else if (listItems.count() == 1) {
mWidget->removeItem->setEnabled(true);
mWidget->deleteItem->setEnabled(true);
mWidget->modifyItem->setEnabled(true);
} else {
mWidget->removeItem->setEnabled(true);
mWidget->deleteItem->setEnabled(true);
mWidget->modifyItem->setEnabled(false);
}
}
......@@ -189,7 +189,7 @@ void SendLaterWidget::save()
config->reparseConfiguration();
}
void SendLaterWidget::slotRemoveItem()
void SendLaterWidget::slotDeleteItem()
{
const QList<QTreeWidgetItem *> listItems = mWidget->treeWidget->selectedItems();
......@@ -199,18 +199,21 @@ void SendLaterWidget::slotRemoveItem()
const int numberOfItems(listItems.count());
if (KMessageBox::warningYesNo(this,
i18np("Do you want to delete the selected item?", "Do you want to delete the selected items?", numberOfItems),
i18n("Remove items"))
i18nc("@title:window", "Delete Items"))
== KMessageBox::No) {
return;
}
bool removeMessage = false;
if (KMessageBox::warningYesNo(this, i18n("Do you want to remove the messages as well?"), i18n("Remove messages")) == KMessageBox::Yes) {
removeMessage = true;
bool deleteMessage = false;
if (KMessageBox::warningYesNo(this,
i18np("Do you want to delete the message as well?", "Do you want to delete the messages as well?", numberOfItems),
i18nc("@title:window", "Delete Messages"))
== KMessageBox::Yes) {
deleteMessage = true;
}
for (QTreeWidgetItem *item : listItems) {
if (removeMessage) {
if (deleteMessage) {
auto mailItem = static_cast<SendLaterItem *>(item);
if (mailItem->info()) {
Akonadi::Item::Id id = mailItem->info()->itemId();
......
......@@ -55,7 +55,7 @@ Q_SIGNALS:
void sendNow(Akonadi::Item::Id);
private:
void slotRemoveItem();
void slotDeleteItem();
void slotModifyItem();
void updateButtons();
void slotCustomContextMenuRequested(const QPoint &);
......
......@@ -33,9 +33,9 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="removeItem">
<widget class="QPushButton" name="deleteItem">
<property name="text">
<string>Remove</string>
<string>Delete</string>
</property>
</widget>
</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