aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-05-11 15:21:38 -0700
committerGerald Combs <gerald@wireshark.org>2015-05-11 22:23:56 +0000
commit1daf6e9e7badfa6d96259ae1aaffd956966077ca (patch)
tree448e82c99359c6c014b80df48d1db31c7dd4840e /ui
parent8045cd648140cf56ef8b9c02f1015b8807082333 (diff)
Qt: Provide a hint about the current display filter field.
If the field under the DisplayFilterEdit cursor is valid, push its description. In the main window this shows up in the status bar. Change-Id: I7ba1255694941c64aa8cce896283a426b9a69f2c Reviewed-on: https://code.wireshark.org/review/8413 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/display_filter_edit.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/qt/display_filter_edit.cpp b/ui/qt/display_filter_edit.cpp
index 67c5e3f11d..5742ad9dba 100644
--- a/ui/qt/display_filter_edit.cpp
+++ b/ui/qt/display_filter_edit.cpp
@@ -406,6 +406,19 @@ void DisplayFilterEdit::checkFilter(const QString& text)
// ui/gtk/filter_autocomplete.c:build_autocompletion_list
void DisplayFilterEdit::buildCompletionList(const QString &field_word)
{
+ // Push a hint about the current field.
+ if (syntaxState() == Valid) {
+ emit popFilterSyntaxStatus();
+
+ header_field_info *hfinfo = proto_registrar_get_byname(field_word.toUtf8().constData());
+ if (hfinfo) {
+ QString cursor_field_msg = QString("%1: %2")
+ .arg(hfinfo->name)
+ .arg(ftype_pretty_name(hfinfo->type));
+ emit pushFilterSyntaxStatus(cursor_field_msg);
+ }
+ }
+
// Grab any matching display filters from our parent combo.
QStringList recent_list;
QComboBox *df_combo = qobject_cast<QComboBox *>(parent());