diff options
Diffstat (limited to 'gtk/column_prefs.c')
-rw-r--r-- | gtk/column_prefs.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/gtk/column_prefs.c b/gtk/column_prefs.c index 6edf938831..0c0780fe37 100644 --- a/gtk/column_prefs.c +++ b/gtk/column_prefs.c @@ -1,22 +1,22 @@ /* column_prefs.c * Dialog box for column preferences * - * $Id: column_prefs.c,v 1.11 2002/04/23 06:25:37 guy Exp $ + * $Id: column_prefs.c,v 1.12 2002/08/28 21:03:46 jmayer Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -68,12 +68,12 @@ column_prefs_show() { gtk_container_border_width(GTK_CONTAINER(main_vb), 5); gtk_widget_show(main_vb); gtk_object_set_data(GTK_OBJECT(main_vb), E_COL_CM_KEY, (gpointer)FALSE); - + /* Top row: Column list and buttons */ top_hb = gtk_hbox_new(FALSE, 5); gtk_container_add(GTK_CONTAINER(main_vb), top_hb); gtk_widget_show(top_hb); - + list_bb = gtk_vbutton_box_new(); gtk_button_box_set_layout (GTK_BUTTON_BOX (list_bb), GTK_BUTTONBOX_START); gtk_container_add(GTK_CONTAINER(top_hb), list_bb); @@ -84,32 +84,32 @@ column_prefs_show() { GTK_SIGNAL_FUNC(column_list_new_cb), NULL); gtk_container_add(GTK_CONTAINER(list_bb), new_bt); gtk_widget_show(new_bt); - + del_bt = gtk_button_new_with_label ("Delete"); gtk_widget_set_sensitive(del_bt, FALSE); gtk_signal_connect(GTK_OBJECT(del_bt), "clicked", GTK_SIGNAL_FUNC(column_list_delete_cb), NULL); gtk_container_add(GTK_CONTAINER(list_bb), del_bt); gtk_widget_show(del_bt); - + arrow_hb = gtk_hbox_new(TRUE, 3); gtk_container_add(GTK_CONTAINER(list_bb), arrow_hb); gtk_widget_show(arrow_hb); - + up_bt = gtk_button_new_with_label("Up"); gtk_widget_set_sensitive(up_bt, FALSE); gtk_signal_connect(GTK_OBJECT(up_bt), "clicked", GTK_SIGNAL_FUNC(column_arrow_cb), NULL); gtk_box_pack_start(GTK_BOX(arrow_hb), up_bt, TRUE, TRUE, 0); gtk_widget_show(up_bt); - + dn_bt = gtk_button_new_with_label("Down"); gtk_widget_set_sensitive(dn_bt, FALSE); gtk_signal_connect(GTK_OBJECT(dn_bt), "clicked", GTK_SIGNAL_FUNC(column_arrow_cb), NULL); gtk_box_pack_start(GTK_BOX(arrow_hb), dn_bt, TRUE, TRUE, 0); gtk_widget_show(dn_bt); - + column_sc = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(column_sc), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -136,24 +136,24 @@ column_prefs_show() { while (clp) { cfmt = (fmt_data *) clp->data; col_ent[0] = cfmt->title; - col_ent[1] = col_format_desc(get_column_format_from_str(cfmt->fmt)); + col_ent[1] = col_format_desc(get_column_format_from_str(cfmt->fmt)); row = gtk_clist_append(GTK_CLIST(column_l), col_ent); gtk_clist_set_row_data(GTK_CLIST(column_l), row, clp); clp = clp->next; } - + /* Colunm name entry and format selection */ tb = gtk_table_new(2, 2, FALSE); gtk_container_add(GTK_CONTAINER(main_vb), tb); gtk_table_set_row_spacings(GTK_TABLE(tb), 10); gtk_table_set_col_spacings(GTK_TABLE(tb), 15); gtk_widget_show(tb); - + lb = gtk_label_new("Column title:"); gtk_misc_set_alignment(GTK_MISC(lb), 1.0, 0.5); gtk_table_attach_defaults(GTK_TABLE(tb), lb, 0, 1, 0, 1); gtk_widget_show(lb); - + title_te = gtk_entry_new(); gtk_table_attach_defaults(GTK_TABLE(tb), title_te, 1, 2, 0, 1); gtk_signal_connect(GTK_OBJECT(title_te), "changed", @@ -184,12 +184,12 @@ column_prefs_show() { gtk_option_menu_set_history(GTK_OPTION_MENU(fmt_m), cur_fmt); gtk_widget_set_sensitive(fmt_m, FALSE); gtk_box_pack_start(GTK_BOX(top_hb), fmt_m, FALSE, FALSE, 0); - gtk_widget_show(fmt_m); - + gtk_widget_show(fmt_m); + return(main_vb); } -/* For each selection, set the entry and option menu widgets to match +/* For each selection, set the entry and option menu widgets to match the currently selected item. Set the up/down button sensitivity. Draw focus to the entry widget. */ static void @@ -200,7 +200,7 @@ column_list_select_cb(GtkCList *clist, gpointer user_data _U_) { fmt_data *cfmt; GList *clp; - + clp = gtk_clist_get_row_data(clist, row); g_assert(clp != NULL); cfmt = (fmt_data *) clp->data; @@ -211,7 +211,7 @@ column_list_select_cb(GtkCList *clist, gtk_entry_set_text(GTK_ENTRY(title_te), cfmt->title); gtk_editable_select_region(GTK_EDITABLE(title_te), 0, -1); gtk_widget_grab_focus(title_te); - + gtk_option_menu_set_history(GTK_OPTION_MENU(fmt_m), cur_fmt); gtk_widget_set_sensitive(del_bt, TRUE); @@ -227,10 +227,10 @@ column_list_unselect_cb(GtkCList *clist _U_, gint column _U_, GdkEvent *event _U_, gpointer user_data _U_) { - + cur_row = -1; gtk_editable_delete_text(GTK_EDITABLE(title_te), 0, -1); - + gtk_widget_set_sensitive(del_bt, FALSE); gtk_widget_set_sensitive(title_te, FALSE); gtk_widget_set_sensitive(fmt_m, FALSE); @@ -239,12 +239,12 @@ column_list_unselect_cb(GtkCList *clist _U_, } /* To do: add input checking to each of these callbacks */ - + static void column_list_new_cb(GtkWidget *w _U_, gpointer data _U_) { fmt_data *cfmt; gchar *title = "New Column", *col_ent[2]; - + cur_fmt = 0; cfmt = (fmt_data *) g_malloc(sizeof(fmt_data)); cfmt->title = g_strdup(title); @@ -281,9 +281,9 @@ static void column_entry_changed_cb(GtkEditable *te, gpointer data) { fmt_data *cfmt; GList *clp; - GtkCList *cl = data; + GtkCList *cl = data; gchar *title; - + if (cur_row >= 0) { title = gtk_editable_get_chars(te, 0, -1); clp = gtk_clist_get_row_data(cl, cur_row); @@ -300,7 +300,7 @@ static void column_menu_changed_cb(GtkWidget *w _U_, gpointer data) { fmt_data *cfmt; GList *clp; - + if (cur_row >= 0) { cur_fmt = (gint) data; clp = gtk_clist_get_row_data(GTK_CLIST(column_l), cur_row); @@ -317,15 +317,15 @@ column_arrow_cb(GtkWidget *w, gpointer data _U_) { GList *clp; fmt_data *cfmt; gint inc = 1; - - g_assert(cur_row >= 0); + + g_assert(cur_row >= 0); if (w == up_bt) inc = -1; - + /* This would end up appending to the list. We shouldn't have to check for appending past the end of the list. */ - g_assert((cur_row + inc) >= 0); + g_assert((cur_row + inc) >= 0); clp = gtk_clist_get_row_data(GTK_CLIST(column_l), cur_row); cfmt = (fmt_data *) clp->data; @@ -363,9 +363,9 @@ column_prefs_apply(GtkWidget *w _U_) { void column_prefs_destroy(GtkWidget *w) { - + /* Let the list cb know we're about to destroy the widget tree, so it */ - /* doesn't operate on widgets that don't exist. */ + /* doesn't operate on widgets that don't exist. */ gtk_object_set_data(GTK_OBJECT(w), E_COL_CM_KEY, (gpointer)TRUE); gtk_widget_destroy(GTK_WIDGET(w)); -} +} |