After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 153212 - Have the Paste kbd shortcut jump to the location in the buffer
Have the Paste kbd shortcut jump to the location in the buffer
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
unspecified
Other Linux
: Normal normal
: Small feature
Assigned To: gtk-bugs
Federico Mena Quintero
: 340086 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-09-20 22:33 UTC by Bastien Nocera
Modified: 2006-06-12 15:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed Patch (according to comment 3) (15.38 KB, patch)
2005-01-30 16:16 UTC, Christian Neumair
none Details | Review
Sorry, wrong patch. (3.18 KB, patch)
2005-01-30 16:17 UTC, Christian Neumair
needs-work Details | Review
gtk-file-chooser-handle-paste.patch (3.24 KB, patch)
2006-02-09 11:48 UTC, Bastien Nocera
none Details | Review

Description Bastien Nocera 2004-09-20 22:33:38 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>
Comment 1 Kalle Vahlman 2004-09-21 06:09:40 UTC
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:).
Comment 2 John Keller 2004-09-30 15:39:22 UTC
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.
Comment 3 Christian Neumair 2005-01-30 16:16:16 UTC
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.
Comment 4 Christian Neumair 2005-01-30 16:17:04 UTC
Created attachment 36726 [details] [review]
Sorry, wrong patch.
Comment 5 TuringTest 2005-04-14 17:19:28 UTC
> 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.
Comment 6 Federico Mena Quintero 2005-04-28 23:03:36 UTC
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.
Comment 7 Bastien Nocera 2006-02-09 11:48:04 UTC
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?
Comment 8 Matthias Clasen 2006-02-10 15:19:06 UTC
Bastian, if you are handling paste in some way, it is usually a good idea to
implement the same handling for drops.
Comment 9 Federico Mena Quintero 2006-05-02 14:08:06 UTC
*** Bug 340086 has been marked as a duplicate of this bug. ***
Comment 10 Bastien Nocera 2006-06-09 09:19:49 UTC
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.
Comment 11 Matthias Clasen 2006-06-12 15:10:49 UTC
2006-06-12  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c: Add support for pasting
	filenames into the filechooser.  (#153212, Bastian Nocera)