summaryrefslogtreecommitdiff
path: root/epan/filter_expressions.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-06-25 11:48:46 -0400
committerMichael Mann <mmann78@netscape.net>2017-06-26 02:48:58 +0000
commit5c60b517a70cab8138312ec39946f18f3ed75f58 (patch)
treeed0882fa1aca052246d207b3dcc81b9c5839f7aa /epan/filter_expressions.c
parent1b7f5d9f798634770656a82aaa2df30f7f01a9b0 (diff)
downloadwireshark-5c60b517a70cab8138312ec39946f18f3ed75f58.tar.gz
Add support for comments for a display filter button
Add a field to the display filter button UAT to allow comments to be displayed as part of the tooltip to the diplay filter button Bug: 13814 Change-Id: I74459e4102856258d31d6429e2fd924a9f798cd5 Reviewed-on: https://code.wireshark.org/review/22390 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/filter_expressions.c')
-rw-r--r--epan/filter_expressions.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/filter_expressions.c b/epan/filter_expressions.c
index 048bad65bd..ae69c15989 100644
--- a/epan/filter_expressions.c
+++ b/epan/filter_expressions.c
@@ -39,6 +39,7 @@ static guint num_display_filter_macros = 0;
UAT_BOOL_CB_DEF(display_filter_macro_uat, enabled, filter_expression_t)
UAT_CSTRING_CB_DEF(display_filter_macro_uat, label, filter_expression_t)
UAT_DISPLAY_FILTER_CB_DEF(display_filter_macro_uat, expression, filter_expression_t)
+UAT_CSTRING_CB_DEF(display_filter_macro_uat, comment, filter_expression_t)
/*
* Create a new filter_expression and add it to the end of the list
@@ -46,7 +47,7 @@ UAT_DISPLAY_FILTER_CB_DEF(display_filter_macro_uat, expression, filter_expressio
*/
filter_expression_t*
filter_expression_new(const gchar *label, const gchar *expr,
- const gboolean enabled)
+ const gchar *comment, const gboolean enabled)
{
filter_expression_t expression;
@@ -54,6 +55,7 @@ filter_expression_new(const gchar *label, const gchar *expr,
memset(&expression, 0, sizeof(expression));
expression.label = g_strdup(label);
expression.expression = g_strdup(expr);
+ expression.comment = g_strdup(comment);
expression.enabled = enabled;
/* XXX - This is just returned to make GTK GUI work. */
@@ -75,6 +77,7 @@ static void display_filter_free_cb(void*r) {
g_free(rec->label);
g_free(rec->expression);
+ g_free(rec->comment);
}
static void* display_filter_copy_cb(void* n, const void* o, size_t siz _U_) {
@@ -84,6 +87,7 @@ static void* display_filter_copy_cb(void* n, const void* o, size_t siz _U_) {
new_record->button = old_record->button;
new_record->label = g_strdup(old_record->label);
new_record->expression = g_strdup(old_record->expression);
+ new_record->comment = g_strdup(old_record->comment);
new_record->enabled = old_record->enabled;
@@ -97,6 +101,8 @@ static uat_field_t display_filter_uat_flds[] = {
"Name of the display filter button"),
UAT_FLD_DISPLAY_FILTER(display_filter_macro_uat, expression, "Filter Expression",
"Filter expression to be applied by the button"),
+ UAT_FLD_CSTRING(display_filter_macro_uat, comment, "Comment",
+ "Comment describing filter expression"),
UAT_END_FIELDS
};