aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog17
-rw-r--r--addressbook/contact-editor/e-contact-editor-categories.c11
-rw-r--r--addressbook/demo/addressbook-widget.c4
-rw-r--r--addressbook/demo/demo.c4
-rw-r--r--addressbook/gui/component/addressbook.c6
-rw-r--r--addressbook/gui/component/e-addressbook-model.c22
-rw-r--r--addressbook/gui/component/e-cardlist-model.c7
-rw-r--r--addressbook/gui/component/e-select-names.c1
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-categories.c11
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c22
10 files changed, 94 insertions, 11 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index bf93316632..f097647bcf 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,20 @@
+2000-06-26 Christopher James Lahey <clahey@helixcode.com>
+
+ * contact-editor/e-contact-editor-categories.c,
+ addressbook/gui/component/e-cardlist-model.c: Added
+ value_to_string handlers.
+
+ * demo/addressbook-widget.c, demo/demo.c: Removed usage of "x" and
+ "y" arguments.
+
+ * addressbook/gui/component/addressbook.c: Activated Click To Add
+ and set the click to add message.
+
+ * addressbook/gui/component/e-addressbook-model.c: Added
+ value_to_string and append_row handlers.
+
+ * addressbook/gui/component/e-select-names.c: Added a column.
+
2000-06-26 Chris Toshok <toshok@helixcode.com>
* backend/pas/pas-backend-ldap.c (poll_ldap): remove spew.
diff --git a/addressbook/contact-editor/e-contact-editor-categories.c b/addressbook/contact-editor/e-contact-editor-categories.c
index e58162a06a..03e1265795 100644
--- a/addressbook/contact-editor/e-contact-editor-categories.c
+++ b/addressbook/contact-editor/e-contact-editor-categories.c
@@ -42,6 +42,7 @@ static void *e_contact_editor_categories_duplicate_value (ETableModel *etc, int
static void e_contact_editor_categories_free_value (ETableModel *etc, int col, void *value, gpointer data);
static void *e_contact_editor_categories_initialize_value (ETableModel *etc, int col, gpointer data);
static gboolean e_contact_editor_categories_value_is_empty (ETableModel *etc, int col, const void *value, gpointer data);
+static char * e_contact_editor_categories_value_to_string (ETableModel *etc, int col, const void *value, gpointer data);
static GnomeDialogClass *parent_class = NULL;
@@ -274,6 +275,7 @@ e_contact_editor_categories_init (EContactEditorCategories *categories)
e_contact_editor_categories_free_value,
e_contact_editor_categories_initialize_value,
e_contact_editor_categories_value_is_empty,
+ e_contact_editor_categories_value_to_string,
categories);
header = e_table_header_new();
@@ -454,3 +456,12 @@ e_contact_editor_categories_value_is_empty (ETableModel *etc, int col, const voi
else
return !(value && *(char *)value);
}
+
+static char *
+e_contact_editor_categories_value_to_string (ETableModel *etc, int col, const void *value, gpointer data)
+{
+ if (col == 0)
+ return g_strdup_printf("%d", (int) value);
+ else
+ return g_strdup(value);
+}
diff --git a/addressbook/demo/addressbook-widget.c b/addressbook/demo/addressbook-widget.c
index dfe531c787..a4e4fb95e7 100644
--- a/addressbook/demo/addressbook-widget.c
+++ b/addressbook/demo/addressbook-widget.c
@@ -132,8 +132,6 @@ rebuild_reflow(ETableModel *model, gpointer data)
gtk_object_destroy(GTK_OBJECT(reflow->reflow));
reflow->reflow = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( reflow->canvas ) ),
e_reflow_get_type(),
- "x", (double) 0,
- "y", (double) 0,
"height", (double) reflow->last_alloc.height,
"minimum_width", (double) reflow->last_alloc.width,
NULL );
@@ -254,8 +252,6 @@ create_reflow(View *view)
NULL );
reflow->reflow = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( reflow->canvas ) ),
e_reflow_get_type(),
- "x", (double) 0,
- "y", (double) 0,
"height", (double) 100,
"minimum_width", (double) 100,
NULL );
diff --git a/addressbook/demo/demo.c b/addressbook/demo/demo.c
index e6f7246b2f..1e2c256d3a 100644
--- a/addressbook/demo/demo.c
+++ b/addressbook/demo/demo.c
@@ -130,8 +130,6 @@ rebuild_reflow(ETableModel *model, gpointer data)
gtk_object_destroy(GTK_OBJECT(reflow->reflow));
reflow->reflow = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( reflow->canvas ) ),
e_reflow_get_type(),
- "x", (double) 0,
- "y", (double) 0,
"height", (double) reflow->last_alloc.height,
"minimum_width", (double) reflow->last_alloc.width,
NULL );
@@ -245,8 +243,6 @@ create_reflow(View *view)
NULL );
reflow->reflow = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( reflow->canvas ) ),
e_reflow_get_type(),
- "x", (double) 0,
- "y", (double) 0,
"height", (double) 100,
"minimum_width", (double) 100,
NULL );
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 1bce1010e3..c080e35e5e 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -745,7 +745,7 @@ set_prop (BonoboPropertyBag *bag,
}
#define SPEC "<?xml version=\"1.0\"?> \
-<ETableSpecification> \
+<ETableSpecification click-to-add=\"1\"> \
<columns-shown> \
<column>0</column> \
<column>1</column> \
@@ -1023,6 +1023,10 @@ create_table_view (AddressbookView *view, char *initial_query)
gtk_signal_connect(GTK_OBJECT(view->table), "right_click",
GTK_SIGNAL_FUNC(table_right_click), view);
+ gtk_object_set (GTK_OBJECT(view->table),
+ "click_to_add_message", _("* Click here to add a contact *"),
+ NULL);
+
gtk_box_pack_start(GTK_BOX(view->vbox), view->table, TRUE, TRUE, 0);
gtk_widget_show_all( GTK_WIDGET(view->table) );
diff --git a/addressbook/gui/component/e-addressbook-model.c b/addressbook/gui/component/e-addressbook-model.c
index f5d2fca7cb..7deda52c98 100644
--- a/addressbook/gui/component/e-addressbook-model.c
+++ b/addressbook/gui/component/e-addressbook-model.c
@@ -113,6 +113,19 @@ addressbook_is_cell_editable (ETableModel *etc, int col, int row)
return TRUE;
}
+static gint
+addressbook_append_row (ETableModel *etm)
+{
+ ECard *card;
+ EAddressbookModel *model = E_ADDRESSBOOK_MODEL(etm);
+ model->data = g_realloc(model->data, (model->data_count + 1) * sizeof(ECard *));
+ card = e_card_new("");
+ model->data[model->data_count++] = e_card_simple_new (card);
+ gtk_object_unref(GTK_OBJECT(card));
+ e_table_model_row_inserted(E_TABLE_MODEL(model), model->data_count - 1);
+ return model->data_count - 1;
+}
+
/* This function duplicates the value passed to it. */
static void *
addressbook_duplicate_value (ETableModel *etc, int col, const void *value)
@@ -139,6 +152,12 @@ addressbook_value_is_empty (ETableModel *etc, int col, const void *value)
return !(value && *(char *)value);
}
+static char *
+addressbook_value_to_string (ETableModel *etc, int col, const void *value)
+{
+ return g_strdup(value);
+}
+
static void
create_card(EBookView *book_view,
const GList *cards,
@@ -146,7 +165,6 @@ create_card(EBookView *book_view,
{
model->data = g_realloc(model->data, (model->data_count + g_list_length((GList *)cards)) * sizeof(ECard *));
for ( ; cards; cards = cards->next) {
- gtk_object_ref(GTK_OBJECT(cards->data));
model->data[model->data_count++] = e_card_simple_new (E_CARD(cards->data));
e_table_model_row_inserted(E_TABLE_MODEL(model), model->data_count - 1);
}
@@ -207,10 +225,12 @@ e_addressbook_model_class_init (GtkObjectClass *object_class)
model_class->value_at = addressbook_value_at;
model_class->set_value_at = addressbook_set_value_at;
model_class->is_cell_editable = addressbook_is_cell_editable;
+ model_class->append_row = addressbook_append_row;
model_class->duplicate_value = addressbook_duplicate_value;
model_class->free_value = addressbook_free_value;
model_class->initialize_value = addressbook_initialize_value;
model_class->value_is_empty = addressbook_value_is_empty;
+ model_class->value_to_string = addressbook_value_to_string;
}
static void
diff --git a/addressbook/gui/component/e-cardlist-model.c b/addressbook/gui/component/e-cardlist-model.c
index e4a802439a..23b61d58be 100644
--- a/addressbook/gui/component/e-cardlist-model.c
+++ b/addressbook/gui/component/e-cardlist-model.c
@@ -107,6 +107,12 @@ e_cardlist_model_value_is_empty (ETableModel *etc, int col, const void *value)
return !(value && *(char *)value);
}
+static char *
+e_cardlist_model_value_to_string (ETableModel *etc, int col, const void *value)
+{
+ return g_strdup(value);
+}
+
void
e_cardlist_model_add(ECardlistModel *model,
ECard **cards,
@@ -160,6 +166,7 @@ e_cardlist_model_class_init (GtkObjectClass *object_class)
model_class->free_value = e_cardlist_model_free_value;
model_class->initialize_value = e_cardlist_model_initialize_value;
model_class->value_is_empty = e_cardlist_model_value_is_empty;
+ model_class->value_to_string = e_cardlist_model_value_to_string;
}
static void
diff --git a/addressbook/gui/component/e-select-names.c b/addressbook/gui/component/e-select-names.c
index 517d071ede..5cb68a7f92 100644
--- a/addressbook/gui/component/e-select-names.c
+++ b/addressbook/gui/component/e-select-names.c
@@ -97,6 +97,7 @@ e_select_names_class_init (ESelectNamesClass *klass)
#define SPEC "<ETableSpecification no-header=\"1\"> \
<columns-shown> \
<column> 0 </column> \
+ <column> 2 </column> \
</columns-shown> \
<grouping> <leaf column=\"0\" ascending=\"1\"/> </grouping> \
</ETableSpecification>"
diff --git a/addressbook/gui/contact-editor/e-contact-editor-categories.c b/addressbook/gui/contact-editor/e-contact-editor-categories.c
index e58162a06a..03e1265795 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-categories.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-categories.c
@@ -42,6 +42,7 @@ static void *e_contact_editor_categories_duplicate_value (ETableModel *etc, int
static void e_contact_editor_categories_free_value (ETableModel *etc, int col, void *value, gpointer data);
static void *e_contact_editor_categories_initialize_value (ETableModel *etc, int col, gpointer data);
static gboolean e_contact_editor_categories_value_is_empty (ETableModel *etc, int col, const void *value, gpointer data);
+static char * e_contact_editor_categories_value_to_string (ETableModel *etc, int col, const void *value, gpointer data);
static GnomeDialogClass *parent_class = NULL;
@@ -274,6 +275,7 @@ e_contact_editor_categories_init (EContactEditorCategories *categories)
e_contact_editor_categories_free_value,
e_contact_editor_categories_initialize_value,
e_contact_editor_categories_value_is_empty,
+ e_contact_editor_categories_value_to_string,
categories);
header = e_table_header_new();
@@ -454,3 +456,12 @@ e_contact_editor_categories_value_is_empty (ETableModel *etc, int col, const voi
else
return !(value && *(char *)value);
}
+
+static char *
+e_contact_editor_categories_value_to_string (ETableModel *etc, int col, const void *value, gpointer data)
+{
+ if (col == 0)
+ return g_strdup_printf("%d", (int) value);
+ else
+ return g_strdup(value);
+}
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index f5d2fca7cb..7deda52c98 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -113,6 +113,19 @@ addressbook_is_cell_editable (ETableModel *etc, int col, int row)
return TRUE;
}
+static gint
+addressbook_append_row (ETableModel *etm)
+{
+ ECard *card;
+ EAddressbookModel *model = E_ADDRESSBOOK_MODEL(etm);
+ model->data = g_realloc(model->data, (model->data_count + 1) * sizeof(ECard *));
+ card = e_card_new("");
+ model->data[model->data_count++] = e_card_simple_new (card);
+ gtk_object_unref(GTK_OBJECT(card));
+ e_table_model_row_inserted(E_TABLE_MODEL(model), model->data_count - 1);
+ return model->data_count - 1;
+}
+
/* This function duplicates the value passed to it. */
static void *
addressbook_duplicate_value (ETableModel *etc, int col, const void *value)
@@ -139,6 +152,12 @@ addressbook_value_is_empty (ETableModel *etc, int col, const void *value)
return !(value && *(char *)value);
}
+static char *
+addressbook_value_to_string (ETableModel *etc, int col, const void *value)
+{
+ return g_strdup(value);
+}
+
static void
create_card(EBookView *book_view,
const GList *cards,
@@ -146,7 +165,6 @@ create_card(EBookView *book_view,
{
model->data = g_realloc(model->data, (model->data_count + g_list_length((GList *)cards)) * sizeof(ECard *));
for ( ; cards; cards = cards->next) {
- gtk_object_ref(GTK_OBJECT(cards->data));
model->data[model->data_count++] = e_card_simple_new (E_CARD(cards->data));
e_table_model_row_inserted(E_TABLE_MODEL(model), model->data_count - 1);
}
@@ -207,10 +225,12 @@ e_addressbook_model_class_init (GtkObjectClass *object_class)
model_class->value_at = addressbook_value_at;
model_class->set_value_at = addressbook_set_value_at;
model_class->is_cell_editable = addressbook_is_cell_editable;
+ model_class->append_row = addressbook_append_row;
model_class->duplicate_value = addressbook_duplicate_value;
model_class->free_value = addressbook_free_value;
model_class->initialize_value = addressbook_initialize_value;
model_class->value_is_empty = addressbook_value_is_empty;
+ model_class->value_to_string = addressbook_value_to_string;
}
static void