aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-10-11 18:13:43 +0800
committerChris Lahey <clahey@src.gnome.org>2000-10-11 18:13:43 +0800
commitc29099541fa371b15fe83575022243314080b16c (patch)
tree95762b75063dfa396c9f3509ca35a0cd648160ee
parent63ef9cbc9c277f24a2ebbf804a0fc84befe4e4ed (diff)
downloadgsoc2013-evolution-c29099541fa371b15fe83575022243314080b16c.tar.gz
gsoc2013-evolution-c29099541fa371b15fe83575022243314080b16c.tar.zst
gsoc2013-evolution-c29099541fa371b15fe83575022243314080b16c.zip
Updated these to the new style ETables.
2000-10-11 Christopher James Lahey <clahey@helixcode.com> * 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
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/contact-editor/e-contact-editor-categories.c33
-rw-r--r--addressbook/gui/component/select-names/e-select-names.c44
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-categories.c33
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c101
5 files changed, 79 insertions, 139 deletions
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 <clahey@helixcode.com>
+
+ * 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 <NotZed@HelixCode.com>
* 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 <gal/e-table/e-table-scrolled.h>
#include <gal/e-table/e-table.h>
#include <gal/e-table/e-table-simple.h>
-#include <gal/e-table/e-cell-text.h>
-#include <gal/e-table/e-cell-checkbox.h>
#include <gal/widgets/e-unicode.h>
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 "<ETableSpecification no-header=\"1\"> \
- <columns-shown> \
+#define INITIAL_SPEC "<ETableSpecification no-header=\"1\" draw-grid=\"true\">\
+ <ETableColumn model_col=\"0\" _title=\" \" expansion=\"0.0\" minimum_width=\"20\" resizable=\"false\" cell=\"checkbox\" compare=\"integer\"/> \
+ <ETableColumn model_col=\"1\" _title=\"Category\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableState> \
<column> 0 </column> \
<column> 1 </column> \
- </columns-shown> \
- <grouping> <leaf column=\"1\" ascending=\"1\"/> </grouping> \
+ <grouping> <leaf column=\"1\" ascending=\"1\"/> </grouping> \
+ </ETableState> \
</ETableSpecification>"
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 <gnome.h>
#include "e-select-names.h"
#include <gal/e-table/e-table-simple.h>
-#include <gal/e-table/e-cell-text.h>
#include <addressbook/gui/widgets/e-addressbook-model.h>
#include <addressbook/gui/component/e-cardlist-model.h>
#include <addressbook/backend/ebook/e-book.h>
@@ -88,18 +87,20 @@ e_select_names_class_init (ESelectNamesClass *klass)
object_class->destroy = e_select_names_destroy;
}
-#define SPEC "<ETableSpecification no-header=\"1\"> \
- <columns-shown> \
- <column> 2 </column> \
- </columns-shown> \
- <grouping> <leaf column=\"1\" ascending=\"1\"/> </grouping> \
+#define SPEC "<ETableSpecification no-headers=\"true\"> \
+ <ETableColumn model_col= \"34\" _title=\"Name\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableState> \
+ <column> 0 </column> \
+ <grouping> <leaf column=\"1\" ascending=\"1\"/> </grouping> \
+ </ETableState> \
</ETableSpecification>"
-#define SPEC2 "<ETableSpecification no-header=\"1\"> \
- <columns-shown> \
+#define SPEC2 "<ETableSpecification no-headers=\"true\"> \
+ <ETableColumn model_col= \"0\" _title=\"Name\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableState> \
<column> 0 </column> \
- </columns-shown> \
- <grouping> </grouping> \
+ <grouping> </grouping> \
+ </ETableState> \
</ETableSpecification>"
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 <gal/e-table/e-table-scrolled.h>
#include <gal/e-table/e-table.h>
#include <gal/e-table/e-table-simple.h>
-#include <gal/e-table/e-cell-text.h>
-#include <gal/e-table/e-cell-checkbox.h>
#include <gal/widgets/e-unicode.h>
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 "<ETableSpecification no-header=\"1\"> \
- <columns-shown> \
+#define INITIAL_SPEC "<ETableSpecification no-header=\"1\" draw-grid=\"true\">\
+ <ETableColumn model_col=\"0\" _title=\" \" expansion=\"0.0\" minimum_width=\"20\" resizable=\"false\" cell=\"checkbox\" compare=\"integer\"/> \
+ <ETableColumn model_col=\"1\" _title=\"Category\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableState> \
<column> 0 </column> \
<column> 1 </column> \
- </columns-shown> \
- <grouping> <leaf column=\"1\" ascending=\"1\"/> </grouping> \
+ <grouping> <leaf column=\"1\" ascending=\"1\"/> </grouping> \
+ </ETableState> \
</ETableSpecification>"
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 <gal/e-table/e-table-scrolled.h>
#include <gal/e-table/e-table-model.h>
-#include <gal/e-table/e-table-col.h>
-#include <gal/e-table/e-table-header.h>
-#include <gal/e-table/e-cell-text.h>
#include <gal/widgets/e-scroll-frame.h>
#include <gal/widgets/e-popup-menu.h>
@@ -466,27 +463,55 @@ table_right_click(ETableScrolled *table, gint row, gint col, GdkEvent *event, EA
} else
return FALSE;
}
-
-#define SPEC "<?xml version=\"1.0\"?> \
-<ETableSpecification click-to-add=\"1\"> \
- <columns-shown> \
- <column>0</column> \
- <column>1</column> \
- <column>5</column> \
- <column>3</column> \
- <column>4</column> \
- </columns-shown> \
- <grouping> \
- <leaf column=\"0\" ascending=\"1\"/> \
- </grouping> \
+#define SPEC "<?xml version=\"1.0\"?> \
+<ETableSpecification click-to-add=\"true\" draw-grid=\"true\" _click-to-add-message=\"* Click here to add a contact *\"> \
+ <ETableColumn model_col= \"0\" _title=\"Name\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col= \"1\" _title=\"Family Name\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col= \"2\" _title=\"Email\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col= \"3\" _title=\"Primary\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col= \"4\" _title=\"Business\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col= \"5\" _title=\"Home\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col= \"6\" _title=\"Organization\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col= \"7\" _title=\"Business\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col= \"8\" _title=\"Home\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col= \"9\" _title=\"Mobile\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"10\" _title=\"Car\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"11\" _title=\"Business Fax\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"12\" _title=\"Home Fax\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"13\" _title=\"Business 2\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"14\" _title=\"Home 2\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"15\" _title=\"ISDN\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"16\" _title=\"Other\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"17\" _title=\"Pager\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"18\" _title=\"Other\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"19\" _title=\"Email 2\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"20\" _title=\"Email 3\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"21\" _title=\"Web Site\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"22\" _title=\"Department\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"23\" _title=\"Office\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"24\" _title=\"Title\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"25\" _title=\"Profession\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"26\" _title=\"Manager\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"27\" _title=\"Assistant\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"28\" _title=\"Nickname\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"29\" _title=\"Spouse\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"30\" _title=\"Note\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableColumn model_col=\"31\" _title=\"Free-busy URL\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
+ <ETableState> \
+ <column>0</column> \
+ <column>1</column> \
+ <column>5</column> \
+ <column>3</column> \
+ <column>4</column> \
+ <grouping> \
+ <leaf column=\"0\" ascending=\"1\"/> \
+ </grouping> \
+ </ETableState> \
</ETableSpecification>"
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,