diff options
author | jstebbins <[email protected]> | 2008-09-13 20:04:28 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2008-09-13 20:04:28 +0000 |
commit | 91ca41626288377d6a7c24bc76677e8f90378460 (patch) | |
tree | fab0e4f122b3fd80a580bdb685e8e060a3640153 /gtk/src/main.c | |
parent | 3feae357a5d62add8c0bc32753b2b679bdb8aa9a (diff) |
LinGui: Add queue drag n drop reordering
Also add option to add chapter numbers to auto-generated destination name
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1693 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/main.c')
-rw-r--r-- | gtk/src/main.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gtk/src/main.c b/gtk/src/main.c index 23ed044db..6dd4aa293 100644 --- a/gtk/src/main.c +++ b/gtk/src/main.c @@ -225,6 +225,8 @@ bind_chapter_tree_model (signal_user_data_t *ud) extern void queue_list_selection_changed_cb(void); extern void queue_remove_clicked_cb(void); extern void queue_list_size_allocate_cb(void); +extern void queue_drag_cb(void); +extern void queue_drag_motion_cb(void); // Create and bind the tree model to the tree view for the queue list // Also, connect up the signal that lets us know the selection has changed @@ -236,6 +238,9 @@ bind_queue_tree_model (signal_user_data_t *ud) GtkTreeStore *treestore; GtkTreeView *treeview; GtkTreeSelection *selection; + GtkTargetEntry SrcEntry; + SrcEntry.target = "DATA"; + SrcEntry.flags = GTK_TARGET_SAME_WIDGET; g_debug("bind_queue_tree_model ()\n"); treeview = GTK_TREE_VIEW(GHB_WIDGET (ud->builder, "queue_list")); @@ -265,9 +270,17 @@ bind_queue_tree_model (signal_user_data_t *ud) gtk_tree_view_column_set_min_width (column, 24); gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column)); + gtk_tree_view_enable_model_drag_dest (treeview, &SrcEntry, 1, + GDK_ACTION_MOVE); + gtk_tree_view_enable_model_drag_source (treeview, GDK_BUTTON1_MASK, + &SrcEntry, 1, GDK_ACTION_MOVE); + g_signal_connect(selection, "changed", queue_list_selection_changed_cb, ud); g_signal_connect(cell, "clicked", queue_remove_clicked_cb, ud); - g_signal_connect(treeview, "size-allocate", queue_list_size_allocate_cb, textcell); + g_signal_connect(treeview, "size-allocate", queue_list_size_allocate_cb, + textcell); + g_signal_connect(treeview, "drag_data_received", queue_drag_cb, ud); + g_signal_connect(treeview, "drag_motion", queue_drag_motion_cb, ud); } extern void audio_list_selection_changed_cb(void); |