ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Eliminate annoying color filter dialog

From: Gerald Combs <gerald@xxxxxxxxxxxxx>
Date: Tue, 08 Mar 2011 13:30:04 -0800
On 3/8/11 12:19 PM, Jeff Morriss wrote:
> Chris Maynard wrote:
>> I regularly switch between a custom build of Wireshark for analyzing my
>> company's protocols and the trunk when doing general Wireshark
>> development/testing.  Unfortunately, I have lots of custom color
>> filters in
>> place that are invalid for the trunk for obvious reasons.  But every
>> time I
>> switch to the trunk, for every custom color filter I have, I get an
>> annoying
>> dialog telling me, "Could not compile color filter "blah" from saved
>> filters." I've made a change in my local sandbox to avoid this, but
>> would anyone have any
>> grumblings if I permanently eliminate that dialog?  Here's all I do to
>> get rid
>> of it:
> 
> I don't mind.
> 
> What about spewing a warning to stdout like we do when we find a
> preference we don't know/understand?  (Just so there's _some_ log of the
> "failure".)

How about using statusbar_push_temporary_msg (patch attached)?
statusbar_push_temporary_msg shows a message for a few seconds in the
status bar. It doesn't print to stdout, but it probably should.

I think we use simple_dialog in many places where a transient (or at
least less invasive) message would work better. Maybe we should add
support for Growl?

-- 
Join us for Sharkfest ’11! · Wireshark® Developer and User Conference
Stanford University, June 13-16 · http://sharkfest.wireshark.org
Index: color_filters.c
===================================================================
--- color_filters.c	(revision 36166)
+++ color_filters.c	(working copy)
@@ -44,6 +44,7 @@
 #include "file.h"
 #include <epan/dfilter/dfilter.h>
 #include "simple_dialog.h"
+#include "main_statusbar.h"
 #include "ui_util.h"
 #include <epan/prefs.h>
 
@@ -573,9 +574,9 @@
 			dfilter_t *temp_dfilter;
 
 			if (!dfilter_compile(filter_exp, &temp_dfilter)) {
-				simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-				"Could not compile color filter %s from saved filters.\n%s",
-					      name, dfilter_error_msg);
+				statusbar_push_temporary_msg("Could not compile color filter "
+							     "%s from saved filters. %s",
+							     name, dfilter_error_msg);
 				skip_end_of_line = TRUE;
 				continue;
 			}