From e9192259f6fd54c0ca1fcf7bae6db57fa1c8a08a Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Mon, 2 Apr 2018 23:06:41 +0200 Subject: [PATCH] Improve QDialogButtonBox::Yes override text Summary: We are asking the users whether they are sure they want to quit. But the "Quit" button can be ambiguous (am I quitting dolphin or just this dialog?). If we use a "Quit Dolphin" button instead, that clearly shows what will happen after triggering the action. Test Plan: Close dolphin while multiple tabs are open. Reviewers: #dolphin Differential Revision: https://phabricator.kde.org/D11892 --- src/dolphinmainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index d112007bc5..65c57ef7d2 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -402,7 +403,8 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event) dialog->setWindowTitle(i18nc("@title:window", "Confirmation")); dialog->setModal(true); QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel); - KGuiItem::assign(buttons->button(QDialogButtonBox::Yes), KStandardGuiItem::quit()); + KDesktopFile dolphinDesktopFile(QStringLiteral("%1.desktop").arg(QGuiApplication::desktopFileName())); + KGuiItem::assign(buttons->button(QDialogButtonBox::Yes), KGuiItem(i18nc("@action:button 'Quit Dolphin' button", "&Quit %1", dolphinDesktopFile.readName()), QIcon::fromTheme(QStringLiteral("application-exit")))); KGuiItem::assign(buttons->button(QDialogButtonBox::No), KGuiItem(i18n("C&lose Current Tab"), QIcon::fromTheme(QStringLiteral("tab-close")))); KGuiItem::assign(buttons->button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel()); buttons->button(QDialogButtonBox::Yes)->setDefault(true);