diff options
author | Johannes Tröscher <fritz_van_tom@hotmail.com> | 2011-09-13 19:49:31 +0200 |
---|---|---|
committer | Johannes Tröscher <fritz_van_tom@hotmail.com> | 2011-09-13 19:49:31 +0200 |
commit | 67f7e374770103d1556cca48e907b3cbff6ac491 (patch) | |
tree | b47a60d29cfbd540d3fa45eab0db26af154a8b97 /src/application.cpp | |
parent | load clipboard url on middle-click if autoscroll is disabled (diff) | |
parent | Fix close & session (diff) | |
download | rekonq-67f7e374770103d1556cca48e907b3cbff6ac491.tar.xz |
Merge branch 'master' of git.kde.org:rekonq
Diffstat (limited to 'src/application.cpp')
-rw-r--r-- | src/application.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/application.cpp b/src/application.cpp index b30867bb..2d8cddb2 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -61,6 +61,7 @@ #include <KWindowInfo> #include <KGlobal> #include <KCharsets> +#include <KMessageBox> // Qt Includes #include <QVBoxLayout> @@ -687,3 +688,37 @@ void Application::setPrivateBrowsingMode(bool b) loadUrl(KUrl("about:home"), Rekonq::NewWindow); } } + + +void Application::queryQuit() +{ + if (mainWindowList().count() > 1) + { + int answer = KMessageBox::questionYesNoCancel( + mainWindow(), + i18n("Wanna close the window or the whole app?"), + i18n("Application/Window closing..."), + KGuiItem(i18n("C&lose Current Window"), + KIcon("window-close")), + KStandardGuiItem::quit(), + KStandardGuiItem::cancel(), + "confirmClosingMultipleWindows" + ); + + switch (answer) + { + case KMessageBox::Yes: + mainWindow()->close(); + return; + + case KMessageBox::No: + break; + + default: + return; + } + } + + // in case of just one window... + quit(); +} |