From 118dff93740d3f8e20dc57e2c2b92b9ad30bd58a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 18 May 2010 01:04:36 +0200 Subject: Add option to choose new tab page as home page BUG:235106 --- src/mainwindow.cpp | 8 ++++++-- src/rekonq.kcfg | 3 +++ src/settings/settings_general.ui | 13 ++++++++++--- src/settings/settingsdialog.cpp | 11 +++++++++++ src/settings/settingsdialog.h | 1 + 5 files changed, 31 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 083bb810..84d79c40 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -963,10 +963,14 @@ void MainWindow::viewPageSource() void MainWindow::homePage(Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers) { + KUrl homeUrl = ReKonfig::useNewTabPage() + ? KUrl( QL1S("about:home") ) + : KUrl( ReKonfig::homePage() ); + if (mouseButtons == Qt::MidButton || keyboardModifiers == Qt::ControlModifier) - Application::instance()->loadUrl(KUrl(ReKonfig::homePage()), Rekonq::SettingOpenTab); + Application::instance()->loadUrl( homeUrl, Rekonq::SettingOpenTab); else - currentTab()->view()->load(QUrl(ReKonfig::homePage())); + currentTab()->view()->load( homeUrl ); } diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index 86e47534..fa4a236d 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -60,6 +60,9 @@ http://www.kde.org/ + + false + false diff --git a/src/settings/settings_general.ui b/src/settings/settings_general.ui index ccc3fa20..f7771cbc 100644 --- a/src/settings/settings_general.ui +++ b/src/settings/settings_general.ui @@ -79,7 +79,7 @@ Home Page - + @@ -101,7 +101,7 @@ - + true @@ -114,7 +114,7 @@ - + @@ -138,6 +138,13 @@ + + + + Use New Tab Page + + + diff --git a/src/settings/settingsdialog.cpp b/src/settings/settingsdialog.cpp index d2d5c0d0..3f701c5b 100644 --- a/src/settings/settingsdialog.cpp +++ b/src/settings/settingsdialog.cpp @@ -151,6 +151,10 @@ SettingsDialog::SettingsDialog(QWidget *parent) connect(d->generalUi.setHomeToCurrentPageButton, SIGNAL(clicked()), this, SLOT(setHomeToCurrentPage())); + // new tab page + disableHomeSettings(ReKonfig::useNewTabPage()); + connect(d->generalUi.kcfg_useNewTabPage, SIGNAL(toggled(bool)), this, SLOT(disableHomeSettings(bool))); + // update buttons connect(d->adBlockWidg, SIGNAL(changed(bool)), this, SLOT(updateButtons())); connect(d->networkWidg, SIGNAL(changed(bool)), this, SLOT(updateButtons())); @@ -239,3 +243,10 @@ void SettingsDialog::setHomeToCurrentPage() d->generalUi.kcfg_homePage->setText(webTab->url().prettyUrl()); } } + + +void SettingsDialog::disableHomeSettings(bool b) +{ + d->generalUi.kcfg_homePage->setEnabled(!b); + d->generalUi.setHomeToCurrentPageButton->setEnabled(!b); +} diff --git a/src/settings/settingsdialog.h b/src/settings/settingsdialog.h index 25b2fe9b..cade78e3 100644 --- a/src/settings/settingsdialog.h +++ b/src/settings/settingsdialog.h @@ -59,6 +59,7 @@ private slots: void saveSettings(); void setHomeToCurrentPage(); + void disableHomeSettings(bool); }; #endif // SETTINGS_DIALOG_H -- cgit v1.2.1