summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp35
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();
+}