diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2004-05-26 03:49:24 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2004-05-26 03:49:24 +0000 |
commit | 7d37fc9d23181cc3dfb42d42d2655a9b97ac6062 (patch) | |
tree | 1dd3c8757f1727f8591869b656d047a48c05c477 /gtk/simple_dialog.c | |
parent | 3aaf65db46a1afc054911564f12a45ec2af63274 (diff) |
more code cleanup from dialog things:
changed window_xy (dialog) function calling in a lot of gtk files
cleanup of file selection code
cleanup in dlg_utils/file_dlg/ui_util
Please report any problems!!!
svn path=/trunk/; revision=11003
Diffstat (limited to 'gtk/simple_dialog.c')
-rw-r--r-- | gtk/simple_dialog.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/gtk/simple_dialog.c b/gtk/simple_dialog.c index 3d467843a8..b69396ce51 100644 --- a/gtk/simple_dialog.c +++ b/gtk/simple_dialog.c @@ -1,7 +1,7 @@ /* simple_dialog.c * Simple message dialog box routines. * - * $Id: simple_dialog.c,v 1.34 2004/05/17 21:15:28 ulfl Exp $ + * $Id: simple_dialog.c,v 1.35 2004/05/26 03:49:24 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -33,6 +33,7 @@ #include "gtkglobals.h" #include "simple_dialog.h" #include "dlg_utils.h" +#include "ui_util.h" #include "compat_macros.h" #include <epan/strutil.h> @@ -207,20 +208,11 @@ display_simple_dialog(gint type, gint btn_mask, char *message) bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CANCEL); if(bt) { OBJECT_SET_DATA(bt, CALLBACK_BTN_KEY, GINT_TO_POINTER(ESD_BTN_CANCEL)); - SIGNAL_CONNECT(bt, "clicked", simple_dialog_cancel_cb, win); - /* Catch the "key_press_event" signal in the window, so that we can catch - the ESC key being pressed and act as if the "OK" button had - been selected. */ - dlg_set_cancel(win, bt); - gtk_widget_grab_default(bt); + window_set_cancel_button(win, bt, simple_dialog_cancel_cb); } if(!bt) { - /* Catch the "key_press_event" signal in the window, so that we can catch - the ESC key being pressed and act as if the "OK" button had - been selected. */ - dlg_set_cancel(win, ok_bt); - gtk_widget_grab_default(ok_bt); + window_set_cancel_button(win, ok_bt, simple_dialog_cancel_cb); } gtk_widget_show(win); @@ -321,7 +313,7 @@ simple_dialog_cancel_cb(GtkWidget *w, gpointer win) { simple_dialog_cb_t callback_fct = OBJECT_GET_DATA(win, CALLBACK_FCT_KEY); gpointer data = OBJECT_GET_DATA(win, CALLBACK_DATA_KEY); - gtk_widget_destroy(GTK_WIDGET(win)); + window_destroy(GTK_WIDGET(win)); if (callback_fct) (callback_fct) (win, button, data); |