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/ChangeLog | 7 ++ .../contact-editor/e-contact-editor-categories.c | 33 ++----- .../gui/component/select-names/e-select-names.c | 44 +++------ .../contact-editor/e-contact-editor-categories.c | 33 ++----- addressbook/gui/widgets/e-addressbook-view.c | 101 +++++++++------------ 5 files changed, 79 insertions(+), 139 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index f4a2cdbb0b..9986dfc0cb 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,10 @@ +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. + 2000-10-06 Not Zed * gui/search/e-addressbook-search-dialog.c (get_widget): Removed diff --git a/addressbook/contact-editor/e-contact-editor-categories.c b/addressbook/contact-editor/e-contact-editor-categories.c index 1845fc65ff..db85466e87 100644 --- a/addressbook/contact-editor/e-contact-editor-categories.c +++ b/addressbook/contact-editor/e-contact-editor-categories.c @@ -26,8 +26,6 @@ #include #include #include -#include -#include #include static void e_contact_editor_categories_init (EContactEditorCategories *card); @@ -223,13 +221,14 @@ e_contact_editor_categories_entry_change (GtkWidget *entry, do_parse_categories(categories); } - -#define INITIAL_SPEC " \ - \ +#define INITIAL_SPEC "\ + \ + \ + \ 0 \ 1 \ - \ - \ + \ + \ " static void @@ -237,10 +236,6 @@ e_contact_editor_categories_init (EContactEditorCategories *categories) { GladeXML *gui; GtkWidget *table; - ECell *cell_left_just; - ECell *cell_checkbox; - ETableHeader *header; - ETableCol *col; GtkWidget *e_table; categories->list_length = 0; @@ -282,21 +277,7 @@ e_contact_editor_categories_init (EContactEditorCategories *categories) e_contact_editor_categories_value_to_string, categories); - header = e_table_header_new(); - - cell_checkbox = e_cell_checkbox_new(); - col = e_table_col_new (0, "", - 0, 20, cell_checkbox, - g_int_compare, TRUE); - e_table_header_add_column (header, col, 0); - - cell_left_just = e_cell_text_new (categories->model, NULL, GTK_JUSTIFY_LEFT); - col = e_table_col_new (1, "Category", - 1.0, 20, cell_left_just, - g_str_compare, TRUE); - e_table_header_add_column (header, col, 1); - - e_table = e_table_scrolled_new (header, categories->model, INITIAL_SPEC); + e_table = e_table_scrolled_new (categories->model, NULL, INITIAL_SPEC, NULL); gtk_object_sink(GTK_OBJECT(categories->model)); diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index 4869c4cb8d..f6960c4e7e 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -23,7 +23,6 @@ #include #include "e-select-names.h" #include -#include #include #include #include @@ -88,18 +87,20 @@ e_select_names_class_init (ESelectNamesClass *klass) object_class->destroy = e_select_names_destroy; } -#define SPEC " \ - \ - 2 \ - \ - \ +#define SPEC " \ + \ + \ + 0 \ + \ + \ " -#define SPEC2 " \ - \ +#define SPEC2 " \ + \ + \ 0 \ - \ - \ + \ + \ " GtkWidget *e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2); @@ -118,8 +119,6 @@ GtkWidget * e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2) { ETableModel *model; - ETableHeader *header; - ECell *cell_left_just; EBook *book; GtkWidget *table; char *filename; @@ -129,15 +128,6 @@ e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int n gtk_object_set(GTK_OBJECT(model), "editable", FALSE, NULL); - cell_left_just = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); - - header = e_table_header_new (); - e_table_header_add_column (header, e_table_col_new (0, "Full Name", 1.0, 20, cell_left_just, - g_str_compare, TRUE), -1); - e_table_header_add_column (header, e_table_col_new (1, "Email", 1.0, 20, cell_left_just, - g_str_compare, TRUE), -1); - e_table_header_add_column (header, e_table_col_new (34, "Name", 1.0, 20, cell_left_just, - g_str_compare, TRUE), -1); book = e_book_new(); gtk_object_ref(GTK_OBJECT(model)); @@ -147,7 +137,7 @@ e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int n e_book_load_uri(book, uri, (EBookCallback) set_book, model); g_free(uri); g_free(filename); - table = e_table_scrolled_new (header, model, SPEC); + table = e_table_scrolled_new (model, NULL, SPEC, NULL); gtk_object_set(GTK_OBJECT(table), "cursor_mode", E_TABLE_CURSOR_LINE, @@ -311,8 +301,6 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E ETableModel *model; GtkWidget *etable; - ETableHeader *header; - ECell *cell_left_just; if (g_hash_table_lookup(e_select_names->children, id)) { return; @@ -343,13 +331,7 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E 0, 0); model = e_select_names_table_model_new(source); - header = e_table_header_new (); - cell_left_just = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); - e_table_header_add_column (header, e_table_col_new (0, "Name", 1.0, 20, cell_left_just, - g_str_compare, TRUE), -1); - e_table_header_add_column (header, e_table_col_new (1, "Email", 1.0, 20, cell_left_just, - g_str_compare, TRUE), -1); - etable = e_table_scrolled_new (header, model, SPEC2); + etable = e_table_scrolled_new (model, NULL, SPEC2, NULL); gtk_signal_connect(GTK_OBJECT(etable), "double_click", GTK_SIGNAL_FUNC(remove_address), child); diff --git a/addressbook/gui/contact-editor/e-contact-editor-categories.c b/addressbook/gui/contact-editor/e-contact-editor-categories.c index 1845fc65ff..db85466e87 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-categories.c +++ b/addressbook/gui/contact-editor/e-contact-editor-categories.c @@ -26,8 +26,6 @@ #include #include #include -#include -#include #include static void e_contact_editor_categories_init (EContactEditorCategories *card); @@ -223,13 +221,14 @@ e_contact_editor_categories_entry_change (GtkWidget *entry, do_parse_categories(categories); } - -#define INITIAL_SPEC " \ - \ +#define INITIAL_SPEC "\ + \ + \ + \ 0 \ 1 \ - \ - \ + \ + \ " static void @@ -237,10 +236,6 @@ e_contact_editor_categories_init (EContactEditorCategories *categories) { GladeXML *gui; GtkWidget *table; - ECell *cell_left_just; - ECell *cell_checkbox; - ETableHeader *header; - ETableCol *col; GtkWidget *e_table; categories->list_length = 0; @@ -282,21 +277,7 @@ e_contact_editor_categories_init (EContactEditorCategories *categories) e_contact_editor_categories_value_to_string, categories); - header = e_table_header_new(); - - cell_checkbox = e_cell_checkbox_new(); - col = e_table_col_new (0, "", - 0, 20, cell_checkbox, - g_int_compare, TRUE); - e_table_header_add_column (header, col, 0); - - cell_left_just = e_cell_text_new (categories->model, NULL, GTK_JUSTIFY_LEFT); - col = e_table_col_new (1, "Category", - 1.0, 20, cell_left_just, - g_str_compare, TRUE); - e_table_header_add_column (header, col, 1); - - e_table = e_table_scrolled_new (header, categories->model, INITIAL_SPEC); + e_table = e_table_scrolled_new (categories->model, NULL, INITIAL_SPEC, NULL); gtk_object_sink(GTK_OBJECT(categories->model)); 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