diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-08-23 06:56:31 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-08-23 06:56:31 +0000 |
commit | 56697db466b1f1da79f8c266e55cad71a405bfc3 (patch) | |
tree | 3333db70f4d3d91d322fab7d0870bba64f848919 | |
parent | 2f1bab3f96efc95c0274abffd026a18f368905f9 (diff) |
Bleah. What was I thinking? "dlg_window_new()" should take the title
for the dialog window as an argument (as various dialog creators in GTK+
do), not oblige every caller of it to cut-and-paste a
"gtk_window_set_title()" call after it.
svn path=/trunk/; revision=2345
-rw-r--r-- | gtk/capture_dlg.c | 5 | ||||
-rw-r--r-- | gtk/color_dlg.c | 8 | ||||
-rw-r--r-- | gtk/display_opts.c | 5 | ||||
-rw-r--r-- | gtk/dlg_utils.c | 5 | ||||
-rw-r--r-- | gtk/dlg_utils.h | 4 | ||||
-rw-r--r-- | gtk/filter_prefs.c | 5 | ||||
-rw-r--r-- | gtk/find_dlg.c | 5 | ||||
-rw-r--r-- | gtk/goto_dlg.c | 5 | ||||
-rw-r--r-- | gtk/gui_prefs.c | 5 | ||||
-rw-r--r-- | gtk/plugins_dlg.c | 8 | ||||
-rw-r--r-- | gtk/prefs_dlg.c | 5 | ||||
-rw-r--r-- | gtk/print_dlg.c | 5 | ||||
-rw-r--r-- | gtk/progress_dlg.c | 5 | ||||
-rw-r--r-- | gtk/proto_dlg.c | 5 | ||||
-rw-r--r-- | gtk/simple_dialog.c | 13 |
15 files changed, 37 insertions, 51 deletions
diff --git a/gtk/capture_dlg.c b/gtk/capture_dlg.c index d9317e4534..d513a4001f 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.30 2000/08/11 13:32:58 deniel Exp $ + * $Id: capture_dlg.c,v 1.31 2000/08/23 06:55:12 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -126,8 +126,7 @@ capture_prep_cb(GtkWidget *w, gpointer d) err_str); } - cap_open_w = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(cap_open_w), "Ethereal: Capture Preferences"); + cap_open_w = dlg_window_new("Ethereal: Capture Preferences"); gtk_signal_connect(GTK_OBJECT(cap_open_w), "destroy", GTK_SIGNAL_FUNC(capture_prep_destroy_cb), NULL); diff --git a/gtk/color_dlg.c b/gtk/color_dlg.c index 674b1e4b97..18443847bc 100644 --- a/gtk/color_dlg.c +++ b/gtk/color_dlg.c @@ -1,7 +1,7 @@ /* color_dlg.c * Definitions for dialog boxes for color filters * - * $Id: color_dlg.c,v 1.6 2000/08/11 13:33:14 deniel Exp $ + * $Id: color_dlg.c,v 1.7 2000/08/23 06:55:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -130,9 +130,8 @@ colorize_dialog_new (colfilter *filter) filter->row_selected = -1; /* no row selected */ tooltips = gtk_tooltips_new (); - color_win = dlg_window_new (); + color_win = dlg_window_new ("Add color to protocols"); gtk_object_set_data (GTK_OBJECT (color_win), "color_win", color_win); - gtk_window_set_title (GTK_WINDOW (color_win), ("Add color to protocols")); vbox1 = gtk_vbox_new (FALSE, 0); gtk_widget_ref (vbox1); @@ -637,9 +636,8 @@ edit_color_filter_dialog_new (colfilter *filter, tooltips = gtk_tooltips_new (); - edit_dialog = dlg_window_new (); + edit_dialog = dlg_window_new ("Edit color filter"); gtk_object_set_data (GTK_OBJECT (edit_dialog), "edit_dialog", edit_dialog); - gtk_window_set_title (GTK_WINDOW (edit_dialog), ("Edit color filter")); colorf->edit_dialog = edit_dialog; vbox3 = gtk_vbox_new (FALSE, 0); diff --git a/gtk/display_opts.c b/gtk/display_opts.c index dc82c7b68b..9abdd5856a 100644 --- a/gtk/display_opts.c +++ b/gtk/display_opts.c @@ -1,7 +1,7 @@ /* display_opts.c * Routines for packet display windows * - * $Id: display_opts.c,v 1.15 2000/08/22 14:37:29 deniel Exp $ + * $Id: display_opts.c,v 1.16 2000/08/23 06:55:32 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -110,8 +110,7 @@ display_opt_cb(GtkWidget *w, gpointer d) { packet list).*/ current_timestamp_type = timestamp_type; - display_opt_w = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(display_opt_w), "Ethereal: Display Options"); + display_opt_w = dlg_window_new("Ethereal: Display Options"); gtk_signal_connect(GTK_OBJECT(display_opt_w), "destroy", GTK_SIGNAL_FUNC(display_opt_destroy_cb), NULL); diff --git a/gtk/dlg_utils.c b/gtk/dlg_utils.c index f8b5534d03..ef882fac09 100644 --- a/gtk/dlg_utils.c +++ b/gtk/dlg_utils.c @@ -1,7 +1,7 @@ /* dlg_utils.c * Utilities to use when constructing dialogs * - * $Id: dlg_utils.c,v 1.4 2000/07/05 02:45:39 guy Exp $ + * $Id: dlg_utils.c,v 1.5 2000/08/23 06:55:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -40,12 +40,13 @@ dlg_key_press (GtkWidget *widget, GdkEventKey *event, gpointer cancel_button); /* Create a dialog box window that belongs to Ethereal's main window. */ GtkWidget * -dlg_window_new(void) +dlg_window_new(const gchar *title) { GtkWidget *win; win = gtk_window_new(GTK_WINDOW_DIALOG); gtk_window_set_transient_for(GTK_WINDOW(win), GTK_WINDOW(top_level)); + gtk_window_set_title(GTK_WINDOW(win), title); return win; } diff --git a/gtk/dlg_utils.h b/gtk/dlg_utils.h index 351bc7656b..84a695aafc 100644 --- a/gtk/dlg_utils.h +++ b/gtk/dlg_utils.h @@ -1,7 +1,7 @@ /* dlg_utils.h * Declarations of utilities to use when constructing dialogs * - * $Id: dlg_utils.h,v 1.4 2000/08/11 13:32:57 deniel Exp $ + * $Id: dlg_utils.h,v 1.5 2000/08/23 06:55:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -27,7 +27,7 @@ #define __DLG_UTILS_H__ /* Create a dialog box window that belongs to Ethereal's main window. */ -GtkWidget *dlg_window_new(void); +GtkWidget *dlg_window_new(const gchar *); /* Set the "activate" signal for a widget to call a routine to activate the "OK" button for a dialog box. */ diff --git a/gtk/filter_prefs.c b/gtk/filter_prefs.c index a145059ba1..f00c49473b 100644 --- a/gtk/filter_prefs.c +++ b/gtk/filter_prefs.c @@ -3,7 +3,7 @@ * (This used to be a notebook page under "Preferences", hence the * "prefs" in the file name.) * - * $Id: filter_prefs.c,v 1.16 2000/08/11 13:33:08 deniel Exp $ + * $Id: filter_prefs.c,v 1.17 2000/08/23 06:55:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -239,8 +239,7 @@ filter_dialog_new(GtkWidget *caller, GtkWidget *filter_te, *cancel_bt; /* cancel button */ GtkWidget *filter_pg = NULL; /* filter settings box */ - main_w = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(main_w), "Ethereal: Filters"); + main_w = dlg_window_new("Ethereal: Filters"); /* Call a handler when we're destroyed, so we can inform our caller, if any, that we've been destroyed. */ diff --git a/gtk/find_dlg.c b/gtk/find_dlg.c index 1b03f55578..08dde87f5f 100644 --- a/gtk/find_dlg.c +++ b/gtk/find_dlg.c @@ -1,7 +1,7 @@ /* find_dlg.c * Routines for "find frame" window * - * $Id: find_dlg.c,v 1.14 2000/08/11 13:33:03 deniel Exp $ + * $Id: find_dlg.c,v 1.15 2000/08/23 06:55:49 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -81,8 +81,7 @@ find_frame_cb(GtkWidget *w, gpointer d) return; } - find_frame_w = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(find_frame_w), "Ethereal: Find Frame"); + find_frame_w = dlg_window_new("Ethereal: Find Frame"); gtk_signal_connect(GTK_OBJECT(find_frame_w), "destroy", GTK_SIGNAL_FUNC(find_frame_destroy_cb), NULL); diff --git a/gtk/goto_dlg.c b/gtk/goto_dlg.c index b07d443676..c0b6a84f28 100644 --- a/gtk/goto_dlg.c +++ b/gtk/goto_dlg.c @@ -1,7 +1,7 @@ /* goto_dlg.c * Routines for "go to frame" window * - * $Id: goto_dlg.c,v 1.10 2000/08/11 13:33:03 deniel Exp $ + * $Id: goto_dlg.c,v 1.11 2000/08/23 06:55:54 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -62,8 +62,7 @@ goto_frame_cb(GtkWidget *w, gpointer d) GtkWidget *goto_frame_w, *main_vb, *fnumber_hb, *fnumber_lb, *fnumber_te, *bbox, *ok_bt, *cancel_bt; - goto_frame_w = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(goto_frame_w), "Ethereal: Go To Frame"); + goto_frame_w = dlg_window_new("Ethereal: Go To Frame"); /* Container for each row of widgets */ main_vb = gtk_vbox_new(FALSE, 3); diff --git a/gtk/gui_prefs.c b/gtk/gui_prefs.c index 99869b557d..3220dcc137 100644 --- a/gtk/gui_prefs.c +++ b/gtk/gui_prefs.c @@ -1,7 +1,7 @@ /* gui_prefs.c * Dialog box for GUI preferences * - * $Id: gui_prefs.c,v 1.10 2000/08/22 14:04:52 deniel Exp $ + * $Id: gui_prefs.c,v 1.11 2000/08/23 06:55:58 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -446,8 +446,7 @@ color_browse_cb(GtkWidget *w, gpointer data) scolor[CS_BLUE] = (gdouble) (curcolor->blue) / 65535.0; scolor[CS_OPACITY] = 1.0; - color_w = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(color_w), "Ethereal: Select Color"); + color_w = dlg_window_new("Ethereal: Select Color"); gtk_signal_connect(GTK_OBJECT(color_w), "destroy", GTK_SIGNAL_FUNC(color_destroy_cb), NULL); diff --git a/gtk/plugins_dlg.c b/gtk/plugins_dlg.c index 589c4629c8..5239141a30 100644 --- a/gtk/plugins_dlg.c +++ b/gtk/plugins_dlg.c @@ -1,7 +1,7 @@ /* plugins_dlg.c * Dialog boxes for plugins * - * $Id: plugins_dlg.c,v 1.17 2000/08/21 20:11:51 deniel Exp $ + * $Id: plugins_dlg.c,v 1.18 2000/08/23 06:56:06 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -87,8 +87,7 @@ tools_plugins_cmd_cb(GtkWidget *widget, gpointer data) GtkWidget *save_bn; gchar *titles[] = {"Name", "Description", "Version", "Enabled"}; - plugins_window = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(plugins_window), "Ethereal: Plugins"); + plugins_window = dlg_window_new("Ethereal: Plugins"); main_vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(plugins_window), main_vbox); @@ -316,8 +315,7 @@ plugins_filter_cb(GtkWidget *button, gpointer clist) if (selected_row == -1) return; pt_plug = find_plugin(selected_name, selected_version); - filter_window = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(filter_window), "Ethereal: Plugin Filter"); + filter_window = dlg_window_new("Ethereal: Plugin Filter"); gtk_window_set_modal(GTK_WINDOW(filter_window), TRUE); filter_vbox = gtk_vbox_new(FALSE, 0); diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c index 19a46b0e8c..804126973a 100644 --- a/gtk/prefs_dlg.c +++ b/gtk/prefs_dlg.c @@ -1,7 +1,7 @@ /* prefs_dlg.c * Routines for handling preferences * - * $Id: prefs_dlg.c,v 1.21 2000/08/21 08:09:14 guy Exp $ + * $Id: prefs_dlg.c,v 1.22 2000/08/23 06:56:11 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -262,8 +262,7 @@ prefs_cb(GtkWidget *w, gpointer dummy) { if the user presses "Cancel". */ copy_prefs(&saved_prefs, &prefs); - prefs_w = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(prefs_w), "Ethereal: Preferences"); + prefs_w = dlg_window_new("Ethereal: Preferences"); gtk_signal_connect(GTK_OBJECT(prefs_w), "delete_event", GTK_SIGNAL_FUNC(prefs_main_delete_cb), NULL); gtk_signal_connect(GTK_OBJECT(prefs_w), "destroy", diff --git a/gtk/print_dlg.c b/gtk/print_dlg.c index d40e9afaf6..6c3b05107e 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.20 2000/08/11 13:33:01 deniel Exp $ + * $Id: print_dlg.c,v 1.21 2000/08/23 06:56:20 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -104,8 +104,7 @@ file_print_cmd_cb(GtkWidget *widget, gpointer data) return; } - print_w = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(print_w), "Ethereal: Print"); + print_w = dlg_window_new("Ethereal: Print"); gtk_signal_connect(GTK_OBJECT(print_w), "destroy", GTK_SIGNAL_FUNC(print_destroy_cb), NULL); diff --git a/gtk/progress_dlg.c b/gtk/progress_dlg.c index 33d092c701..a37ede57d1 100644 --- a/gtk/progress_dlg.c +++ b/gtk/progress_dlg.c @@ -1,7 +1,7 @@ /* progress_dlg.c * Routines for progress-bar (modal) dialog * - * $Id: progress_dlg.c,v 1.7 2000/07/07 23:09:15 guy Exp $ + * $Id: progress_dlg.c,v 1.8 2000/08/23 06:56:27 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -73,8 +73,7 @@ create_progress_dlg(const gchar *title, const gchar *stop_title, dlg = g_malloc(sizeof (progdlg_t)); - dlg_w = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(dlg_w), title); + dlg_w = dlg_window_new(title); gtk_window_set_modal(GTK_WINDOW(dlg_w), TRUE); /* diff --git a/gtk/proto_dlg.c b/gtk/proto_dlg.c index 9e53b41387..f03ebb0b8b 100644 --- a/gtk/proto_dlg.c +++ b/gtk/proto_dlg.c @@ -1,6 +1,6 @@ /* proto_dlg.c * - * $Id: proto_dlg.c,v 1.4 2000/08/17 07:56:44 guy Exp $ + * $Id: proto_dlg.c,v 1.5 2000/08/23 06:56:29 guy Exp $ * * Laurent Deniel <deniel@worldnet.fr> * @@ -85,8 +85,7 @@ void proto_cb(GtkWidget *w, gpointer data) return; } - proto_w = dlg_window_new(); - gtk_window_set_title(GTK_WINDOW(proto_w), "Ethereal: Protocol"); + proto_w = dlg_window_new("Ethereal: Protocol"); gtk_signal_connect(GTK_OBJECT(proto_w), "destroy", GTK_SIGNAL_FUNC(proto_close_cb), NULL); gtk_widget_set_usize(GTK_WIDGET(proto_w), DEF_WIDTH * 2/3, DEF_HEIGHT * 2/3); diff --git a/gtk/simple_dialog.c b/gtk/simple_dialog.c index 22d10a2550..61269534a2 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.5 2000/08/11 13:33:09 deniel Exp $ + * $Id: simple_dialog.c,v 1.6 2000/08/23 06:56:31 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -76,25 +76,24 @@ simple_dialog(gint type, gint *btn_mask, gchar *msg_format, ...) { gchar **icon; /* Main window */ - win = dlg_window_new(); - gtk_container_border_width(GTK_CONTAINER(win), 7); - switch (type) { case ESD_TYPE_WARN : - gtk_window_set_title(GTK_WINDOW(win), "Ethereal: Warning"); icon = icon_excl_xpm; + win = dlg_window_new("Ethereal: Warning"); break; case ESD_TYPE_CRIT : - gtk_window_set_title(GTK_WINDOW(win), "Ethereal: Error"); icon = icon_excl_xpm; + win = dlg_window_new("Ethereal: Error"); break; case ESD_TYPE_INFO : default : icon = icon_ethereal_xpm; - gtk_window_set_title(GTK_WINDOW(win), "Ethereal: Information"); + win = dlg_window_new("Ethereal: Information"); break; } + gtk_container_border_width(GTK_CONTAINER(win), 7); + gtk_object_set_data(GTK_OBJECT(win), bm_key, btn_mask); /* Container for our rows */ |