]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Improve QDialogButtonBox::Yes override text
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Mon, 2 Apr 2018 21:06:41 +0000 (23:06 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Thu, 5 Apr 2018 21:28:58 +0000 (23:28 +0200)
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

index d112007bc542a66fc654f2cc973473c0c8cf7125..65c57ef7d242af69699f7f9c6fcd1e06511c5719 100644 (file)
@@ -48,6 +48,7 @@
 #include <KActionMenu>
 #include <KAuthorized>
 #include <KConfig>
+#include <KDesktopFile>
 #include <KFileItemListProperties>
 #include <KFilePlacesModel>
 #include <KHelpMenu>
@@ -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);