summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-02-25 10:15:14 -0800
committerGerald Combs <gerald@wireshark.org>2016-02-25 20:02:11 +0000
commit3955dae2d81ccc736a8bdbd2b8278610354cddc7 (patch)
treef2c2a6fdce47813e65549c62ef12990e4e99d181 /ui
parent703553aa6efb4e9c09cf1e2e8218e5e083e29997 (diff)
downloadwireshark-3955dae2d81ccc736a8bdbd2b8278610354cddc7.tar.gz
Qt: Emit textEdited from CaptureFilterEdit in more places.
We should emit textEdited whenever the user changes the text interactively. Do so when the user clicks the clear button or selects a recent filter. We might want to copy this to DisplayFilterEdit. Change-Id: Icf02fead52947fcef6e7e617b0c49bfc9e1aec65 Reviewed-on: https://code.wireshark.org/review/14144 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/capture_filter_edit.cpp13
-rw-r--r--ui/qt/capture_filter_edit.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/ui/qt/capture_filter_edit.cpp b/ui/qt/capture_filter_edit.cpp
index da63638aa8..7779ad6f5a 100644
--- a/ui/qt/capture_filter_edit.cpp
+++ b/ui/qt/capture_filter_edit.cpp
@@ -162,7 +162,7 @@ CaptureFilterEdit::CaptureFilterEdit(QWidget *parent, bool plain) :
" margin-left: 1px;"
"}"
);
- connect(clear_button_, SIGNAL(clicked()), this, SLOT(clear()));
+ connect(clear_button_, SIGNAL(clicked()), this, SLOT(clearFilter()));
}
connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(checkFilter(const QString&)));
@@ -207,6 +207,11 @@ CaptureFilterEdit::CaptureFilterEdit(QWidget *parent, bool plain) :
.arg(cbsz.width() + apsz.width() + frameWidth + 1)
);
+ QComboBox *cf_combo = qobject_cast<QComboBox *>(parent);
+ if (cf_combo) {
+ connect(cf_combo, SIGNAL(activated(QString)), this, SIGNAL(textEdited(QString)));
+ }
+
QThread *syntax_thread = new QThread;
syntax_worker_ = new CaptureFilterSyntaxWorker;
syntax_worker_->moveToThread(syntax_thread);
@@ -417,6 +422,12 @@ void CaptureFilterEdit::bookmarkClicked()
emit addBookmark(text());
}
+void CaptureFilterEdit::clearFilter()
+{
+ clear();
+ emit textEdited(text());
+}
+
void CaptureFilterEdit::buildCompletionList(const QString &primitive_word)
{
if (primitive_word.length() < 1) {
diff --git a/ui/qt/capture_filter_edit.h b/ui/qt/capture_filter_edit.h
index 8c53a1de90..bb9daf6232 100644
--- a/ui/qt/capture_filter_edit.h
+++ b/ui/qt/capture_filter_edit.h
@@ -55,6 +55,7 @@ private slots:
void checkFilter(const QString &filter);
void setFilterSyntaxState(QString filter, int state, QString err_msg);
void bookmarkClicked();
+ void clearFilter();
private:
bool plain_;