aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/file_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-01-21 01:45:07 +0000
committerGuy Harris <guy@alum.mit.edu>2001-01-21 01:45:07 +0000
commitd6dd1fea0d4e1f6bed1b2334b9dd8639a52bb6eb (patch)
tree544ea9d4ef93c943bdfc4ea5356a9a7b8b510132 /gtk/file_dlg.c
parent873bc5898eedb9f395f8a87080117d8ed6c95891 (diff)
In the process of destroying a filter editing dialog box, we get a
selection change event on the list of filters. Unfortunately, this can happen after some other widgets in that dialog box have already been destroyed - including some of the widgets that such a selection change event can change. This sometimes happened when "filter_prefs_delete()" hadn't been called, so the mechanism we had been using, with a Boolean datum attached to the dialog box, set in "filter_prefs_delete()" before we actually destroy the dialog box, wasn't sufficient to keep that from happening. Attach to the top-level window data items containing pointers to the widgets changed when a filter is selected from the list, give each of those widgets their own destroy callbacks, clear the pointer attached to the top-level widget when the widget is destroyed, and don't do anything to the widget when a filter is selected from the list if the pointer for that widget is null, as that means the widget's been destroyed and we *can't* do anything to it. Not all filter editing dialogs created on behalf of a "Filter:" button next to a text entry box should, when you click "OK", activate the text entry box; if the text entry box is part of a dialog box with multiple widgets, the user might not have filled in all of the items in that dialog box, so you shouldn't activate it for them. Add a mechanism by which, when creating a filter editing dialog box, you can specify whether the "OK" button should just fill in the text entry box or should fill it in and also activate it. svn path=/trunk/; revision=2922
Diffstat (limited to 'gtk/file_dlg.c')
-rw-r--r--gtk/file_dlg.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c
index a8553704ca..516abe56c6 100644
--- a/gtk/file_dlg.c
+++ b/gtk/file_dlg.c
@@ -1,7 +1,7 @@
/* file_dlg.c
* Dialog boxes for handling files
*
- * $Id: file_dlg.c,v 1.33 2001/01/02 01:32:21 guy Exp $
+ * $Id: file_dlg.c,v 1.34 2001/01/21 01:45:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -67,9 +67,13 @@ static GtkWidget *file_open_w;
/* Open a file */
void
-file_open_cmd_cb(GtkWidget *w, gpointer data) {
+file_open_cmd_cb(GtkWidget *w, gpointer data)
+{
GtkWidget *filter_hbox, *filter_bt, *filter_te,
*resolv_cb;
+ /* No Apply button, and "OK" just sets our text widget, it doesn't
+ activate it (i.e., it doesn't cause us to try to open the file). */
+ static construct_args_t args = {FALSE, FALSE};
if (file_open_w != NULL) {
/* There's already an "Open Capture File" dialog box; reactivate it. */
@@ -112,7 +116,7 @@ file_open_cmd_cb(GtkWidget *w, gpointer data) {
filter_bt = gtk_button_new_with_label("Filter:");
gtk_signal_connect(GTK_OBJECT(filter_bt), "clicked",
- GTK_SIGNAL_FUNC(display_filter_construct_cb), NULL);
+ GTK_SIGNAL_FUNC(display_filter_construct_cb), &args);
gtk_box_pack_start(GTK_BOX(filter_hbox), filter_bt, FALSE, TRUE, 0);
gtk_widget_show(filter_bt);