diff options
author | Marco Bubke <marco.bubke@qt.io> | 2017-07-18 17:33:14 +0200 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2017-07-20 11:16:12 +0000 |
commit | 578de25d9679d372f4f78ac9373d31e2462bc57b (patch) | |
tree | fc3b7657544ea86a2b5300f5abafedb489f8ce97 /src/plugins/coreplugin/find | |
parent | e9aaeb22f89e3d72785a6550e89ada3307cad385 (diff) | |
download | qt-creator-578de25d9679d372f4f78ac9373d31e2462bc57b.tar.gz |
Core: Overload the search button activation
The search button was enabled if there was some text in the search term
line edit. If the search term line edit is not used than we need a
different mechanism to enable the search button.
Change-Id: I5b168447c125199920e82d7990dbdd1a85dff1d7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/find')
-rw-r--r-- | src/plugins/coreplugin/find/findtoolwindow.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/coreplugin/find/findtoolwindow.cpp b/src/plugins/coreplugin/find/findtoolwindow.cpp index ffcf385525..8647b7b2e9 100644 --- a/src/plugins/coreplugin/find/findtoolwindow.cpp +++ b/src/plugins/coreplugin/find/findtoolwindow.cpp @@ -140,7 +140,8 @@ bool FindToolWindow::eventFilter(QObject *obj, QEvent *event) void FindToolWindow::updateButtonStates() { bool filterEnabled = m_currentFilter && m_currentFilter->isEnabled(); - bool enabled = m_ui.searchTerm->isValid() && filterEnabled && m_currentFilter->isValid(); + bool enabled = filterEnabled && (!m_currentFilter->showSearchTermInput() + || m_ui.searchTerm->isValid()) && m_currentFilter->isValid(); m_ui.searchButton->setEnabled(enabled); m_ui.replaceButton->setEnabled(m_currentFilter && m_currentFilter->isReplaceSupported() && enabled); @@ -268,12 +269,12 @@ void FindToolWindow::acceptAndGetParameters(QString *term, IFindFilter **filter) Find::updateFindCompletion(m_ui.searchTerm->text()); int index = m_ui.filterList->currentIndex(); QString searchTerm = m_ui.searchTerm->text(); + if (filter && index >= 0) + *filter = m_filters.at(index); if (term) *term = searchTerm; - if (searchTerm.isEmpty() || index < 0) - return; - if (filter) - *filter = m_filters.at(index); + if (searchTerm.isEmpty() && *filter && !(*filter)->isValid()) + *filter = 0; } void FindToolWindow::search() |