summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-04-08 10:59:12 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-04-08 10:59:12 +0200
commit11fa0d96626b4417718aeef2cf8316a97bce02ed (patch)
tree64e3487cf26586bb33aa2ba6c54e5bc7a7eb5448 /src
parentRemoved unuseful commented code (diff)
downloadrekonq-11fa0d96626b4417718aeef2cf8316a97bce02ed.tar.xz
Asking user to close rekonq if there are more than 1 tabs opened..
(Oh, Dear.. my English..)
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp17
-rw-r--r--src/mainwindow.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 20020ca3..249dd389 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -763,4 +763,21 @@ void MainWindow::slotShowMenubar(bool enable)
menuBar()->show();
else
menuBar()->hide();
+}
+
+
+bool MainWindow::queryClose()
+{
+ if (m_view->count() > 1)
+ {
+ int ret = KMessageBox::warningYesNo(this,
+ i18n("Are you sure you want to close the window?" " There are %1 tab open" , m_view->count() ),
+ i18n("Closing")
+ );
+ if (ret == KMessageBox::No)
+ {
+ return false;
+ }
+ }
+ return true;
} \ No newline at end of file
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 0ca76498..1c65c5d7 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -70,6 +70,9 @@ public slots:
void loadUrl(const KUrl &url);
void slotUpdateBrowser();
+protected:
+ bool queryClose();
+
private slots:
void slotUpdateConfiguration();
void slotLoadProgress(int);