forked from osmocom/wireshark
Use the modal version of the bad display filter alert box in the I/O
statistics window. Get rid of the non-modal version (it's not being used any more), and remove the now-redundant _modal from the modal version. svn path=/trunk/; revision=43081
This commit is contained in:
parent
91b777712a
commit
00de07144d
|
@ -112,23 +112,3 @@ write_failure_alert_box(const char *filename, int err)
|
||||||
file_write_error_message(err), filename);
|
file_write_error_message(err), filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Alert box for an invalid display filter expression.
|
|
||||||
* Assumes "dfilter_error_msg" has been set by "dfilter_compile()" to the
|
|
||||||
* error message for the filter.
|
|
||||||
*
|
|
||||||
* XXX - should this have a "Help" button that pops up the display filter
|
|
||||||
* help?
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
bad_dfilter_alert_box(const char *dftext)
|
|
||||||
{
|
|
||||||
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
|
|
||||||
"%s%s%s\n"
|
|
||||||
"\n"
|
|
||||||
"The filter expression \"%s\" isn't a valid display filter.\n"
|
|
||||||
"See the help for a description of the display filter syntax.",
|
|
||||||
simple_dialog_primary_start(), dfilter_error_msg,
|
|
||||||
simple_dialog_primary_end(), dftext);
|
|
||||||
}
|
|
||||||
|
|
|
@ -56,13 +56,6 @@ extern void read_failure_alert_box(const char *filename, int err);
|
||||||
*/
|
*/
|
||||||
extern void write_failure_alert_box(const char *filename, int err);
|
extern void write_failure_alert_box(const char *filename, int err);
|
||||||
|
|
||||||
/*
|
|
||||||
* Alert box for an invalid display filter expression.
|
|
||||||
* Assumes "dfilter_error_msg" has been set by "dfilter_compile()" to the
|
|
||||||
* error message for the filter.
|
|
||||||
*/
|
|
||||||
extern void bad_dfilter_alert_box(const char *dftext);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
|
@ -562,7 +562,7 @@ file_open_cmd(GtkWidget *w)
|
||||||
if (!dfilter_compile(rfilter, &rfcode)) {
|
if (!dfilter_compile(rfilter, &rfcode)) {
|
||||||
/* Not valid. Tell the user, and go back and run the file
|
/* Not valid. Tell the user, and go back and run the file
|
||||||
selection box again once they dismiss the alert. */
|
selection box again once they dismiss the alert. */
|
||||||
bad_dfilter_alert_box_modal(file_open_w, rfilter);
|
bad_dfilter_alert_box(file_open_w, rfilter);
|
||||||
g_free(cf_name);
|
g_free(cf_name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -815,7 +815,7 @@ file_merge_cmd(GtkWidget *w)
|
||||||
if (!dfilter_compile(rfilter, &rfcode)) {
|
if (!dfilter_compile(rfilter, &rfcode)) {
|
||||||
/* Not valid. Tell the user, and go back and run the file
|
/* Not valid. Tell the user, and go back and run the file
|
||||||
selection box again once they dismiss the alert. */
|
selection box again once they dismiss the alert. */
|
||||||
bad_dfilter_alert_box_modal(file_merge_w, rfilter);
|
bad_dfilter_alert_box(file_merge_w, rfilter);
|
||||||
g_free(cf_name);
|
g_free(cf_name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -629,7 +629,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w)
|
||||||
*/
|
*/
|
||||||
if (!dfilter_compile(filter_text, &sfcode)) {
|
if (!dfilter_compile(filter_text, &sfcode)) {
|
||||||
/* The attempt failed; report an error. */
|
/* The attempt failed; report an error. */
|
||||||
bad_dfilter_alert_box_modal(GTK_WIDGET(parent_w), filter_text);
|
bad_dfilter_alert_box(GTK_WIDGET(parent_w), filter_text);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -587,7 +587,7 @@ GtkWidget *pixbuf_to_widget(const char * pb_data) {
|
||||||
* help?
|
* help?
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
bad_dfilter_alert_box_modal(GtkWidget *parent, const char *dftext)
|
bad_dfilter_alert_box(GtkWidget *parent, const char *dftext)
|
||||||
{
|
{
|
||||||
GtkWidget *msg_dialog;
|
GtkWidget *msg_dialog;
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ extern void reactivate_window(GtkWidget *win);
|
||||||
* @param parent parent window from which the display filter came
|
* @param parent parent window from which the display filter came
|
||||||
* @param dftext text of the display filter
|
* @param dftext text of the display filter
|
||||||
*/
|
*/
|
||||||
extern void bad_dfilter_alert_box_modal(GtkWidget *parent, const char *dftext);
|
extern void bad_dfilter_alert_box(GtkWidget *parent, const char *dftext);
|
||||||
|
|
||||||
/** Create a GtkScrolledWindow, set its scrollbar placement appropriately,
|
/** Create a GtkScrolledWindow, set its scrollbar placement appropriately,
|
||||||
* and remember it.
|
* and remember it.
|
||||||
|
|
|
@ -1989,7 +1989,7 @@ create_ctrl_area(io_stat_t *io, GtkWidget *box)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
filter_callback(GtkWidget *widget _U_, gpointer user_data)
|
filter_callback(GtkWidget *widget, gpointer user_data)
|
||||||
{
|
{
|
||||||
io_stat_graph_t *gio = user_data;
|
io_stat_graph_t *gio = user_data;
|
||||||
const char *filter;
|
const char *filter;
|
||||||
|
@ -2100,7 +2100,8 @@ filter_callback(GtkWidget *widget _U_, gpointer user_data)
|
||||||
/* first check if the filter string is valid. */
|
/* first check if the filter string is valid. */
|
||||||
filter=gtk_entry_get_text(GTK_ENTRY(gio->filter_field));
|
filter=gtk_entry_get_text(GTK_ENTRY(gio->filter_field));
|
||||||
if(!dfilter_compile(filter, &dfilter)) {
|
if(!dfilter_compile(filter, &dfilter)) {
|
||||||
bad_dfilter_alert_box(filter);
|
bad_dfilter_alert_box(gtk_widget_get_toplevel(widget),
|
||||||
|
filter);
|
||||||
disable_graph(gio);
|
disable_graph(gio);
|
||||||
io_stat_redraw(gio->io);
|
io_stat_redraw(gio->io);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -2956,7 +2956,7 @@ main(int argc, char *argv[])
|
||||||
check_and_warn_user_startup(cf_name);
|
check_and_warn_user_startup(cf_name);
|
||||||
if (rfilter != NULL) {
|
if (rfilter != NULL) {
|
||||||
if (!dfilter_compile(rfilter, &rfcode)) {
|
if (!dfilter_compile(rfilter, &rfcode)) {
|
||||||
bad_dfilter_alert_box_modal(top_level, rfilter);
|
bad_dfilter_alert_box(top_level, rfilter);
|
||||||
rfilter_parse_failed = TRUE;
|
rfilter_parse_failed = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2992,7 +2992,7 @@ main(int argc, char *argv[])
|
||||||
} else if (jfilter != NULL) {
|
} else if (jfilter != NULL) {
|
||||||
/* try to compile given filter */
|
/* try to compile given filter */
|
||||||
if (!dfilter_compile(jfilter, &jump_to_filter)) {
|
if (!dfilter_compile(jfilter, &jump_to_filter)) {
|
||||||
bad_dfilter_alert_box_modal(top_level, jfilter);
|
bad_dfilter_alert_box(top_level, jfilter);
|
||||||
} else {
|
} else {
|
||||||
/* Filter ok, jump to the first packet matching the filter
|
/* Filter ok, jump to the first packet matching the filter
|
||||||
conditions. Default search direction is forward, but if
|
conditions. Default search direction is forward, but if
|
||||||
|
|
Loading…
Reference in New Issue