GNOME Bugzilla – Bug 153212
Have the Paste kbd shortcut jump to the location in the buffer
Last modified: 2006-06-12 15:10:49 UTC
Typing "Ctrl+V" (in the default shortcuts) would select the file pointed to in the clipboard buffer. For example, if "/etc/resolv.conf" was in the clipboard buffer, the "Ctrl+V" combination should bring up the file chooser in the same state as typing: Ctrl+L (followed by) /etc/resolv.conf<Enter>
This should also be the action with manually selected and dragged text (the so called mouse copy&paste). It's not uncommon to have URI:s that are not highlighted (URI objects) but are still valid (mainly programs that don't do links). And of course this should enable local file URI:s without the protocol (file:).
A good alternative suggestion from the usability list that didn't get a reply there (Mattias Karlsson, 20 Sept 2004): ----- Why not make pasting in the file chooser behave as if the user first pressed Ctrl-L and then pasted the content? This would make it possible to paste an invalid path and then edit it. E.g. you could paste: "/urs/local/bin/foo" and then edit it to "/usr/bin/foo" (even if the former file doesn't exist). ----- I.e. in hadess's example in this bug's opening comment, the trailing <enter> wouldn't be included.
Created attachment 36725 [details] [review] Proposed Patch (according to comment 3) This is an implementation of Matthias' suggestion. Would you mind trying out whether it fits your needs? Should we do some pre-parsing magic before passing the text to location_popup_handler? gtk_file_system_unix_parse complains about not having received an absolute path if the pasted text isn't a valid local UNIX path.
Created attachment 36726 [details] [review] Sorry, wrong patch.
> A good alternative suggestion from the usability list that didn't get a reply > there (Mattias Karlsson, 20 Sept 2004) The default behavior should be to select the file pointed to in the clipboard buffer. Only when the selection doesn't point to an existing file should the file chooser behave as if the user first pressed Ctrl-L and then pasted the content.
The patch is on a good track here. It would be nice if it did these as well: - Add a text/uri-list target - Add a _NETSCAPE_URL target - I think this is also called something else in newer Mozillas.
Created attachment 58994 [details] [review] gtk-file-chooser-handle-paste.patch Updated Christian's patch for the current CVS, and implemented "Turing Test"'s suggestion. Federico, what does DnD targets have to do with this bug?
Bastian, if you are handling paste in some way, it is usually a good idea to implement the same handling for drops.
*** Bug 340086 has been marked as a duplicate of this bug. ***
There's already DnD drop support builtin to the filechooser. You can drop files/directories from a file manager onto the filelist, or the bookmarks.
2006-06-12 Matthias Clasen <mclasen@redhat.com> * gtk/gtkfilechooserdefault.c: Add support for pasting filenames into the filechooser. (#153212, Bastian Nocera)