! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Allow UCA in drag and drop menu
Status:
RESOLVED: MOVED
Severity:
enhancement

Comments

Description brunoaiss+xfce 2019-10-29 08:27:52 CET
Allow User Custom Actions for the right click drag menu.

This would require making new % replacements. Here are examples, the letters are debatable.

%l -> The last full path of the first selected file
%L -> The last full path of the all selected files (separated by spaces and their own spaces escaped)
Optionally, also this:
%g -> The directory containing the file passed in %l
%G -> The directory containing the files passed in %l

If the nodes are not moved, these options still appear and these substitutions behave the same as their counter-parts %f, %F, %d, %D.

%G is only there for completions sake... It can easily make no sense at all as %G and %g are exact same.

As for deciding if this UCA appears in the drag and drop menu, just search if any of %g, %G, %l, %L are used... At least, as a first intention.
There can also be a hidden option about this for whoever wants to customize.


In my use-case, I'd to order a compression of files from one directory to another (In this case, essentially, reducing the total time it takes and possibly not having to have a copy of the same on disk)
Comment 1 alexxcons editbugs 2019-10-29 14:30:28 CET
(In reply to brunoaiss+xfce from comment #0)
> Allow User Custom Actions for the right click drag menu.
> %l -> The last full path of the first selected file
I am not sure what you want here. What is "the last full path" ? ... there is already %n which will give you just the filename of the first selected file.
Maybe you can put an example ?

IMO tho only new % thing required would be, that the script should know the destination folder.
E.g. %X -->  "Drop folder in case of RIght Click Drag and Drop UCA, empty otherwise"

For appearance, I would put it as simple as providing a checkbox "this is a right click drag and drop UCA" or something similar, so that it is only displayed in the right click menu.  And than use the existing selectors.
Comment 2 brunoaiss+xfce 2019-10-29 19:27:43 CET
I used the term "last full path" so I could make sense for the "%l". It is the full path when joining the Path of the directory to where the contents were dropped.
Example:
Source file: /sources/example/e x/file1.gif
Source file: /sources/example/e x/file2.gif
Source file: /sources/example/e x/file3.gif
Source file: /sources/example/e x/file4.gif

Destination directory: /destinations/example/e x

%f -> /sources/example/e\ x/file1.gif
%F -> /sources/example/e\ x/file1.gif /sources/example/e\ x/file2.gif /sources/example/e\ x/file3.gif /sources/example/e\ x/file4.gif
%d -> /sources/example/e\ x/
%D -> /sources/example/e\ x/ /sources/example/e\ x/ /sources/example/e\ x/ /sources/example/e\ x/
%l -> /destinations/example/e\ x/file1.gif
%L -> /destinations/example/e\ x/file1.gif /destinations/example/e\ x/file2.gif /destinations/example/e\ x/file3.gif /destinations/example/e\ x/file4.gif
%g -> /destinations/example/e\ x/
%G -> /destinations/example/e\ x/ /destinations/example/e\ x/ /destinations/example/e\ x/ /destinations/example/e\ x/


It is true that for my own use-case, only %g, %F and %n are useful but I believe other users can have other ideas where the other replacements become needed.

>For appearance, I would put it as simple as providing a checkbox "this is a right click drag and drop UCA" or something similar, so that it is only displayed in the right click menu.  And than use the existing selectors.
That's fine for me.
Comment 3 alexxcons editbugs 2019-10-29 22:13:56 CET
(In reply to brunoaiss+xfce from comment #2)
> It is true that for my own use-case, only %g, %F and %n are useful but I
> believe other users can have other ideas where the other replacements become
> needed.
I would not make it that complicated. UCA in the right-click drag & drop is already an exotic case ... to introduce conveniance extra placeholders just for that exotic case IMO is overengeneering and just will add confusion for all other UCA users which are not interested in dnd UCA. Specially because %l and %L are not very self explaining.
On top you cannot know in advance if every dnd UCA user wants to have "%g/%n" as new filenames .. possibly instead a name chooser dialog has to be opened, or a subfolder wil be created or other fancy stuff. I dont want to make any assumptions on that.

I think it is appropriate for something exotic like a dnd context menu, that everybody who wants to make use of it provides a script to concat the new filepaths by using %g and %n (or whatever is desired).

I would just foresee %g.
%G does not make much sense for me, since we only have one drop directory.
Comment 4 brunoaiss+xfce 2019-10-29 22:18:26 CET
Alright. Your explanation seems reasonable enough.
Do you want to keep the %g? Any ideas of a better letter?
Comment 5 alexxcons editbugs 2019-10-29 22:55:03 CET
(In reply to brunoaiss+xfce from comment #4)
> Alright. Your explanation seems reasonable enough.
> Do you want to keep the %g? Any ideas of a better letter?

Thanks !  Possibly %t for "target directory" ? I dont have a strong preference on the letter.
Comment 6 brunoaiss+xfce 2019-10-30 10:02:42 CET
>I dont have a strong preference on the letter.
Me neither

>Possibly %t for "target directory" ?
Yep. Sounds good to me!. %t it is.
Comment 7 Git Bot editbugs 2020-05-26 23:46:47 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/thunar/-/issues/269.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #16100

Reported by:
brunoaiss+xfce
Reported on: 2019-10-29
Last modified on: 2020-05-26

People

Assignee:
Xfce Bug Triage
CC List:
1 user

Version

Version:
unspecified

Attachments

Additional information