aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2004-04-13 15:10:49 +0800
committerLarry Ewing <lewing@src.gnome.org>2004-04-13 15:10:49 +0800
commit1dfdac328cf8fd46042513dc9950cedb130f4593 (patch)
tree5e4ccae619d22c4654410623470d5404e24e627f /addressbook/gui/widgets
parent4354611e365b25b2cc3466cecc402f47758a06b3 (diff)
downloadgsoc2013-evolution-1dfdac328cf8fd46042513dc9950cedb130f4593.tar
gsoc2013-evolution-1dfdac328cf8fd46042513dc9950cedb130f4593.tar.gz
gsoc2013-evolution-1dfdac328cf8fd46042513dc9950cedb130f4593.tar.bz2
gsoc2013-evolution-1dfdac328cf8fd46042513dc9950cedb130f4593.tar.lz
gsoc2013-evolution-1dfdac328cf8fd46042513dc9950cedb130f4593.tar.xz
gsoc2013-evolution-1dfdac328cf8fd46042513dc9950cedb130f4593.tar.zst
gsoc2013-evolution-1dfdac328cf8fd46042513dc9950cedb130f4593.zip
add GDK_ACTION_COPY to the supported drag types. Connect to the
2004-04-13 Larry Ewing <lewing@ximian.com> * gui/widgets/e-addressbook-view.c (create_table_view): add GDK_ACTION_COPY to the supported drag types. Connect to the table_drag_data_delete callback. (table_drag_data_delete): remove the drag rows. svn path=/trunk/; revision=25427
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index e17e147b9f..cf51653cd9 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -1189,6 +1189,36 @@ table_white_space_event(ETableScrolled *table, GdkEvent *event, EABView *view)
}
static void
+table_drag_data_delete (ETable *table,
+ int row,
+ int col,
+ GdkDragContext *context,
+ gpointer user_data)
+{
+ EABView *view = user_data;
+ EContact *contact;
+ EBook *book;
+
+ if (!E_IS_ADDRESSBOOK_TABLE_ADAPTER(view->object))
+ return;
+
+ g_object_get(view->model,
+ "book", &book,
+ NULL);
+
+ contact = eab_model_contact_at(view->model, row);
+ /* Remove the card. */
+ /* XXX no callback specified... ugh */
+ e_book_async_remove_contact (book,
+ contact,
+ NULL,
+ NULL);
+
+ g_object_unref(book);
+}
+
+
+static void
table_drag_data_get (ETable *table,
int row,
int col,
@@ -1372,12 +1402,17 @@ create_table_view (EABView *view)
/* drag & drop signals */
e_table_drag_source_set (E_TABLE(E_TABLE_SCROLLED(table)->table), GDK_BUTTON1_MASK,
- drag_types, num_drag_types, GDK_ACTION_MOVE);
+ drag_types, num_drag_types, GDK_ACTION_MOVE | GDK_ACTION_COPY);
g_signal_connect (E_TABLE_SCROLLED(table)->table,
"table_drag_data_get",
G_CALLBACK (table_drag_data_get),
view);
+
+ g_signal_connect (E_TABLE_SCROLLED(table)->table,
+ "table_drag_data_delete",
+ G_CALLBACK (table_drag_data_delete),
+ view);
gtk_paned_add1 (GTK_PANED (view->paned), table);