From 09567d9fbf6e034319bbdf7820f4bceac42cee12 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 13 Sep 2009 03:14:55 +0200 Subject: Modified rekonq behaviour: HomePage has 2 choices: usual home page vs new tab page new tab has 3: new tabp page, home page, blank page --- src/application.cpp | 2 +- src/mainview.cpp | 33 ++++------ src/mainview.h | 2 - src/mainwindow.cpp | 19 +++++- src/mainwindow.h | 3 +- src/rekonq.kcfg | 3 + src/settings.cpp | 19 ------ src/settings.h | 1 - src/settings_general.ui | 162 ++++++++++++++++++------------------------------ 9 files changed, 98 insertions(+), 146 deletions(-) (limited to 'src') diff --git a/src/application.cpp b/src/application.cpp index 3ca6b0fd..1e30cfd0 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -122,7 +122,7 @@ int Application::newInstance() { // creating new window MainWindow *w = newMainWindow(); - w->mainView()->slotHome(); + w->slotHome(); } return 0; diff --git a/src/mainview.cpp b/src/mainview.cpp index 07f209b7..7c91b992 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -296,7 +296,19 @@ void MainView::newTab() urlBar()->setUrl(KUrl("")); urlBar()->setFocus(); - slotHome(); + HomePage p; + + switch(ReKonfig::newTabsBehaviour()) + { + case 0: + w->setHtml( p.rekonqHomePage() ); + break; + case 2: + w->load( QUrl(ReKonfig::homePage()) ); + break; + default: + break; + } } @@ -570,22 +582,3 @@ void MainView::resizeEvent(QResizeEvent *event) { KTabWidget::resizeEvent(event); } - - -void MainView::slotHome() -{ - WebView *w = currentWebView(); - HomePage p; - - switch(ReKonfig::newTabsBehaviour()) - { - case 0: - w->setHtml( p.rekonqHomePage(), QUrl()); - break; - case 2: - w->load( QUrl(ReKonfig::homePage()) ); - break; - default: - break; - } -} diff --git a/src/mainview.h b/src/mainview.h index 783068f9..c59cca1a 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -110,8 +110,6 @@ public slots: */ void newTab(); - void slotHome(); - void slotCloneTab(int index = -1); void slotCloseTab(int index = -1); void slotCloseOtherTabs(int index); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index da51ac2a..099a463e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -45,6 +45,7 @@ #include "findbar.h" #include "sidepanel.h" #include "urlbar.h" +#include "homepage.h" // Ui Includes #include "ui_cleardata.h" @@ -260,7 +261,7 @@ void MainWindow::setupActions() a = KStandardAction::fullScreen(this, SLOT(slotViewFullScreen(bool)), this, actionCollection()); a->setShortcut(KShortcut(Qt::Key_F11, Qt::CTRL + Qt::SHIFT + Qt::Key_F)); - KStandardAction::home(m_view, SLOT(slotHome()), actionCollection()); + KStandardAction::home(this, SLOT(slotHome()), actionCollection()); KStandardAction::preferences(this, SLOT(slotPreferences()), actionCollection()); // WEB Actions (NO KStandardActions..) @@ -736,6 +737,22 @@ void MainWindow::slotViewPageSource() } +void MainWindow::slotHome() +{ + WebView *w = currentTab(); + + if(ReKonfig::useNewTabPage()) + { + HomePage p; + w->setHtml( p.rekonqHomePage(), QUrl()); + } + else + { + w->load( QUrl(ReKonfig::homePage()) ); + } +} + + void MainWindow::slotToggleInspector(bool enable) { QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, enable); diff --git a/src/mainwindow.h b/src/mainwindow.h index c3976109..8a87022c 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -80,6 +80,7 @@ private: public slots: void slotUpdateBrowser(); + void slotHome(); /** * Notifies a message in a popup @@ -103,7 +104,7 @@ private slots: void slotBrowserLoading(bool); void slotUpdateActions(); void slotUpdateWindowTitle(const QString &title = QString()); - + // history related void slotOpenPrevious(); void slotOpenNext(); diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index 56f0b18c..401ce58c 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -11,6 +11,9 @@ + + true + 0 diff --git a/src/settings.cpp b/src/settings.cpp index 0838b252..843b3375 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -141,10 +141,6 @@ SettingsDialog::SettingsDialog(QWidget *parent) connect(d->generalUi.setHomeToCurrentPageButton, SIGNAL(clicked()), this, SLOT(setHomeToCurrentPage())); - int n = d->generalUi.kcfg_newTabsBehaviour->currentIndex(); - checkLineEnable(n); - connect(d->generalUi.kcfg_newTabsBehaviour, SIGNAL(currentIndexChanged(int)), this, SLOT(checkLineEnable(int))); - connect(d->ebrowsingModule, SIGNAL(changed(bool)), this, SLOT(updateButtons())); connect(d->cookiesModule, SIGNAL(changed(bool)), this, SLOT(updateButtons())); @@ -218,18 +214,3 @@ void SettingsDialog::setHomeToCurrentPage() d->generalUi.kcfg_homePage->setText(webView->url().prettyUrl()); } } - - -void SettingsDialog::checkLineEnable(int n) -{ - if(n == 2) - { - d->generalUi.kcfg_homePage->setEnabled(true); - d->generalUi.setHomeToCurrentPageButton->setEnabled(true); - } - else - { - d->generalUi.kcfg_homePage->setEnabled(false); - d->generalUi.setHomeToCurrentPageButton->setEnabled(false); - } -} \ No newline at end of file diff --git a/src/settings.h b/src/settings.h index 6cdbd5e3..0be89173 100644 --- a/src/settings.h +++ b/src/settings.h @@ -55,7 +55,6 @@ private slots: void saveSettings(); void setHomeToCurrentPage(); - void checkLineEnable(int); }; #endif // SETTINGS_H diff --git a/src/settings_general.ui b/src/settings_general.ui index 70accdec..fe1ec457 100644 --- a/src/settings_general.ui +++ b/src/settings_general.ui @@ -6,51 +6,42 @@ 0 0 - 662 - 539 + 442 + 369 General - + - New Tabs Behaviour + Home Page - - - + + + - New tabs open + Use new tab page - - - - - + true - - - rekonq home page - - - - - blank page - - - - - url - - - - + + + + + + Use this page: + + + false + + + @@ -78,10 +69,48 @@ + + New Tabs Behaviour + + + + + + New tabs open + + + + + + + true + + + + new tab page + + + + + blank page + + + + + home page + + + + + + + + + Tabbed Browsing - + @@ -113,75 +142,6 @@ - - - - General Settings - - - - - - Show URLs of links in a popup - - - - - - - - - - History - - - - - - Remove history items: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - After one day - - - - - After one week - - - - - After two weeks - - - - - After one month - - - - - After one year - - - - - Manually - - - - - - - @@ -190,7 +150,7 @@ 20 - 40 + 43 -- cgit v1.2.1