diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-04-01 19:11:01 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-04-01 19:11:01 +0200 |
commit | cbdc578517d0ce8abaac299109ff83fdef1e3f6d (patch) | |
tree | 4d5cecae82fb7f1ed32921aee35104781b578bef /plugins/gtkui/fileman.c | |
parent | 6fd3ff3d5e1d3578bf460128447a89f465812120 (diff) |
move cursor after dragndrop
Diffstat (limited to 'plugins/gtkui/fileman.c')
-rw-r--r-- | plugins/gtkui/fileman.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/gtkui/fileman.c b/plugins/gtkui/fileman.c index d6374ba6..c2a0745e 100644 --- a/plugins/gtkui/fileman.c +++ b/plugins/gtkui/fileman.c @@ -152,11 +152,20 @@ strcopy_special (char *dest, const char *src, int len) { *dest = 0; } +static gboolean +set_dnd_cursor_idle (gpointer data) { + DdbListview *listview = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); + int cursor = deadbeef->pl_get_idx_of (DB_PLAYITEM (data)); + ddb_listview_set_cursor (listview, cursor); + return FALSE; +} + void gtkpl_add_fm_dropped_files (DB_playItem_t *drop_before, char *ptr, int length) { DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); g_idle_add (progress_show_idle, NULL); + DdbListviewIter first = NULL; DdbListviewIter after = NULL; if (drop_before) { after = deadbeef->pl_get_prev (drop_before, PL_MAIN); @@ -181,6 +190,9 @@ gtkpl_add_fm_dropped_files (DB_playItem_t *drop_before, char *ptr, int length) { inserted = deadbeef->pl_insert_file (after, fname, &abort, gtkpl_add_file_info_cb, NULL); } if (inserted) { + if (!first) { + first = inserted; + } if (after) { deadbeef->pl_item_unref (after); } @@ -199,6 +211,7 @@ gtkpl_add_fm_dropped_files (DB_playItem_t *drop_before, char *ptr, int length) { deadbeef->pl_item_unref (after); } g_idle_add (progress_hide_idle, NULL); + g_idle_add (set_dnd_cursor_idle, first); } struct fmdrop_data { |