From 13a4fb3fdca30bce5cd7d76f7a7c56e55ff7be1a Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 28 Mar 2015 13:05:18 +0100 Subject: [PATCH] make return key press in search input trigger a new search --- apps/opencs/view/tools/searchbox.cpp | 7 +++++-- apps/opencs/view/tools/searchbox.hpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/opencs/view/tools/searchbox.cpp b/apps/opencs/view/tools/searchbox.cpp index bfae6f50d..178dd1f04 100644 --- a/apps/opencs/view/tools/searchbox.cpp +++ b/apps/opencs/view/tools/searchbox.cpp @@ -74,7 +74,9 @@ CSVTools::SearchBox::SearchBox (QWidget *parent) this, SLOT (textChanged (const QString&))); connect (&mSearch, SIGNAL (clicked (bool)), this, SLOT (startSearch (bool))); - + + connect (&mText, SIGNAL (returnPressed()), this, SLOT (startSearch())); + modeSelected (0); updateSearchButton(); @@ -141,5 +143,6 @@ void CSVTools::SearchBox::textChanged (const QString& text) void CSVTools::SearchBox::startSearch (bool checked) { - emit startSearch (getSearch()); + if (mSearch.isEnabled()) + emit startSearch (getSearch()); } diff --git a/apps/opencs/view/tools/searchbox.hpp b/apps/opencs/view/tools/searchbox.hpp index dc975cac9..35c656d16 100644 --- a/apps/opencs/view/tools/searchbox.hpp +++ b/apps/opencs/view/tools/searchbox.hpp @@ -46,7 +46,7 @@ namespace CSVTools void textChanged (const QString& text); - void startSearch (bool checked); + void startSearch (bool checked = true); signals: