diff options
Diffstat (limited to 'konqueror/about')
-rw-r--r-- | konqueror/about/konq.css | 7 | ||||
-rw-r--r-- | konqueror/about/konq_aboutpage.cc | 54 | ||||
-rw-r--r-- | konqueror/about/launch.html | 18 |
3 files changed, 70 insertions, 9 deletions
diff --git a/konqueror/about/konq.css b/konqueror/about/konq.css index 735861d9e..db6983bc1 100644 --- a/konqueror/about/konq.css +++ b/konqueror/about/konq.css @@ -18,4 +18,11 @@ background-repeat: no-repeat; } +#searchbarlabel { + font-size: 10pt; + font-style: italic; +} +#searchbarinput { + width: 100%; +} diff --git a/konqueror/about/konq_aboutpage.cc b/konqueror/about/konq_aboutpage.cc index 03da9a060..8a5385697 100644 --- a/konqueror/about/konq_aboutpage.cc +++ b/konqueror/about/konq_aboutpage.cc @@ -11,6 +11,9 @@ #include <kstandarddirs.h> #include <kaction.h> #include <kiconloader.h> +#include <kurifilter.h> +#include <ktrader.h> +#include <kconfig.h> #include <assert.h> #include <qfile.h> @@ -85,8 +88,11 @@ QString KonqAboutPageFactory::loadFile( const QString& file ) QString KonqAboutPageFactory::launch() { + // FIXME: only regenerate launch page if kuriikwsfilterrc changed. + /* if ( s_launch_html ) return *s_launch_html; + */ QString res = loadFile( locate( "data", "konqueror/about/launch.html" )); if ( res.isEmpty() ) @@ -100,6 +106,7 @@ QString KonqAboutPageFactory::launch() QString wastebin_icon_path = iconloader->iconPath("trashcan_full", KIcon::Desktop ); QString applications_icon_path = iconloader->iconPath("kmenu", KIcon::Desktop ); QString settings_icon_path = iconloader->iconPath("kcontrol", KIcon::Desktop ); + QString help_icon_path = iconloader->iconPath("khelpcenter", KIcon::Desktop ); QString home_folder = QDir::homeDirPath(); QString continue_icon_path = QApplication::reverseLayout()?iconloader->iconPath("1leftarrow", KIcon::Small ):iconloader->iconPath("1rightarrow", KIcon::Small ); @@ -109,6 +116,26 @@ QString KonqAboutPageFactory::launch() else res = res.arg( "" ); + // Try to split page in three. If it succeeds, insert the default search into the middle part. + QStringList parts = QStringList::split( "<!--search bar splitter-->", res ); + if ( parts.count() == 3 ) { + KConfig config( "kuriikwsfilterrc", true /*read-only*/, false /*no KDE globals*/ ); + config.setGroup( "General" ); + QString name = config.readEntry("DefaultSearchEngine"); + KService::Ptr service = + KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(name)); + if ( service ) { + QString searchBar = parts[1]; + searchBar = searchBar + .arg( iconSize ).arg( iconSize ) + .arg( service->name() ) + .arg( service->property("Keys").toStringList()[0] ) + ; + res = parts[0] + searchBar + parts[2]; + } + else res = parts[0] + parts[2]; + } + res = res.arg( i18n("Conquer your Desktop!") ) .arg( i18n( "Konqueror" ) ) .arg( i18n("Conquer your Desktop!") ) @@ -139,10 +166,10 @@ QString KonqAboutPageFactory::launch() .arg(iconSize).arg(iconSize) .arg( i18n( "Applications" ) ) .arg( i18n( "Installed programs" ) ) - .arg( settings_icon_path ) + .arg( help_icon_path ) .arg(iconSize).arg(iconSize) - .arg( i18n( "Settings" ) ) - .arg( i18n( "Desktop configuration" ) ) + .arg( i18n( "About Kubuntu" ) ) + .arg( i18n( "<a href=\"help:/kubuntu/\">Kubuntu Documentation</a>" ) ) .arg( continue_icon_path ) .arg( KIcon::SizeSmall ).arg( KIcon::SizeSmall ) .arg( i18n( "Next: An Introduction to Konqueror" ) ) @@ -422,10 +449,23 @@ KonqAboutPage::~KonqAboutPage() bool KonqAboutPage::openURL( const KURL &u ) { - if (u.url() == "about:plugins") - serve( KonqAboutPageFactory::plugins(), "plugins" ); - else serve( KonqAboutPageFactory::launch(), "konqueror" ); - return true; + kdDebug(1202) << "now in KonqAboutPage::openURL( \"" << u.url() << "\" )" << endl; + if ( u.url() == "about:plugins" ) + serve( KonqAboutPageFactory::plugins(), "plugins" ); + else if ( !u.query().isEmpty() ) { + QMap< QString, QString > queryItems = u.queryItems( 0 ); + QMap< QString, QString >::ConstIterator query = queryItems.begin(); + QString newUrl; + if (query.key() == "strigi") { + newUrl = KURIFilter::self()->filteredURI( query.key() + ":?q=" + query.data() ); + } else { + newUrl = KURIFilter::self()->filteredURI( query.key() + ":" + query.data() ); + } + kdDebug(1202) << "scheduleRedirection( 0, \"" << newUrl << "\" )" << endl; + scheduleRedirection( 0, newUrl ); + } + else serve( KonqAboutPageFactory::launch(), "konqueror" ); + return true; } bool KonqAboutPage::openFile() diff --git a/konqueror/about/launch.html b/konqueror/about/launch.html index 80ad01eaa..9acc5d6a9 100644 --- a/konqueror/about/launch.html +++ b/konqueror/about/launch.html @@ -60,6 +60,20 @@ <div id="boxCenter"> <table border="0" align="center"> +<!--search bar argument replacement is performed between the "search bar splitter" lines--> +<!--search bar splitter--> + + <tr> + <form action="about:konqueror"> + <td colspan="2" style="text-align:right;"><label id="searchbarlabel" for="searchbarinput">%2: </label></td> + <td colspan="2"><input id="searchbarinput" name="%3" type="text"></td> + </form> + </tr> + <tr> + <td colspan="4"><div style="width:%1px; height:%1px;"/></td> + </tr> + +<!--search bar splitter--> <tr> <td valign="bottom"> <a href="%1"><img src="%1" height="%1" width="%1" /></a> @@ -96,10 +110,10 @@ <a href="applications:/">%1</a><br><span id="subtext"><nobr>%1</span> </td> <td> - <a href="settings:/"><img src="%1" height="%1" width="%1" /></a> + <a href="help:/kubuntu/about-kubuntu/index.html"><img src="%1" height="%1" width="%1" /></a> </td> <td valign="bottom"> - <a href="settings:/">%1</a><br><span id="subtext"><nobr>%1</span> + <a href="help:/kubuntu/about-kubuntu/index.html">%1</a><br><span id="subtext"><nobr>%1</span> </td> </tr> </table> |