diff options
author | Chris Toshok <toshok@ximian.com> | 2003-03-27 11:47:24 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2003-03-27 11:47:24 +0800 |
commit | f6623221aeb0607c698d6c377dc6659dec86440e (patch) | |
tree | 017e57aef0d3002064f630cb268ba01819c256b9 | |
parent | c1c85074dd0171c266c6e12a4247593bb66e54a0 (diff) | |
download | gsoc2013-evolution-f6623221aeb0607c698d6c377dc6659dec86440e.tar gsoc2013-evolution-f6623221aeb0607c698d6c377dc6659dec86440e.tar.gz gsoc2013-evolution-f6623221aeb0607c698d6c377dc6659dec86440e.tar.bz2 gsoc2013-evolution-f6623221aeb0607c698d6c377dc6659dec86440e.tar.lz gsoc2013-evolution-f6623221aeb0607c698d6c377dc6659dec86440e.tar.xz gsoc2013-evolution-f6623221aeb0607c698d6c377dc6659dec86440e.tar.zst gsoc2013-evolution-f6623221aeb0607c698d6c377dc6659dec86440e.zip |
[ fixes bug #34085 ] only successfully complete the drag if they dropped a
2003-03-26 Chris Toshok <toshok@ximian.com>
[ fixes bug #34085 ]
* gui/contact-list-editor/e-contact-list-editor.c
(table_drag_data_received_cb): only successfully complete the drag
if they dropped a valid vcard (or vcard list). Call
gtk_drag_finish.
svn path=/trunk/; revision=20539
-rw-r--r-- | addressbook/ChangeLog | 8 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.c | 28 |
2 files changed, 25 insertions, 11 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 485ef6bda5..11f1c1ca28 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,13 @@ 2003-03-26 Chris Toshok <toshok@ximian.com> + [ fixes bug #34085 ] + * gui/contact-list-editor/e-contact-list-editor.c + (table_drag_data_received_cb): only successfully complete the drag + if they dropped a valid vcard (or vcard list). Call + gtk_drag_finish. + +2003-03-26 Chris Toshok <toshok@ximian.com> + * gui/contact-list-editor/Makefile.am (INCLUDES): $evolution_uidir -> $evolutionuidir 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 ecb63b2e2a..754048c2a5 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -839,14 +839,14 @@ table_drag_drop_cb (ETable *table, int row, int col, GdkDragContext *context, gint x, gint y, guint time, EContactListEditor *editor) { - if (context->targets != NULL) { - gtk_drag_get_data (GTK_WIDGET (table), context, - GDK_POINTER_TO_ATOM (context->targets->data), - time); - return TRUE; - } + if (context->targets == NULL) + return FALSE; - return FALSE; + + gtk_drag_get_data (GTK_WIDGET (table), context, + GDK_POINTER_TO_ATOM (context->targets->data), + time); + return TRUE; } static void @@ -859,6 +859,7 @@ table_drag_data_received_cb (ETable *table, int row, int col, GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (editor->table)); char *target_type; gboolean changed = FALSE; + gboolean handled = FALSE; target_type = gdk_atom_name (selection_data->target); @@ -867,6 +868,9 @@ table_drag_data_received_cb (ETable *table, int row, int col, GList *card_list = e_card_load_cards_from_string_with_default_charset (selection_data->data, "ISO-8859-1"); GList *c; + if (card_list) + handled = TRUE; + for (c = card_list; c; c = c->next) { ECard *ecard = c->data; @@ -887,12 +891,14 @@ table_drag_data_received_cb (ETable *table, int row, int col, /* Skip to the end of the list */ if (adj->upper - adj->lower > adj->page_size) gtk_adjustment_set_value (adj, adj->upper); - } - if (changed) { - editor->changed = TRUE; - command_state_changed (editor); + if (changed) { + editor->changed = TRUE; + command_state_changed (editor); + } } + + gtk_drag_finish (context, handled, FALSE, time); } static void |