From e42af08627db9fd5eed66551e52157bb91c0e642 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Tue, 3 Aug 2004 22:53:33 +0000 Subject: Fixes #60529. 2004-08-02 Hans Petter Jansson Fixes #60529. * gui/contact-list-editor/e-contact-list-editor.c (table_drag_drop_cb): Make sure to get the text/x-vcard target. 2004-08-02 Hans Petter Jansson Fixes #62085. * gui/contact-list-editor/e-contact-list-editor.c (e_contact_list_editor_class_init): Set the save_contact method. (e_contact_list_editor_save_contact): Implement. svn path=/trunk/; revision=26816 --- .../contact-list-editor/e-contact-list-editor.c | 37 ++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'addressbook/gui/contact-list-editor') diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index dd2dd19045..ec91ff612e 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -62,6 +62,7 @@ static void e_contact_list_editor_dispose (GObject *object); static void e_contact_list_editor_show (EABEditor *editor); static void e_contact_list_editor_raise (EABEditor *editor); static void e_contact_list_editor_close (EABEditor *editor); +static void e_contact_list_editor_save_contact (EABEditor *editor, gboolean should_close); static gboolean e_contact_list_editor_is_valid (EABEditor *editor); static gboolean e_contact_list_editor_is_changed (EABEditor *editor); static GtkWindow* e_contact_list_editor_get_window (EABEditor *editor); @@ -150,6 +151,7 @@ e_contact_list_editor_class_init (EContactListEditorClass *klass) editor_class->show = e_contact_list_editor_show; editor_class->raise = e_contact_list_editor_raise; editor_class->close = e_contact_list_editor_close; + editor_class->save_contact = e_contact_list_editor_save_contact; editor_class->is_valid = e_contact_list_editor_is_valid; editor_class->is_changed = e_contact_list_editor_is_changed; editor_class->get_window = e_contact_list_editor_get_window; @@ -432,6 +434,14 @@ is_named (EContactListEditor *editor) return named; } +static void +e_contact_list_editor_save_contact (EABEditor *editor, gboolean should_close) +{ + EContactListEditor *cle = E_CONTACT_LIST_EDITOR (editor); + + save_contact (editor, should_close); +} + static gboolean e_contact_list_editor_is_valid (EABEditor *editor) { @@ -882,14 +892,29 @@ table_drag_drop_cb (ETable *table, int row, int col, GdkDragContext *context, gint x, gint y, guint time, EContactListEditor *editor) { - if (context->targets == NULL) - return FALSE; + GList *p; + for (p = context->targets; p != NULL; p = p->next) { + char *possible_type; - gtk_drag_get_data (GTK_WIDGET (table), context, - GDK_POINTER_TO_ATOM (context->targets->data), - time); - return TRUE; + possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data)); + if (!strcmp (possible_type, VCARD_TYPE)) { + g_free (possible_type); + break; + } + + g_free (possible_type); + } + + + if (p) { + gtk_drag_get_data (GTK_WIDGET (table), context, + GDK_POINTER_TO_ATOM (p->data), + time); + return TRUE; + } + + return FALSE; } static void -- cgit v1.2.3