diff options
| author | Elvis Angelaccio <[email protected]> | 2018-04-02 23:06:41 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2018-04-05 23:28:58 +0200 |
| commit | e9192259f6fd54c0ca1fcf7bae6db57fa1c8a08a (patch) | |
| tree | 14908f8624851deb54cee7228fdff3e6ea1acd2f /src | |
| parent | 993c47f30923e39b33dbd47a2a62e3dde5ccdbe4 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index d112007bc..65c57ef7d 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -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); |
