summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-12-28 12:20:24 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-12-28 12:20:24 +0100
commitecd78dd7a24a70c0e41c246b1232613554dcfd8c (patch)
treed9c845932f3f2db8ea35479e12e3adc535925712 /src
parentauto load plug in (diff)
downloadrekonq-ecd78dd7a24a70c0e41c246b1232613554dcfd8c.tar.xz
Merge Request #79 with the changes discussed.
1) no more confirm dialog on exit 2) restore newtab page or home page on close last tab
Diffstat (limited to 'src')
-rw-r--r--src/mainview.cpp19
-rw-r--r--src/mainwindow.cpp36
-rw-r--r--src/mainwindow.h2
3 files changed, 18 insertions, 39 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 46cd9a15..2123d021 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -447,9 +447,26 @@ void MainView::cloneTab(int index)
// When index is -1 index chooses the current tab
void MainView::closeTab(int index)
{
- // do nothing if just one tab is opened
+ // open default homePage if just one tab is opened
if (count() == 1)
+ {
+ WebView *w = currentWebTab()->view();
+ urlBar()->setUrl(KUrl(""));
+ switch(ReKonfig::newTabsBehaviour())
+ {
+ case 0: // new tab page
+ case 1: // blank page
+ w->load( KUrl("about:home") );
+ break;
+ case 2: // homepage
+ w->load( KUrl(ReKonfig::homePage()) );
+ break;
+ default:
+ break;
+ }
+ urlBar()->setFocus();
return;
+ }
if (index < 0)
index = currentIndex();
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index b4174191..76ca447a 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -922,42 +922,6 @@ void MainWindow::openNext()
}
-bool MainWindow::queryClose()
-{
- if (m_view->count() > 1)
- {
-
- int answer = KMessageBox::questionYesNoCancel(
- this,
- i18np("Are you sure you want to close the window?\n" \
- "You still have 1 tab open.",
- "Are you sure you want to close the window?\n" \
- "You still have %1 tabs open.",
- m_view->count()),
- i18n("Closing rekonq"),
- KStandardGuiItem::quit(),
- KGuiItem(i18n("C&lose Current Tab"), KIcon("tab-close")),
- KStandardGuiItem::cancel(),
- "confirmClosingMultipleTabs");
-
- switch (answer)
- {
- case KMessageBox::Yes:
- // Quit
- return true;
- break;
- case KMessageBox::No:
- // Close only the current tab
- m_view->closeTab();
- default:
- return false;
- }
- }
-
- return true;
-}
-
-
void MainWindow::keyPressEvent(QKeyEvent *event)
{
// hide findbar
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 95964e22..d600c5dc 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -107,8 +107,6 @@ signals:
void shiftCtrlTabPressed();
protected:
- bool queryClose();
-
/**
* Filters (SHIFT + ) CTRL + TAB events and emit (shift)ctrlTabPressed()
* to make switch tab