[caja] 01/01: debian/patches: Add 0007_drag-and-drop-to-bookmarks-in-side-pane.patch. Allow the user to drag'n'drop files into the bookmark section. (Closes: #786395).

Pablo Barciela zenwalker-guest at moszumanska.debian.org
Mon Apr 24 00:18:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

zenwalker-guest pushed a commit to branch debian/jessie/updates
in repository caja.

commit 6e033eb58e6b43400e0a00e1a78c851b6115e006
Author: Pablo Barciela <scow at riseup.net>
Date:   Mon Apr 24 02:16:00 2017 +0200

    debian/patches: Add 0007_drag-and-drop-to-bookmarks-in-side-pane.patch. Allow the user to drag'n'drop files into the bookmark section. (Closes: #786395).
---
 ...7_drag-and-drop-to-bookmarks-in-side-pane.patch | 119 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 2 files changed, 120 insertions(+)

diff --git a/debian/patches/0007_drag-and-drop-to-bookmarks-in-side-pane.patch b/debian/patches/0007_drag-and-drop-to-bookmarks-in-side-pane.patch
new file mode 100644
index 0000000..20afb4c
--- /dev/null
+++ b/debian/patches/0007_drag-and-drop-to-bookmarks-in-side-pane.patch
@@ -0,0 +1,119 @@
+From 679688892cb9ea63606c41998ba4ed22642f36a2 Mon Sep 17 00:00:00 2001
+From: Monsta <monsta at inbox.ru>
+Date: Thu, 18 Jun 2015 16:09:40 +0300
+Subject: [PATCH] places-sidebar: enable both creating bookmarks and dropping
+ files
+
+- drag a folder to the top or bottom of the bookmark list to add
+a new bookmark. a horizontal line will be shown and the mouse
+pointer will have a '+' at its right side.
+- if there are no bookmarks (and that section isn't shown), drag
+a folder over the computer section's heading. this will add a new
+bookmark and make the bookmarks list visible.
+- drag a file or a folder over some existing bookmark to move it
+into the bookmarked folder. the mouse pointer will have an arrow
+at its right side.
+- if you want to copy a file or a folder there instead, perform
+the same operation but hold ctrl during that. the mouse pointer
+will have a '+' at its right side. no horizontal line will be
+shown, so you will be able to distinguish this operation from
+adding a new bookmark. :)
+
+adapted from https://github.com/mate-desktop/caja/commit/3fdb9a14077b14263e8acfc93addc8fbcf568ca1
+with adjustments for 1.8 (different order of sidebar sections)
+---
+ src/caja-places-sidebar.c | 38 ++++++++++++++++++++++++--------------
+ 1 file changed, 24 insertions(+), 14 deletions(-)
+
+diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c
+index f797497..1b45bdf 100644
+--- a/src/caja-places-sidebar.c
++++ b/src/caja-places-sidebar.c
+@@ -1130,11 +1130,13 @@ compute_drop_position (GtkTreeView *tree_view,
+                         PLACES_SIDEBAR_COLUMN_SECTION_TYPE, &section_type,
+                         -1);
+ 
+-    if (place_type == PLACES_HEADING && section_type != SECTION_BOOKMARKS) {
+-        /* never drop on headings, but special case the bookmarks heading,
+-         * so we can drop bookmarks in between it and the first item.
++    if (place_type == PLACES_HEADING &&
++        section_type != SECTION_BOOKMARKS &&
++        section_type != SECTION_COMPUTER) {
++        /* never drop on headings, but the bookmarks or computer heading
++         * is a special case, so we can create new bookmarks by dragging
++         * at the beginning or end of the bookmark list.
+          */
+-
+         gtk_tree_path_free (*path);
+         *path = NULL;
+ 
+@@ -1145,17 +1147,19 @@ compute_drop_position (GtkTreeView *tree_view,
+         sidebar->drag_data_received &&
+         sidebar->drag_data_info == GTK_TREE_MODEL_ROW) {
+         /* don't allow dropping bookmarks into non-bookmark areas */
+-
+-    gtk_tree_path_free (*path);
+-    *path = NULL;
++        gtk_tree_path_free (*path);
++        *path = NULL;
+ 
+         return FALSE;
+     }
+ 
+-    if (section_type == SECTION_BOOKMARKS) {
++    /* drag to top or bottom of bookmark list to add a bookmark */
++    if (place_type == PLACES_HEADING && section_type == SECTION_BOOKMARKS) {
+         *pos = GTK_TREE_VIEW_DROP_AFTER;
++    } else if (place_type == PLACES_HEADING && section_type == SECTION_COMPUTER) {
++        *pos = GTK_TREE_VIEW_DROP_BEFORE;
+     } else {
+-        /* non-bookmark shortcuts can only be dragged into */
++        /* or else you want to drag items INTO the existing bookmarks */
+         *pos = GTK_TREE_VIEW_DROP_INTO_OR_BEFORE;
+     }
+ 
+@@ -1266,10 +1270,10 @@ drag_motion_callback (GtkTreeView *tree_view,
+     }
+ 
+     if (pos == GTK_TREE_VIEW_DROP_BEFORE ||
+-            pos == GTK_TREE_VIEW_DROP_AFTER )
++        pos == GTK_TREE_VIEW_DROP_AFTER )
+     {
+         if (sidebar->drag_data_received &&
+-                sidebar->drag_data_info == GTK_TREE_MODEL_ROW)
++            sidebar->drag_data_info == GTK_TREE_MODEL_ROW)
+         {
+             action = GDK_ACTION_MOVE;
+         }
+@@ -1527,7 +1531,7 @@ drag_data_received_callback (GtkWidget *widget,
+     success = FALSE;
+ 
+     if (tree_pos == GTK_TREE_VIEW_DROP_BEFORE ||
+-            tree_pos == GTK_TREE_VIEW_DROP_AFTER)
++        tree_pos == GTK_TREE_VIEW_DROP_AFTER)
+     {
+         model = gtk_tree_view_get_model (tree_view);
+ 
+@@ -1538,14 +1542,20 @@ drag_data_received_callback (GtkWidget *widget,
+ 
+         gtk_tree_model_get (model, &iter,
+                             PLACES_SIDEBAR_COLUMN_SECTION_TYPE, &section_type,
+-                                PLACES_SIDEBAR_COLUMN_ROW_TYPE, &place_type,
++                            PLACES_SIDEBAR_COLUMN_ROW_TYPE, &place_type,
+                             PLACES_SIDEBAR_COLUMN_INDEX, &position,
+                             -1);
+ 
+-        if (section_type != SECTION_BOOKMARKS) {
++        if (section_type != SECTION_BOOKMARKS &&
++            !(section_type == SECTION_COMPUTER && place_type == PLACES_HEADING)) {
+             goto out;
+         }
+ 
++        if (section_type == SECTION_COMPUTER && place_type == PLACES_HEADING &&
++            tree_pos == GTK_TREE_VIEW_DROP_BEFORE) {
++            position = caja_bookmark_list_length (sidebar->bookmarks);
++        }
++
+         if (tree_pos == GTK_TREE_VIEW_DROP_AFTER && place_type != PLACES_HEADING) {
+             /* heading already has position 0 */
+             position++;
diff --git a/debian/patches/series b/debian/patches/series
index cd1b18b..cf118f5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@
 0004_avoid-automounts-while-screen-is-locked.patch
 0005_fix-tree-view-open-in-new-window.patch
 0006_dont-crash-in-show-hidden-files.patch
+0007_drag-and-drop-to-bookmarks-in-side-pane.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/caja.git



More information about the pkg-mate-commits mailing list