diff options
author | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-10-23 14:30:35 +0000 |
---|---|---|
committer | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-10-23 14:30:35 +0000 |
commit | 508d1b909d7487c6953c90a42b82a5a1d5e1fcbd (patch) | |
tree | 7aef630cfa210b758cd1bde8b842454d6300358e | |
parent | fc7d89fde654cf5ef251e7532e320a89ad4dd3a1 (diff) |
Only use the statusbar for filter messages from the main window.
Updating the statusbar from popup windows is confusing.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26523 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r-- | gtk/filter_dlg.c | 38 | ||||
-rw-r--r-- | gtk/filter_dlg.h | 4 | ||||
-rw-r--r-- | gtk/main_filter_toolbar.c | 1 |
3 files changed, 29 insertions, 14 deletions
diff --git a/gtk/filter_dlg.c b/gtk/filter_dlg.c index 608bb2ae0b..026aeb2081 100644 --- a/gtk/filter_dlg.c +++ b/gtk/filter_dlg.c @@ -1299,21 +1299,27 @@ filter_te_syntax_check_cb(GtkWidget *w) const gchar *strval; dfilter_t *dfp; GPtrArray *depr = NULL; + gboolean use_statusbar; gchar *msg; guchar c; - statusbar_pop_filter_msg(); - strval = gtk_entry_get_text(GTK_ENTRY(w)); + use_statusbar = g_object_get_data(G_OBJECT(w), E_FILT_FIELD_USE_STATUSBAR_KEY) ? TRUE : FALSE; + + if (use_statusbar) { + statusbar_pop_filter_msg(); + } /* colorize filter string entry */ if (g_object_get_data(G_OBJECT(w), E_FILT_FIELD_NAME_ONLY_KEY) && strval && (c = proto_check_field_name(strval)) != 0) { colorize_filter_te_as_invalid(w); - msg = g_strdup_printf(" Illegal character in field name: '%c'", c); - statusbar_push_filter_msg(msg); - g_free(msg); + if (use_statusbar) { + msg = g_strdup_printf(" Illegal character in field name: '%c'", c); + statusbar_push_filter_msg(msg); + g_free(msg); + } } else if (strval && dfilter_compile(strval, &dfp)) { if (dfp != NULL) { depr = dfilter_deprecated_tokens(dfp); @@ -1324,19 +1330,23 @@ filter_te_syntax_check_cb(GtkWidget *w) } else if (depr) { /* You keep using that word. I do not think it means what you think it means. */ colorize_filter_te_as_deprecated(w); - /* - * We're being lazy and only printing the first "problem" token. - * Would it be better to print all of them? - */ - msg = g_strdup_printf(" \"%s\" may have unexpected results (see the User's Guide)", - (const char *) g_ptr_array_index(depr, 0)); - statusbar_push_filter_msg(msg); - g_free(msg); + if (use_statusbar) { + /* + * We're being lazy and only printing the first "problem" token. + * Would it be better to print all of them? + */ + msg = g_strdup_printf(" \"%s\" may have unexpected results (see the User's Guide)", + (const char *) g_ptr_array_index(depr, 0)); + statusbar_push_filter_msg(msg); + g_free(msg); + } } else { colorize_filter_te_as_valid(w); } } else { colorize_filter_te_as_invalid(w); - statusbar_push_filter_msg(" Invalid filter"); + if (use_statusbar) { + statusbar_push_filter_msg(" Invalid filter"); + } } } diff --git a/gtk/filter_dlg.h b/gtk/filter_dlg.h index deb35f2f28..b7c5f0a13e 100644 --- a/gtk/filter_dlg.h +++ b/gtk/filter_dlg.h @@ -121,6 +121,10 @@ void filter_te_syntax_check_cb(GtkWidget *widget); */ #define E_FILT_FILTER_TE_KEY "filter_filter_te" +/** Only validate a singel field entry. */ #define E_FILT_FIELD_NAME_ONLY_KEY "filter_field_name_only" +/** Update statusbar when changing the filter entry. */ +#define E_FILT_FIELD_USE_STATUSBAR_KEY "filter_field_use_statusbar" + #endif /* filter_dlg.h */ diff --git a/gtk/main_filter_toolbar.c b/gtk/main_filter_toolbar.c index 255489a9a3..f033edca41 100644 --- a/gtk/main_filter_toolbar.c +++ b/gtk/main_filter_toolbar.c @@ -129,6 +129,7 @@ GtkWidget *filter_toolbar_new() g_signal_connect(filter_te, "activate", G_CALLBACK(filter_activate_cb), filter_te); g_signal_connect(filter_te, "changed", G_CALLBACK(filter_te_syntax_check_cb), NULL); g_object_set_data(G_OBJECT(filter_tb), E_FILT_AUTOCOMP_PTR_KEY, NULL); + g_object_set_data(G_OBJECT(filter_te), E_FILT_FIELD_USE_STATUSBAR_KEY, ""); g_signal_connect(filter_te, "key-press-event", G_CALLBACK (filter_string_te_key_pressed_cb), NULL); g_signal_connect(filter_tb, "key-press-event", G_CALLBACK (filter_parent_dlg_key_pressed_cb), NULL); gtk_widget_set_size_request(filter_cm, 400, -1); |