diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-01-15 05:20:19 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-01-15 05:20:19 +0000 |
commit | a2f01014c141592a9d0c662fea616a0fe7c981df (patch) | |
tree | b06c7bbfd2d29e74953f94af9465aa9172a038be /gtk/io_stat.c | |
parent | cdbf86b42accb6116a70818f3c6cea1ace040852 (diff) |
Add a new routine "filter_button_destroy_cb()", and make it the
"destroy" signal handler for any button that pops up a filter; if the
button has a filter dialog box associated with it, it destroys that
dialog box.
Have the routines that create filter dialog boxes asociate the dialog
box with the button that created it, so that if the button is destroyed
the filter dialog box can be destroyed as well, and associate the button
with the dialog box.
This means that if a dialog box has a button to create a filter, we no
longer have to have the destroy handler for the dialog box destroy any
filters - that'll happen when the button in the dialog box is destroyed
as part of the process of destroying the dialog box.
Don't make the "Filter" buttons in the io_stat dialog box insensitive if
there's already a filter dialog box open - we can have more than one
open per dialog box.
svn path=/trunk/; revision=6930
Diffstat (limited to 'gtk/io_stat.c')
-rw-r--r-- | gtk/io_stat.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/gtk/io_stat.c b/gtk/io_stat.c index b5019f7649..86ddd67826 100644 --- a/gtk/io_stat.c +++ b/gtk/io_stat.c @@ -1,7 +1,7 @@ /* io_stat.c * io_stat 2002 Ronnie Sahlberg * - * $Id: io_stat.c,v 1.14 2003/01/11 11:10:33 sahlberg Exp $ + * $Id: io_stat.c,v 1.15 2003/01/15 05:20:19 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1491,34 +1491,13 @@ create_advanced_box(io_stat_graph_t *gio, GtkWidget *box) } -gint delete_filter_event(GtkWidget *widget _U_, io_stat_graph_t *gio) -{ - int i; - - for(i=0;i<MAX_GRAPHS;i++){ - if (GTK_WIDGET_STATE (gio->io->graphs[i].filter_bt) - == GTK_STATE_INSENSITIVE) { - gtk_widget_set_sensitive (gio->io->graphs[i].filter_bt,1); - } - } - return(FALSE); -} - - static void filter_button_clicked(GtkWidget *w, gpointer uio) { int i; io_stat_graph_t *gio=(io_stat_graph_t *)uio; - for(i=0;i<MAX_GRAPHS;i++){ - if( gio->io->graphs[i].filter_bt != w ){ - gtk_widget_set_sensitive(gio->io->graphs[i].filter_bt,0); - } - } gio->filter_main_win=display_filter_construct_cb(w, gio->args); - SIGNAL_CONNECT(gio->filter_main_win, "delete_event", delete_filter_event, gio); - SIGNAL_CONNECT(gio->filter_main_win, "destroy", delete_filter_event, gio); return; } @@ -1596,6 +1575,7 @@ create_filter_box(io_stat_graph_t *gio, GtkWidget *box, int num) gio->args->title=strdup(str); SIGNAL_CONNECT(gio->filter_bt, "clicked", filter_button_clicked, gio); + SIGNAL_CONNECT(gio->filter_bt, "destroy", filter_button_destroy_cb, NULL); gtk_box_pack_start(GTK_BOX(hbox), gio->filter_bt, FALSE, TRUE, 0); gtk_widget_show(gio->filter_bt); |