summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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_;