Commit ab6cfe68 authored by Robert Knight's avatar Robert Knight

Make the 'Highlight Matches' button on the search bar work.

svn path=/branches/work/konsole-split-view/; revision=658418
parent 18dfdfbe
......@@ -279,7 +279,8 @@ void SessionController::setSearchBar(IncrementalSearchBar* searchBar)
connect( _searchBar , SIGNAL(closeClicked()) , this , SLOT(searchClosed()) );
connect( _searchBar , SIGNAL(findNextClicked()) , this , SLOT(findNextInHistory()) );
connect( _searchBar , SIGNAL(findPreviousClicked()) , this , SLOT(findPreviousInHistory()) );
connect( _searchBar , SIGNAL(highlightMatchesToggled(bool)) , this , SLOT(highlightMatches(bool)) );
// if the search bar was previously active
// then re-enter search mode
searchHistory( _searchToggleAction->isChecked() );
......@@ -588,7 +589,6 @@ void SessionController::beginSearch(const QString& text , int direction)
}
_searchFilter->setRegExp(regExp);
_view->processFilters();
// color search bar to indicate whether a match was found
......@@ -603,6 +603,20 @@ void SessionController::beginSearch(const QString& text , int direction)
// TODO - Optimise by only updating affected regions
_view->update();
}
void SessionController::highlightMatches(bool highlight)
{
if ( highlight )
{
_view->filterChain()->addFilter(_searchFilter);
_view->processFilters();
}
else
{
_view->filterChain()->removeFilter(_searchFilter);
}
_view->update();
}
void SessionController::findNextInHistory()
{
beginSearch(_searchBar->searchText(),SearchHistoryTask::Forwards);
......
......@@ -132,6 +132,7 @@ private slots:
void renameSession();
void saveSession();
// other
void showDisplayContextMenu(TerminalDisplay* display , int state , int x , int y);
void sessionStateChanged(Session* session,int state);
......@@ -145,6 +146,7 @@ private slots:
// foreground process in the terminal
void requireUrlFilterUpdate();
void highlightMatches(bool highlight);
// debugging slots
void debugProcess();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment