diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-01-05 11:27:27 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-01-05 11:27:27 +0100 |
commit | e27e780aaae17724c5967186c929779d72dcbd5a (patch) | |
tree | 066e5444a67e00ee6272679d0b5410807295e25b | |
parent | Main toolbar (right) name & (wrong) icon (diff) | |
download | rekonq-e27e780aaae17724c5967186c929779d72dcbd5a.tar.xz |
Choose new tab start page
:
-rw-r--r-- | src/application.cpp | 2 | ||||
-rw-r--r-- | src/protocolhandler.cpp | 30 | ||||
-rw-r--r-- | src/rekonq.kcfg | 3 | ||||
-rw-r--r-- | src/settings/settings_general.ui | 67 |
4 files changed, 94 insertions, 8 deletions
diff --git a/src/application.cpp b/src/application.cpp index 8b8234b5..15945b32 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -250,7 +250,7 @@ KIcon Application::icon(const KUrl &url) return KIcon("view-history"); if(url == KUrl("about:bookmarks")) return KIcon("bookmarks"); - if(url == KUrl("about:home") || url == KUrl("about:favorites")) + if(url == KUrl("about:favorites")) return KIcon("emblem-favorite"); } diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp index a40cc0f9..5b400582 100644 --- a/src/protocolhandler.cpp +++ b/src/protocolhandler.cpp @@ -26,6 +26,9 @@ // Self Includes #include "protocolhandler.h" +// Auto Includes +#include "rekonq.h" + // Local Includes #include "newtabpage.h" #include "application.h" @@ -76,6 +79,12 @@ bool ProtocolHandler::handle(const QNetworkRequest &request, QWebFrame *frame) _url = request.url(); _frame = frame; + kDebug() << "URL PROTOCOL: " << _url; + + // "http(s)" (fast) handling + if( _url.protocol() == QLatin1String("http") || _url.protocol() == QLatin1String("https") ) + return false; + // "mailto" handling if ( _url.protocol() == QLatin1String("mailto") ) { @@ -86,11 +95,30 @@ bool ProtocolHandler::handle(const QNetworkRequest &request, QWebFrame *frame) // "about" handling if ( _url.protocol() == QLatin1String("about") ) { + if( _url == KUrl("about:home") ) + { + switch(ReKonfig::newTabStartPage()) + { + case 0: // favorites + _url = KUrl("about:favorites"); + break; + case 1: // closed tabs + _url = KUrl("about:closedTabs"); + break; + case 2: // history + _url = KUrl("about:history"); + break; + case 3: // bookmarks + _url = KUrl("about:bookmarks"); + break; + default: // unuseful + break; + } + } if( _url == KUrl("about:closedTabs") || _url == KUrl("about:history") || _url == KUrl("about:bookmarks") || _url == KUrl("about:favorites") - || _url == KUrl("about:home") ) { NewTabPage p(frame); diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index 333870d1..f74fb144 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -29,6 +29,9 @@ <entry name="newTabsBehaviour" type="Int"> <default>0</default> </entry> + <entry name="newTabStartPage" type="Int"> + <default>0</default> + </entry> <entry name="homePage" type="String"> <default>http://www.kde.org/</default> </entry> diff --git a/src/settings/settings_general.ui b/src/settings/settings_general.ui index 9662ec3c..17ac0d0f 100644 --- a/src/settings/settings_general.ui +++ b/src/settings/settings_general.ui @@ -152,8 +152,8 @@ <property name="title"> <string>New Tabs Behaviour</string> </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="0"> <widget class="QLabel" name="label_4"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> @@ -178,7 +178,7 @@ </property> </widget> </item> - <item> + <item row="0" column="1"> <widget class="KComboBox" name="kcfg_newTabsBehaviour"> <property name="enabled"> <bool>true</bool> @@ -206,6 +206,64 @@ </item> </widget> </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_5"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>120</width> + <height>0</height> + </size> + </property> + <property name="baseSize"> + <size> + <width>120</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>New tab page starts with:</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="KComboBox" name="kcfg_newTabStartPage"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <item> + <property name="text"> + <string>favorites</string> + </property> + </item> + <item> + <property name="text"> + <string>closed tabs</string> + </property> + </item> + <item> + <property name="text"> + <string>history</string> + </property> + </item> + <item> + <property name="text"> + <string>bookmarks</string> + </property> + </item> + </widget> + </item> </layout> </widget> </item> @@ -237,9 +295,6 @@ <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> |