From a451a634c20ffb820fd07700b9bb88fbd29df2b9 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sun, 9 Jul 2000 01:24:53 +0000 Subject: Include e-select-names-factory.h. 2000-07-08 Christopher James Lahey * gui/component/addressbook-factory.c: Include e-select-names-factory.h. * gui/component/select-names/e-select-names-model.c: Handle a NULL iterator properly in the replace function. * gui/component/select-names/e-select-names-table-model.c: Fill in info properly in the value_at function. * gui/component/select-names/e-select-names-text-model.c: Don't strlen a NULL text object. * gui/component/select-names/e-select-names.c: Close if the person hits ok or cancel (doesn't yet actually undo changes if Cancel is hit.) Handle removing addresses when they're double clicked on. * gui/component/select-names/select-names.glade, gui/component/select-names/select-names.glade.h: Hid some unused fields and changed the text at the top of the dialog. svn path=/trunk/; revision=3989 --- .../gui/component/select-names/e-select-names.c | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'addressbook/gui/component/select-names/e-select-names.c') diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index a588b10770..555f195514 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -168,6 +168,17 @@ set_current_selection(ETable *table, int row, ESelectNames *names) names->currently_selected = row; } +static void +e_select_names_clicked(ESelectNames *dialog, gint button, ESelectNames *data) +{ + switch(button) { + case 0: + break; + case 1: + break; + } +} + static void e_select_names_init (ESelectNames *e_select_names) { @@ -194,6 +205,9 @@ e_select_names_init (ESelectNames *e_select_names) GNOME_STOCK_BUTTON_CANCEL, NULL); + gtk_signal_connect(GTK_OBJECT(e_select_names), "clicked", + GTK_SIGNAL_FUNC(e_select_names_clicked), e_select_names); + e_select_names->table = E_TABLE(glade_xml_get_widget(gui, "table-source")); e_select_names->model = gtk_object_get_data(GTK_OBJECT(e_select_names->table), "model"); @@ -292,6 +306,17 @@ button_clicked(GtkWidget *button, ESelectNamesChild *child) } } +static void +remove_address(ETable *table, int row, ESelectNamesChild *child) +{ + EIterator *iterator = e_list_get_iterator(e_select_names_model_get_data(child->source)); + e_iterator_reset(iterator); + for (; row > 0; row--) { + e_iterator_next(iterator); + } + e_select_names_model_remove_item(child->source, iterator); +} + void e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, ESelectNamesModel *source) { @@ -340,6 +365,9 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E g_str_compare, TRUE), 0); etable = e_table_new (header, model, SPEC2); + gtk_signal_connect(GTK_OBJECT(etable), "double_click", + GTK_SIGNAL_FUNC(remove_address), child); + gtk_object_set(GTK_OBJECT(etable), "cursor_mode", E_TABLE_CURSOR_LINE, NULL); -- cgit v1.2.3