1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Add option to disable instant search on ech searchengine change.

This commit is contained in:
Franz Fellner 2012-09-26 15:06:05 +02:00
parent 7c95c78f26
commit 40f97c73ab
4 changed files with 20 additions and 1 deletions

View File

@ -185,11 +185,21 @@ void WebSearchBar::searchChanged(const ButtonWithMenu::Item &item)
m_searchManager->setActiveEngine(m_activeEngine);
if (!m_reloadingEngines && !text().isEmpty()) {
if (qzSettings->searchOnEngineChange && !m_reloadingEngines && !text().isEmpty()) {
search();
}
}
void WebSearchBar::instantSearchChanged(bool enable)
{
Settings settings;
settings.beginGroup("SearchEngines");
settings.setValue("SearchOnEngineChange", enable);
settings.endGroup();
qzSettings->searchOnEngineChange = enable;
}
void WebSearchBar::search()
{
p_QupZilla->weView()->setFocus();
@ -302,6 +312,12 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event)
act->setChecked(qzSettings->showSearchSuggestions);
connect(act, SIGNAL(triggered(bool)), this, SLOT(enableSearchSuggestions(bool)));
QAction *instantSearch = m_menu->addAction(tr("Search when engine changed"));
instantSearch->setToolTip(tr("If checked an instant search is triggered when the search engine is changed"));
instantSearch->setCheckable(true);
instantSearch->setChecked(qzSettings->searchOnEngineChange);
connect(instantSearch, SIGNAL(triggered(bool)), this, SLOT(instantSearchChanged(bool)));
m_pasteAndGoAction->setEnabled(!QApplication::clipboard()->text().isEmpty());
//Prevent choosing first option with double rightclick

View File

@ -69,6 +69,7 @@ private slots:
void addEngineFromAction();
void pasteAndGo();
void instantSearchChanged(bool);
private:
void focusInEvent(QFocusEvent* e);

View File

@ -36,6 +36,7 @@ void QzSettings::loadSettings()
settings.beginGroup("SearchEngines");
showSearchSuggestions = settings.value("showSuggestions", true).toBool();
searchOnEngineChange = settings.value("SearchOnEngineChange", true).toBool();
settings.endGroup();
settings.beginGroup("Web-Browser-Settings");

View File

@ -40,6 +40,7 @@ public:
// SearchEngines
bool showSearchSuggestions;
bool searchOnEngineChange;
// Web-Browser-Settings
int defaultZoom;