diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-12-21 21:59:23 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-12-21 21:59:23 +0100 |
commit | 925725bfcf0f3ffba5107949bc8424e1fd6d1902 (patch) | |
tree | ee10e2c10e3ec63b0977661cfbc0ef69ad98002a /src/urlbar/urlbar.cpp | |
parent | Adding a tab list menu entry showing all open tabs. (diff) | |
download | rekonq-925725bfcf0f3ffba5107949bc8424e1fd6d1902.tar.xz |
Icon at the right of the urlbar that allows to add an opensearch engine
introduce search icon
description file downloaded after validation, not before
icons updated when engine added
add opensearch xml description files
sync desktop file => fix add webshortcut
use db_opensearch.json file to track opensearch engines
create an opensearch description only when the engine support suggestions
remove opensearch description when an engine is deleted in the webshortcut setting dialog
popup: disable ok button when webshortcut is already used
Lionel Chauvin is the man having done this big, big, big work!!
I'm just merging ;)
Diffstat (limited to 'src/urlbar/urlbar.cpp')
-rw-r--r-- | src/urlbar/urlbar.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index d93aeb75..f963be07 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -110,7 +110,10 @@ UrlBar::UrlBar(QWidget *parent) connect(_tab->view(), SIGNAL(iconChanged()), this, SLOT(refreshFavicon())); // bookmark icon - connect(Application::bookmarkProvider()->bookmarkManager(), SIGNAL(changed(const QString &, const QString &)), this, SLOT(onBookmarksChanged())); + connect(Application::bookmarkProvider()->bookmarkManager(), SIGNAL(changed(const QString &, const QString &)), this, SLOT(updateRightIcons())); + + // search icon + connect(Application::opensearchManager(), SIGNAL(openSearchEngineAdded(const QString &, const QString &, const QString &)), this, SLOT(updateRightIcons())); _suggestionTimer->setSingleShot(true); connect(_suggestionTimer, SIGNAL(timeout()), this, SLOT(suggest())); @@ -335,6 +338,13 @@ void UrlBar::loadFinished() connect(bt, SIGNAL(clicked(QPoint)), _tab->page(), SLOT(showSSLInfo(QPoint))); } + // show add search engine + if (_tab->hasNewSearchEngine()) + { + IconButton *bt = addRightIcon(UrlBar::SearchEngine); + connect(bt, SIGNAL(clicked(QPoint)), _tab, SLOT(showSearchEngine(QPoint))); + } + // we need to update urlbar after the right icon settings // removing this code (where setStyleSheet automatically calls update) needs adding again // an update call @@ -367,7 +377,7 @@ void UrlBar::showBookmarkInfo(const QPoint &pos) } -void UrlBar::onBookmarksChanged() +void UrlBar::updateRightIcons() { if (!_tab->isPageLoading()) { @@ -442,6 +452,10 @@ IconButton *UrlBar::addRightIcon(UrlBar::icon ic) rightIcon->setToolTip(i18n("Edit this bookmark")); } break; + case UrlBar::SearchEngine: + rightIcon->setIcon(KIcon("preferences-web-browser-shortcuts")); + rightIcon->setToolTip(i18n("Add search engine")); + break; default: kDebug() << "ERROR.. default non extant case!!"; break; |