aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-06-27 08:51:06 +0800
committerChris Lahey <clahey@src.gnome.org>2000-06-27 08:51:06 +0800
commite4de45da5f6021db9a009f112c91e21493a87e1f (patch)
tree8e481cf3ba0b08eede834c97820476a3dd5e87c9 /addressbook/gui
parent9d5faecef3b9e0f8fff68a2d4ddd9dab91b2f66d (diff)
downloadgsoc2013-evolution-e4de45da5f6021db9a009f112c91e21493a87e1f.tar
gsoc2013-evolution-e4de45da5f6021db9a009f112c91e21493a87e1f.tar.gz
gsoc2013-evolution-e4de45da5f6021db9a009f112c91e21493a87e1f.tar.bz2
gsoc2013-evolution-e4de45da5f6021db9a009f112c91e21493a87e1f.tar.lz
gsoc2013-evolution-e4de45da5f6021db9a009f112c91e21493a87e1f.tar.xz
gsoc2013-evolution-e4de45da5f6021db9a009f112c91e21493a87e1f.tar.zst
gsoc2013-evolution-e4de45da5f6021db9a009f112c91e21493a87e1f.zip
Calculate height including if clip_height is set to -1.
2000-06-26 Christopher James Lahey <clahey@helixcode.com> * widgets/e-text/e-text.c: Calculate height including if clip_height is set to -1. From addressbook/ChangeLog: 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. From calendar/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * gui/calendar-model.c: Added an #ifdefed value_to_string handler assignment. From camel/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * providers/mbox/camel-mbox-summary.c: Added debugging information. From composer/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-msg-composer-select-file.h for make distcheck. From e-util/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-canvas-vbox.c and e-canvas-vbox.h. * e-canvas-vbox.c, e-canvas-vbox.h: New canvas object to act like a vbox using the reflow system. From mail/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * message-list.c: Added a value_to_string handler. From shell/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * glade/Makefile.am: Added EXTRA_DIST for make distcheck. From widgets/e-table/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-table-click-to-add.c, e-table-click-to-add.h, e-table-one.c, and e-table-one.h. * e-table-click-to-add.c, e-table-click-to-add.h: A new canvas item that represents a single row that sometimes exists. It's for adding new rows to your table. * e-table-example-1.c, e-table-example-2.c, e-table-size-test.c, test-check.c, test-cols.c, test-table.c: Added value_to_string handlers. * e-table-group-container.c: Use value_to_string to make grouping not crash for non string columns. Made some changes to work properly in an ECanvasVbox. * e-table-group-leaf.c, e-table-item.c: Made some changes to work properly in an ECanvasVbox. * e-table-model.c, e-table-model.h: Added append_row and value_to_string methods. * e-table-one.c, e-table-one.h: Given a source ETableModel, this provides a single row model that uses the initialize_value, duplicate_value, free_value, and value_is_empty methods of the original source to implement set_value and value_at (and proxies most of the other methods.) This is used for ETableClickToAdd. * e-table-simple.c, e-table-simple.h: Added append_row and value_to_string handlers. append_row uses a GtkArg instead of a parameter to e_table_simple_new. * e-table-subset.c: Added append_row and value_to_string handlers. * e-table.c, e-table.h: Use a vbox containing an ETableClickToAdd and an ETableItem instead of an ETableItem directly. Only show the ETableClickToAdd if the top level of the xml SPEC has the attribute click-to-add set to some non-zero integer. (click-to-add="1"). Add a "click_to_add_message" argument. * e-tree-model.c: Add a commented out value_to_string handler. From widgets/meeting-time-sel/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added the include path to top_srcdir. svn path=/trunk/; revision=3744
Diffstat (limited to 'addressbook/gui')
-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
6 files changed, 66 insertions, 3 deletions
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