Ethereal-dev: [ethereal-dev] Patch for prefs dialog...
Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.
From: Peter Hawkins <dph-man@xxxxxxxxx>
Date: Wed, 06 Jan 1999 10:10:41 +1100
Hi there... Is it ok to send small patches to this list? Assuming it is (this one's only 4k)... Here's a patch against the latest CVS to make the prefs dialog look like the netscape one. If you like it, someone can commit it to CVS. :-) Peter --- prefs.c Wed Jan 6 10:01:07 1999 +++ ../prefs.new Wed Jan 6 10:03:17 1999 @@ -68,11 +68,17 @@ static gchar *pf_path = NULL; +static void cb_select_child( GtkWidget *tree, GtkWidget *child, GtkWidget *prefs_nb) +{ + gtk_notebook_set_page(GTK_NOTEBOOK(prefs_nb), (gint)gtk_object_get_user_data(GTK_OBJECT(child))); +} + void prefs_cb(GtkWidget *w, gpointer sp) { GtkWidget *prefs_w, *main_vb, *top_hb, *bbox, *prefs_nb, *ok_bt, *save_bt, *cancel_bt; - GtkWidget *print_pg, *filter_pg, *column_pg, *filter_te, *label; + GtkWidget *print_pg, *filter_pg, *column_pg, *filter_te, *select_tree; + GtkWidget *treeitem, *frame; /* GtkWidget *nlabel; */ gint start_page = (gint) sp; @@ -90,14 +96,31 @@ gtk_widget_show(main_vb); /* Top row: Preferences notebook */ - top_hb = gtk_hbox_new(FALSE, 1); + top_hb = gtk_hbox_new(FALSE, 3); gtk_container_add(GTK_CONTAINER(main_vb), top_hb); gtk_widget_show(top_hb); + + frame = gtk_frame_new(NULL); + gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); + + select_tree = gtk_tree_new(); + gtk_widget_set_usize(select_tree, 150, 0); /* The height value doesn't matter, we're in an hbox */ + gtk_tree_set_view_lines(GTK_TREE(select_tree), TRUE); + gtk_container_add(GTK_CONTAINER(frame), select_tree); + gtk_widget_show(select_tree); + + gtk_container_add(GTK_CONTAINER(top_hb), frame); + gtk_widget_show(frame); + prefs_nb = gtk_notebook_new(); - gtk_container_add(GTK_CONTAINER(main_vb), prefs_nb); + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(prefs_nb), FALSE); + gtk_notebook_set_show_border(GTK_NOTEBOOK(prefs_nb), FALSE); + gtk_container_add(GTK_CONTAINER(top_hb), prefs_nb); gtk_widget_show(prefs_nb); - + + + gtk_signal_connect(GTK_OBJECT(select_tree), "select_child", GTK_SIGNAL_FUNC(cb_select_child), prefs_nb ); /* General prefs */ /* nlabel = gtk_label_new("Nothing here yet..."); gtk_widget_show (nlabel); @@ -108,9 +131,15 @@ /* Printing prefs */ print_pg = printer_prefs_show(); gtk_object_set_data(GTK_OBJECT(prefs_w), E_PRINT_PAGE_KEY, print_pg); - label = gtk_label_new ("Printing"); - gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), print_pg, label); - + + treeitem = gtk_tree_item_new_with_label ("Printing"); + gtk_tree_append(GTK_TREE(select_tree), treeitem); + gtk_widget_show(treeitem); + + gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), print_pg, NULL); + gtk_object_set_user_data(GTK_OBJECT(treeitem), (gpointer)gtk_notebook_page_num(GTK_NOTEBOOK(prefs_nb), print_pg)); + + /* Filter prefs */ if (w) filter_te = gtk_object_get_data(GTK_OBJECT(w), E_FILT_TE_PTR_KEY); @@ -122,13 +151,20 @@ /* Pass along the entry widget pointer from the calling widget */ gtk_object_set_data(GTK_OBJECT(filter_pg), E_FILT_TE_PTR_KEY, filter_te); gtk_object_set_data(GTK_OBJECT(prefs_w), E_FILTER_PAGE_KEY, filter_pg); - label = gtk_label_new ("Filters"); - gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), filter_pg, label); + treeitem = gtk_tree_item_new_with_label("Filters"); + gtk_tree_append(GTK_TREE(select_tree), treeitem); + gtk_widget_show(treeitem); + gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), filter_pg, NULL); + gtk_object_set_user_data(GTK_OBJECT(treeitem), (gpointer)gtk_notebook_page_num(GTK_NOTEBOOK(prefs_nb), filter_pg)); + /* Column prefs */ column_pg = column_prefs_show(); gtk_object_set_data(GTK_OBJECT(prefs_w), E_COLUMN_PAGE_KEY, column_pg); - label = gtk_label_new ("Columns"); - gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), column_pg, label); + treeitem = gtk_tree_item_new_with_label("Columns"); + gtk_tree_append(GTK_TREE(select_tree), treeitem); + gtk_widget_show(treeitem); + gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), column_pg, NULL); + gtk_object_set_user_data(GTK_OBJECT(treeitem), (gpointer)gtk_notebook_page_num(GTK_NOTEBOOK(prefs_nb), column_pg)); /* Jump to the specified page, if it was supplied */ if (start_page > E_PR_PG_NONE)
- Prev by Date: Re: [ethereal-dev] High resolution timers
- Next by Date: Re: [ethereal-dev] Viewing packets while capturing...
- Previous by thread: Re: [ethereal-dev] Suggestion/Question ?
- Next by thread: Re: [ethereal-dev] Patch for prefs dialog...
- Index(es):