From abd6ce3b53f239441f5a655a362d057e16622b62 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sun, 9 Jul 2000 10:42:20 +0000 Subject: Removed unused do_nothing_cb function. 2000-07-09 Christopher James Lahey * gui/component/addressbook.c: Removed unused do_nothing_cb function. * gui/component/select-names/e-select-names-manager.c, gui/component/select-names/e-select-names-manager.h: Made the OK and Cancel buttons in the ESelectNames dialog we create work properly. * gui/component/select-names/e-select-names-model.c, gui/component/select-names/e-select-names-model.h: Added e_select_names_model_duplicate. * gui/component/select-names/e-select-names-text-model.c: Made the text be set correctly if there's already data in the source when the text model is created. * gui/component/select-names/e-select-names.c, gui/component/select-names/e-select-names.h: Removed handling of the buttons (the user of this dialog will have to handle them.) Added e_select_names_get_source. Fixed some typos. svn path=/trunk/; revision=4007 --- .../gui/component/select-names/e-select-names.c | 33 +++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) (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 172f3e0d83..90b64b1183 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -168,18 +168,6 @@ 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; - } - gnome_dialog_close(GNOME_DIALOG(dialog)); -} - static void e_select_names_init (ESelectNames *e_select_names) { @@ -206,9 +194,6 @@ 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"); @@ -341,11 +326,12 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E child = g_new(ESelectNamesChild, 1); child->names = e_select_names; + child->title = g_strdup(_(name)); e_select_names->child_count++; alignment = gtk_alignment_new(0, 0, 1, 0); - label = g_strdup_printf("%s ->", _(name)); + label = g_strdup_printf("%s ->", child->title); button = gtk_button_new_with_label(label); g_free(label); gtk_container_add(GTK_CONTAINER(alignment), button); @@ -386,6 +372,8 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E e_select_names->child_count + 1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0); + + g_hash_table_insert(e_select_names->children, g_strdup(id), child); } static void * @@ -422,3 +410,16 @@ e_select_names_get_section(ESelectNames *e_select_names, char *id) } return list; } + +ESelectNamesModel * +e_select_names_get_source(ESelectNames *e_select_names, + char *id) +{ + ESelectNamesChild *child = g_hash_table_lookup(e_select_names->children, id); + if (child) { + if (child->source) + gtk_object_ref(GTK_OBJECT(child->source)); + return child->source; + } else + return NULL; +} -- cgit v1.2.3