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:
parent
7c95c78f26
commit
40f97c73ab
|
@ -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
|
||||
|
|
|
@ -69,6 +69,7 @@ private slots:
|
|||
|
||||
void addEngineFromAction();
|
||||
void pasteAndGo();
|
||||
void instantSearchChanged(bool);
|
||||
|
||||
private:
|
||||
void focusInEvent(QFocusEvent* e);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -40,6 +40,7 @@ public:
|
|||
|
||||
// SearchEngines
|
||||
bool showSearchSuggestions;
|
||||
bool searchOnEngineChange;
|
||||
|
||||
// Web-Browser-Settings
|
||||
int defaultZoom;
|
||||
|
|
Loading…
Reference in New Issue
Block a user