mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-13 10:32:11 +01:00
Add option to disable instant search on ech searchengine change.
This commit is contained in:
parent
7c95c78f26
commit
40f97c73ab
|
@ -185,11 +185,21 @@ void WebSearchBar::searchChanged(const ButtonWithMenu::Item &item)
|
||||||
|
|
||||||
m_searchManager->setActiveEngine(m_activeEngine);
|
m_searchManager->setActiveEngine(m_activeEngine);
|
||||||
|
|
||||||
if (!m_reloadingEngines && !text().isEmpty()) {
|
if (qzSettings->searchOnEngineChange && !m_reloadingEngines && !text().isEmpty()) {
|
||||||
search();
|
search();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WebSearchBar::instantSearchChanged(bool enable)
|
||||||
|
{
|
||||||
|
|
||||||
|
Settings settings;
|
||||||
|
settings.beginGroup("SearchEngines");
|
||||||
|
settings.setValue("SearchOnEngineChange", enable);
|
||||||
|
settings.endGroup();
|
||||||
|
qzSettings->searchOnEngineChange = enable;
|
||||||
|
}
|
||||||
|
|
||||||
void WebSearchBar::search()
|
void WebSearchBar::search()
|
||||||
{
|
{
|
||||||
p_QupZilla->weView()->setFocus();
|
p_QupZilla->weView()->setFocus();
|
||||||
|
@ -302,6 +312,12 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event)
|
||||||
act->setChecked(qzSettings->showSearchSuggestions);
|
act->setChecked(qzSettings->showSearchSuggestions);
|
||||||
connect(act, SIGNAL(triggered(bool)), this, SLOT(enableSearchSuggestions(bool)));
|
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());
|
m_pasteAndGoAction->setEnabled(!QApplication::clipboard()->text().isEmpty());
|
||||||
|
|
||||||
//Prevent choosing first option with double rightclick
|
//Prevent choosing first option with double rightclick
|
||||||
|
|
|
@ -69,6 +69,7 @@ private slots:
|
||||||
|
|
||||||
void addEngineFromAction();
|
void addEngineFromAction();
|
||||||
void pasteAndGo();
|
void pasteAndGo();
|
||||||
|
void instantSearchChanged(bool);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void focusInEvent(QFocusEvent* e);
|
void focusInEvent(QFocusEvent* e);
|
||||||
|
|
|
@ -36,6 +36,7 @@ void QzSettings::loadSettings()
|
||||||
|
|
||||||
settings.beginGroup("SearchEngines");
|
settings.beginGroup("SearchEngines");
|
||||||
showSearchSuggestions = settings.value("showSuggestions", true).toBool();
|
showSearchSuggestions = settings.value("showSuggestions", true).toBool();
|
||||||
|
searchOnEngineChange = settings.value("SearchOnEngineChange", true).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup("Web-Browser-Settings");
|
||||||
|
|
|
@ -40,6 +40,7 @@ public:
|
||||||
|
|
||||||
// SearchEngines
|
// SearchEngines
|
||||||
bool showSearchSuggestions;
|
bool showSearchSuggestions;
|
||||||
|
bool searchOnEngineChange;
|
||||||
|
|
||||||
// Web-Browser-Settings
|
// Web-Browser-Settings
|
||||||
int defaultZoom;
|
int defaultZoom;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user