diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-09-13 17:10:30 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-09-13 17:10:30 +0200 |
commit | 681a611588781734d45395d76ec802c0a2117be3 (patch) | |
tree | dfcf89a4772664417dfd1b0b70d78f29362c0cb8 /src/application.cpp | |
parent | Get sure about urls are restored (diff) | |
download | rekonq-681a611588781734d45395d76ec802c0a2117be3.tar.xz |
Fix close & session
First, I'm really sorry for this bad commit ('git' talking..).
The fact is that the 3 bugs fixed here were found chained playing
with close code. Here it is the report:
- fix close window (it now really appears on multiple window closing)
- fix saveSession (saving one call for each site loaded and storing
better information): saveSession is now called on loadFinished
- clean up some compilation warnings
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(); +} |