Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinmainwindow.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
43 | #include "views/viewproperties.h" | 43 | #include "views/viewproperties.h" | ||
44 | #include "views/dolphinnewfilemenuobserver.h" | 44 | #include "views/dolphinnewfilemenuobserver.h" | ||
45 | #include "dolphin_generalsettings.h" | 45 | #include "dolphin_generalsettings.h" | ||
46 | 46 | | |||
47 | #include <KActionCollection> | 47 | #include <KActionCollection> | ||
48 | #include <KActionMenu> | 48 | #include <KActionMenu> | ||
49 | #include <KAuthorized> | 49 | #include <KAuthorized> | ||
50 | #include <KConfig> | 50 | #include <KConfig> | ||
51 | #include <KDesktopFile> | ||||
51 | #include <KFileItemListProperties> | 52 | #include <KFileItemListProperties> | ||
52 | #include <KFilePlacesModel> | 53 | #include <KFilePlacesModel> | ||
53 | #include <KHelpMenu> | 54 | #include <KHelpMenu> | ||
54 | #include <KIO/JobUiDelegate> | 55 | #include <KIO/JobUiDelegate> | ||
55 | #include <KIO/OpenFileManagerWindowJob> | 56 | #include <KIO/OpenFileManagerWindowJob> | ||
56 | #include <KJobWidgets> | 57 | #include <KJobWidgets> | ||
57 | #include <KLocalizedString> | 58 | #include <KLocalizedString> | ||
58 | #include <KMessageBox> | 59 | #include <KMessageBox> | ||
▲ Show 20 Lines • Show All 338 Lines • ▼ Show 20 Line(s) | 396 | if (m_tabWidget->count() > 1 && GeneralSettings::confirmClosingMultipleTabs() && closedByUser) { | |||
397 | // Open a confirmation dialog with 3 buttons: | 398 | // Open a confirmation dialog with 3 buttons: | ||
398 | // QDialogButtonBox::Yes -> Quit | 399 | // QDialogButtonBox::Yes -> Quit | ||
399 | // QDialogButtonBox::No -> Close only the current tab | 400 | // QDialogButtonBox::No -> Close only the current tab | ||
400 | // QDialogButtonBox::Cancel -> do nothing | 401 | // QDialogButtonBox::Cancel -> do nothing | ||
401 | QDialog *dialog = new QDialog(this, Qt::Dialog); | 402 | QDialog *dialog = new QDialog(this, Qt::Dialog); | ||
402 | dialog->setWindowTitle(i18nc("@title:window", "Confirmation")); | 403 | dialog->setWindowTitle(i18nc("@title:window", "Confirmation")); | ||
403 | dialog->setModal(true); | 404 | dialog->setModal(true); | ||
404 | QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel); | 405 | QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel); | ||
405 | KGuiItem::assign(buttons->button(QDialogButtonBox::Yes), KStandardGuiItem::quit()); | 406 | KDesktopFile dolphinDesktopFile(QStringLiteral("%1.desktop").arg(QGuiApplication::desktopFileName())); | ||
407 | KGuiItem::assign(buttons->button(QDialogButtonBox::Yes), KGuiItem(i18nc("@action:button 'Quit Dolphin' button", "&Quit %1", dolphinDesktopFile.readName()), QIcon::fromTheme(QStringLiteral("application-exit")))); | ||||
406 | KGuiItem::assign(buttons->button(QDialogButtonBox::No), KGuiItem(i18n("C&lose Current Tab"), QIcon::fromTheme(QStringLiteral("tab-close")))); | 408 | KGuiItem::assign(buttons->button(QDialogButtonBox::No), KGuiItem(i18n("C&lose Current Tab"), QIcon::fromTheme(QStringLiteral("tab-close")))); | ||
407 | KGuiItem::assign(buttons->button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel()); | 409 | KGuiItem::assign(buttons->button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel()); | ||
408 | buttons->button(QDialogButtonBox::Yes)->setDefault(true); | 410 | buttons->button(QDialogButtonBox::Yes)->setDefault(true); | ||
409 | 411 | | |||
410 | bool doNotAskAgainCheckboxResult = false; | 412 | bool doNotAskAgainCheckboxResult = false; | ||
411 | 413 | | |||
412 | const int result = KMessageBox::createKMessageBox(dialog, | 414 | const int result = KMessageBox::createKMessageBox(dialog, | ||
413 | buttons, | 415 | buttons, | ||
▲ Show 20 Lines • Show All 1215 Lines • Show Last 20 Lines |