Bug 235106 - Add possibility to use Favourites as Home page
Summary: Add possibility to use Favourites as Home page
Status: RESOLVED FIXED
Alias: None
Product: rekonq
Classification: Unmaintained
Component: general (show other bugs)
Version: 0.4.0
Platform: Fedora RPMs Unspecified
: NOR wishlist
Target Milestone: ---
Assignee: Andrea Diamantini
URL:
Keywords:
: 237907 (view as bug list)
Depends on:
Blocks: 237890
  Show dependency treegraph
 
Reported: 2010-04-22 21:27 UTC by Sebastian Vahl
Modified: 2010-09-04 10:01 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Vahl 2010-04-22 21:27:49 UTC
Version:           0.4.0 (using KDE 4.4.2)
Installed from:    Fedora RPMs

It would be great if there would be a possibility to use the favourites page as the normal home page. I.e. the favourites tab also opens on the current tab when you click on the home icon (and not only on if you open a new tab).
Comment 1 Andrea Diamantini 2010-04-22 23:09:09 UTC
On Thursday 22 April 2010 21:27:50 Sebastian Vahl wrote:
> https://bugs.kde.org/show_bug.cgi?id=235106
> 
>            Summary: Add possibility to use Favourites as Home page
>            Product: rekonq
>            Version: 0.4.0
>           Platform: Fedora RPMs
>         OS/Version: unspecified
>             Status: NEW
>           Severity: wishlist
>           Priority: NOR
>          Component: general
>         AssignedTo: adjam7@gmail.com
>         ReportedBy: fedora@deadbabylon.de
> 
> 
> Version:           0.4.0 (using KDE 4.4.2)
> Installed from:    Fedora RPMs
> 
> It would be great if there would be a possibility to use the favourites
> page as the normal home page. I.e. the favourites tab also opens on the
> current tab when you click on the home icon (and not only on if you open a
> new tab).

Just use "about:favorites" or "about:home" as home page url :)
Comment 2 Panagiotis Papadopoulos 2010-04-23 17:16:25 UTC
do you think this is worth adding a new button to the settings, next to the "Set to Current Page" one?
Comment 3 Sebastian Vahl 2010-04-24 13:08:40 UTC
(In reply to comment #1)
> Just use "about:favorites" or "about:home" as home page url :)

Great thx. This would work for me, but I second Panagiotis Papadopoulos' proposal for adding a button for this (for the arbitrary user).
Comment 4 Panagiotis Papadopoulos 2010-05-17 13:30:21 UTC
*** Bug 237907 has been marked as a duplicate of this bug. ***
Comment 5 Andrea Diamantini 2010-05-18 02:06:46 UTC
commit 118dff93740d3f8e20dc57e2c2b92b9ad30bd58a
Author: Andrea Diamantini <adjam7@gmail.com>
Date:   Tue May 18 01:04:36 2010 +0200

    Add option to choose new tab page as home page
    
    BUG:235106

diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 083bb81..84d79c4 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 86e4753..fa4a236 100644
--- a/src/rekonq.kcfg
+++ b/src/rekonq.kcfg
@@ -60,6 +60,9 @@
     <entry name="homePage" type="String">
         <default>http://www.kde.org/</default>
     </entry>
+    <entry name="useNewTabPage" type="Bool">
+        <default>false</default>
+    </entry>
     <entry name="kgetDownload" type="Bool">
         <default>false</default>
     </entry>
diff --git a/src/settings/settings_general.ui b/src/settings/settings_general.ui
index ccc3fa2..f7771cb 100644
--- a/src/settings/settings_general.ui
+++ b/src/settings/settings_general.ui
@@ -79,7 +79,7 @@
       <string>Home Page</string>
      </property>
      <layout class="QFormLayout" name="formLayout_2">
-      <item row="0" column="0">
+      <item row="1" column="0">
        <widget class="QLabel" name="label_2">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@@ -101,7 +101,7 @@
         </property>
        </widget>
       </item>
-      <item row="0" column="1">
+      <item row="1" column="1">
        <widget class="KLineEdit" name="kcfg_homePage">
         <property name="enabled">
          <bool>true</bool>
@@ -114,7 +114,7 @@
         </property>
        </widget>
       </item>
-      <item row="1" column="1">
+      <item row="2" column="1">
        <layout class="QHBoxLayout" name="horizontalLayout_3">
         <item>
          <widget class="QPushButton" name="setHomeToCurrentPageButton">
@@ -138,6 +138,13 @@
         </item>
        </layout>
       </item>
+      <item row="0" column="1">
+       <widget class="QCheckBox" name="kcfg_useNewTabPage">
+        <property name="text">
+         <string>Use New Tab Page</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
diff --git a/src/settings/settingsdialog.cpp b/src/settings/settingsdialog.cpp
index d2d5c0d..3f701c5 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 25b2fe9..cade78e 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