From 5e7fe094f433b4143cdd8a01980175be60eac58d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Mar=C3=A7al=20Silva?= Date: Sat, 22 Oct 2022 22:04:11 -0300 Subject: [PATCH 1/2] Change button from "Delete" to "Delete Permanently" in new dialog The recent merge request !1005 added a new dialog to delete files directly when they don't fit in the trash. It's possible a user might ignore the warning and only focus on the buttons. Here I'm changing the button from "Delete" to "Delete Permanently" so the user has another chance to read what he's about to do and avoid executing a destructive action. --- src/widgets/widgetsaskuseractionhandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets/widgetsaskuseractionhandler.cpp b/src/widgets/widgetsaskuseractionhandler.cpp index af4266614..99cf75812 100644 --- a/src/widgets/widgetsaskuseractionhandler.cpp +++ b/src/widgets/widgetsaskuseractionhandler.cpp @@ -232,7 +232,8 @@ static ProcessAskDeleteResult processAskDelete(const QList &urls, AskIface "This action cannot be undone.", urlCount); } - res.acceptButton = KStandardGuiItem::del(); + res.title = i18n("Delete Permanently"); + res.acceptButton = KGuiItem(res.title, QStringLiteral("edit-delete")); break; } case AskIface::DeleteInsteadOfTrash: { @@ -254,7 +255,8 @@ static ProcessAskDeleteResult processAskDelete(const QList &urls, AskIface "This action cannot be undone.", urlCount); } - res.acceptButton = KStandardGuiItem::del(); + res.title = i18n("Delete Permanently"); + res.acceptButton = KGuiItem(res.title, QStringLiteral("edit-delete")); break; } case AskIface::EmptyTrash: { -- GitLab From 0f41864e0bf4909f1cc72643dc66c8faf3e91338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Mar=C3=A7al=20Silva?= Date: Sun, 23 Oct 2022 15:27:39 -0300 Subject: [PATCH 2/2] Make requested changes --- src/widgets/jobuidelegate.cpp | 4 ++-- src/widgets/widgetsaskuseractionhandler.cpp | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/widgets/jobuidelegate.cpp b/src/widgets/jobuidelegate.cpp index 7f3536269..994cf8598 100644 --- a/src/widgets/jobuidelegate.cpp +++ b/src/widgets/jobuidelegate.cpp @@ -283,7 +283,7 @@ bool KIO::JobUiDelegate::askDeleteConfirmation(const QList &urls, Deletion "cannot be undone.", prettyList.first()), i18n("Delete Permanently"), - KStandardGuiItem::del(), + KGuiItem(i18nc("@action:button", "Delete Permanently"), QStringLiteral("edit-delete")), KStandardGuiItem::cancel(), keyName, options); @@ -297,7 +297,7 @@ bool KIO::JobUiDelegate::askDeleteConfirmation(const QList &urls, Deletion prettyList.count()), prettyList, i18n("Delete Permanently"), - KStandardGuiItem::del(), + KGuiItem(i18nc("@action:button", "Delete Permanently"), QStringLiteral("edit-delete")), KStandardGuiItem::cancel(), keyName, options); diff --git a/src/widgets/widgetsaskuseractionhandler.cpp b/src/widgets/widgetsaskuseractionhandler.cpp index 99cf75812..9909d1c39 100644 --- a/src/widgets/widgetsaskuseractionhandler.cpp +++ b/src/widgets/widgetsaskuseractionhandler.cpp @@ -232,8 +232,7 @@ static ProcessAskDeleteResult processAskDelete(const QList &urls, AskIface "This action cannot be undone.", urlCount); } - res.title = i18n("Delete Permanently"); - res.acceptButton = KGuiItem(res.title, QStringLiteral("edit-delete")); + res.acceptButton = KGuiItem(i18nc("@action:button", "Delete Permanently"), QStringLiteral("edit-delete")); break; } case AskIface::DeleteInsteadOfTrash: { @@ -255,8 +254,7 @@ static ProcessAskDeleteResult processAskDelete(const QList &urls, AskIface "This action cannot be undone.", urlCount); } - res.title = i18n("Delete Permanently"); - res.acceptButton = KGuiItem(res.title, QStringLiteral("edit-delete")); + res.acceptButton = KGuiItem(i18nc("@action:button", "Delete Permanently"), QStringLiteral("edit-delete")); break; } case AskIface::EmptyTrash: { -- GitLab