From c29099541fa371b15fe83575022243314080b16c Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 11 Oct 2000 10:13:43 +0000 Subject: Updated these to the new style ETables. 2000-10-11 Christopher James Lahey * contact-editor/e-contact-editor-categories.c, gui/component/select-names/e-select-names.c, gui/widgets/e-addressbook-view.c: Updated these to the new style ETables. svn path=/trunk/; revision=5843 --- addressbook/gui/widgets/e-addressbook-view.c | 101 ++++++++++++--------------- 1 file changed, 45 insertions(+), 56 deletions(-) (limited to 'addressbook/gui/widgets/e-addressbook-view.c') diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index bd229fad25..c865d50b40 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -27,9 +27,6 @@ #include #include -#include -#include -#include #include #include @@ -466,27 +463,55 @@ table_right_click(ETableScrolled *table, gint row, gint col, GdkEvent *event, EA } else return FALSE; } - -#define SPEC " \ - \ - \ - 0 \ - 1 \ - 5 \ - 3 \ - 4 \ - \ - \ - \ - \ +#define SPEC " \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + 0 \ + 1 \ + 5 \ + 3 \ + 4 \ + \ + \ + \ + \ " static void create_table_view (EAddressbookView *view) { - ECell *cell_left_just; - ETableHeader *e_table_header; - int i; ETableModel *model; ECardSimple *simple; GtkWidget *table; @@ -495,41 +520,10 @@ create_table_view (EAddressbookView *view) model = e_addressbook_model_new(); - /* - Next we create a header. The ETableHeader is used in two - different way. The first is the full_header. This is the - list of possible columns in the view. The second use is - completely internal. Many of the ETableHeader functions are - for that purpose. The only functions we really need are - e_table_header_new and e_table_header_add_col. - - First we create the header. */ - e_table_header = e_table_header_new (); - - /* Next we have to build renderers for all of the columns. - Since all our columns are text columns, we can simply use - the same renderer over and over again. If we had different - types of columns, we could use a different renderer for - each column. */ - cell_left_just = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); - - /* Next we create a column object for each view column and add - them to the header. We don't create a column object for - the importance column since it will not be shown. */ - for (i = 0; i < E_CARD_SIMPLE_FIELD_LAST - 1; i++){ - /* Create the column. */ - ETableCol *ecol = e_table_col_new ( - i, e_card_simple_get_name(simple, i+1), - 1.0, 20, cell_left_just, - g_str_compare, TRUE); - /* Add it to the header. */ - e_table_header_add_column (e_table_header, ecol, i); - } - /* Here we create the table. We give it the three pieces of the table we've created, the header, the model, and the initial layout. It does the rest. */ - table = e_table_scrolled_new (e_table_header, model, SPEC); + table = e_table_scrolled_new (model, NULL, SPEC, NULL); view->object = GTK_OBJECT(model); view->widget = table; @@ -539,11 +533,6 @@ create_table_view (EAddressbookView *view) gtk_signal_connect(GTK_OBJECT(table), "right_click", GTK_SIGNAL_FUNC(table_right_click), view); - gtk_object_set (GTK_OBJECT(table), - "click_to_add_message", _("* Click here to add a contact *"), - "drawgrid", TRUE, - NULL); - gtk_table_attach(GTK_TABLE(view), table, 0, 1, 0, 1, -- cgit v1.2.3