diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/application.cpp | 2 | ||||
-rw-r--r-- | src/mainview.cpp | 33 | ||||
-rw-r--r-- | src/mainview.h | 2 | ||||
-rw-r--r-- | src/mainwindow.cpp | 19 | ||||
-rw-r--r-- | src/mainwindow.h | 3 | ||||
-rw-r--r-- | src/rekonq.kcfg | 3 | ||||
-rw-r--r-- | src/settings.cpp | 19 | ||||
-rw-r--r-- | src/settings.h | 1 | ||||
-rw-r--r-- | src/settings_general.ui | 162 |
9 files changed, 98 insertions, 146 deletions
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 @@ <!-- General Settings --> <group name="General"> + <entry name="useNewTabPage" type="Bool"> + <default>true</default> + </entry> <entry name="newTabsBehaviour" type="Int"> <default>0</default> </entry> 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 @@ <rect> <x>0</x> <y>0</y> - <width>662</width> - <height>539</height> + <width>442</width> + <height>369</height> </rect> </property> <property name="windowTitle"> <string>General</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> + <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QGroupBox" name="groupBox"> <property name="title"> - <string>New Tabs Behaviour</string> + <string>Home Page</string> </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="label"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QRadioButton" name="kcfg_useNewTabPage"> <property name="text"> - <string>New tabs open </string> + <string>Use new tab page</string> </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="KComboBox" name="kcfg_newTabsBehaviour"> - <property name="enabled"> + <property name="checked"> <bool>true</bool> </property> - <item> - <property name="text"> - <string>rekonq home page</string> - </property> - </item> - <item> - <property name="text"> - <string>blank page</string> - </property> - </item> - <item> - <property name="text"> - <string>url</string> - </property> - </item> </widget> </item> - <item row="1" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QRadioButton" name="radioButton"> + <property name="text"> + <string>Use this page:</string> + </property> + <property name="checked"> + <bool>false</bool> + </property> + </widget> + </item> <item> <widget class="KLineEdit" name="kcfg_homePage"> <property name="enabled"> @@ -79,9 +70,47 @@ <item> <widget class="QGroupBox" name="groupBox_3"> <property name="title"> + <string>New Tabs Behaviour</string> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="0"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>New tabs open </string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="KComboBox" name="kcfg_newTabsBehaviour"> + <property name="enabled"> + <bool>true</bool> + </property> + <item> + <property name="text"> + <string>new tab page</string> + </property> + </item> + <item> + <property name="text"> + <string>blank page</string> + </property> + </item> + <item> + <property name="text"> + <string>home page</string> + </property> + </item> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_4"> + <property name="title"> <string>Tabbed Browsing</string> </property> - <layout class="QVBoxLayout" name="verticalLayout"> + <layout class="QVBoxLayout" name="verticalLayout_4"> <item> <widget class="QCheckBox" name="kcfg_openTabNoWindow"> <property name="text"> @@ -114,75 +143,6 @@ </widget> </item> <item> - <widget class="QGroupBox" name="groupBox_2"> - <property name="title"> - <string>General Settings</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QCheckBox" name="kcfg_showUrlsPopup"> - <property name="text"> - <string>Show URLs of links in a popup</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_4"> - <property name="title"> - <string>History</string> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> - <widget class="QLabel" name="label_4"> - <property name="text"> - <string>Remove history items:</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="KComboBox" name="kcfg_expireHistory"> - <item> - <property name="text"> - <string>After one day</string> - </property> - </item> - <item> - <property name="text"> - <string>After one week</string> - </property> - </item> - <item> - <property name="text"> - <string>After two weeks</string> - </property> - </item> - <item> - <property name="text"> - <string>After one month</string> - </property> - </item> - <item> - <property name="text"> - <string>After one year</string> - </property> - </item> - <item> - <property name="text"> - <string>Manually</string> - </property> - </item> - </widget> - </item> - </layout> - </widget> - </item> - <item> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -190,7 +150,7 @@ <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>40</height> + <height>43</height> </size> </property> </spacer> |