aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-05-08 07:13:40 +0000
committerGuy Harris <guy@alum.mit.edu>2000-05-08 07:13:40 +0000
commit9bb3a841e326d69d6423bfa405934c5302cb4c82 (patch)
tree163427f5cecffc9f5faaac04dbbb46eaf3e764a2
parentbe87df37bf414faae679911fab48351be8c9d057 (diff)
Catch the ESC key in the file selection dialog boxes popped up for
"File->Open", "File->Save As", and the "File:" buttons in the Capture Preferences and Print dialog boxes, and make it cancel the file selection dialog box. svn path=/trunk/; revision=1921
-rw-r--r--gtk/capture_dlg.c7
-rw-r--r--gtk/file_dlg.c13
-rw-r--r--gtk/print_dlg.c7
3 files changed, 24 insertions, 3 deletions
diff --git a/gtk/capture_dlg.c b/gtk/capture_dlg.c
index b172c57c32..0fc3094bc6 100644
--- a/gtk/capture_dlg.c
+++ b/gtk/capture_dlg.c
@@ -1,7 +1,7 @@
/* capture_dlg.c
* Routines for packet capture windows
*
- * $Id: capture_dlg.c,v 1.24 2000/05/08 05:51:36 guy Exp $
+ * $Id: capture_dlg.c,v 1.25 2000/05/08 07:13:39 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -374,6 +374,11 @@ capture_prep_file_cb(GtkWidget *w, gpointer file_te)
/* Connect the cancel_button to destroy the widget */
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(fs)->cancel_button),
"clicked", (GtkSignalFunc) cap_prep_fs_cancel_cb, fs);
+
+ /* Catch the "key_press_event" signal in the window, so that we can catch
+ the ESC key being pressed and act as if the "Cancel" button had
+ been selected. */
+ dlg_set_cancel(fs, GTK_FILE_SELECTION(fs)->cancel_button);
gtk_widget_show(fs);
}
diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c
index 9e5242ce07..0af3a7b7a5 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.22 2000/04/10 18:40:13 guy Exp $
+ * $Id: file_dlg.c,v 1.23 2000/05/08 07:13:40 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -60,6 +60,7 @@
#endif
#include "file_dlg.h"
+#include "dlg_utils.h"
#ifndef __UTIL_H__
#include "util.h"
@@ -142,6 +143,11 @@ file_open_cmd_cb(GtkWidget *w, gpointer data) {
(file_open_w)->cancel_button), "clicked", (GtkSignalFunc)
gtk_widget_destroy, GTK_OBJECT (file_open_w));
+ /* Catch the "key_press_event" signal in the window, so that we can catch
+ the ESC key being pressed and act as if the "Cancel" button had
+ been selected. */
+ dlg_set_cancel(file_open_w, GTK_FILE_SELECTION(file_open_w)->cancel_button);
+
gtk_widget_show(file_open_w);
}
@@ -420,6 +426,11 @@ file_save_as_cmd_cb(GtkWidget *w, gpointer data)
(file_save_as_w)->cancel_button), "clicked", (GtkSignalFunc)
gtk_widget_destroy, GTK_OBJECT (file_save_as_w));
+ /* Catch the "key_press_event" signal in the window, so that we can catch
+ the ESC key being pressed and act as if the "Cancel" button had
+ been selected. */
+ dlg_set_cancel(file_save_as_w, GTK_FILE_SELECTION(file_save_as_w)->cancel_button);
+
gtk_file_selection_set_filename(GTK_FILE_SELECTION(file_save_as_w), "");
gtk_widget_show(file_save_as_w);
}
diff --git a/gtk/print_dlg.c b/gtk/print_dlg.c
index 289b0da5ab..4b1645cece 100644
--- a/gtk/print_dlg.c
+++ b/gtk/print_dlg.c
@@ -1,7 +1,7 @@
/* print_dlg.c
* Dialog boxes for printing
*
- * $Id: print_dlg.c,v 1.16 2000/05/08 05:35:08 guy Exp $
+ * $Id: print_dlg.c,v 1.17 2000/05/08 07:13:40 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -425,6 +425,11 @@ print_file_cb(GtkWidget *file_bt, gpointer file_te)
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(fs)->cancel_button),
"clicked", (GtkSignalFunc) print_fs_cancel_cb, fs);
+ /* Catch the "key_press_event" signal in the window, so that we can catch
+ the ESC key being pressed and act as if the "Cancel" button had
+ been selected. */
+ dlg_set_cancel(fs, GTK_FILE_SELECTION(fs)->cancel_button);
+
gtk_widget_show(fs);
}