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 153211 - Add a "Copy Location" contextual menu item
Add a "Copy Location" contextual menu item
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
unspecified
Other Linux
: Normal normal
: Small feature
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-09-20 22:30 UTC by Bastien Nocera
Modified: 2013-01-20 22:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk-file-chooser-copy-location.patch (4.50 KB, patch)
2006-06-16 09:42 UTC, Bastien Nocera
needs-work Details | Review

Description Bastien Nocera 2004-09-20 22:30:11 UTC
It would be useful to be able to copy the location of a specific file into the
clipboard in the file chooser by right-clicking and selecting "Copy Location".
Comment 1 Gabor Farkas 2004-09-21 10:09:14 UTC
wouldn't it make more sense in Nautilus?

after all... for me it seems that gtkFileSel was created to let the users open
files in a certain application.

if someone wants to find out where one of his files is, imho it's more intuitive
to launch the file manager = nautilus.

actually i was pretty sure that there's a copy-location entry in the right-click
menu for a file in nautilus, but there was not ... 

i think it was because in web browsers there's always is a copy-link-address
entry in the right click dialog...
Comment 2 Gabor Farkas 2004-09-21 10:14:41 UTC
sorry.i take it back...

i found out that you can right-click in nautilus on a file, select 'preferences',
and copy the 'Location' entry out.
so i modify my comment:

if you need to get the filename of a file, you can do that already with nautilus.

imho there's no need to do it also in gtkFileSel.
Comment 3 Murray Cumming 2004-09-21 11:50:38 UTC
> imho there's no need to do it also in gtkFileSel

It would be useful.
Comment 4 Sven Neumann 2005-01-23 21:39:16 UTC
I agree that it would be a useful option and since the right-click menu has
enough room left for such a feature, it should IMO be added.
Comment 5 Bastien Nocera 2006-06-16 09:42:09 UTC
Created attachment 67477 [details] [review]
gtk-file-chooser-copy-location.patch

First pass at a patch. Would need more error checking in some functions. Questions are:
- what do we do about multiple files being selected?
- do we want tooltips?
- do we want Ctrl+C to copy the selection as well?
Comment 6 erik_m85 2007-08-26 21:49:29 UTC
Would it be easier to put a "Copy path" item in a (new) context menu of the path-buttons (one per directory level) that appear over the Location text field. (At least in Gnome 2.18.1)
Since you can never right click on more than one of these, the issue of having multiple files selected won't occur there.
It is also the place where I was first looking for a "Copy path" feature, now when I felt that I needed one. Of course it would not include the file name component, which could certainly be usedful. So if the above patch can be finished then it would be even better.

I hope that such a context menu is easy to add. I might even try to do it myself. But I've never programemd GTK or Gnome, and I probably won't start within a month. Or should I just try to review the existing patch (that actually tryes to add a "better" feature, including the file name too)? Is there any good reason why copying a path should be forbidden, so that a patch will be rejected?

As for #2 :
Opening a new Nautilus, navigating N directories deep, opening properties and copying the entire path of a file would take about 6 + N clicks or keybord commands. To open a GtkFileChooserDialog from an application that has the current file open, right click and select "copy path" is 3 clicks or keys (2 if Ctrl+C would also work).
It also seems more intuitive to mee, since the dialog was what I used to open or save the file just recently, thus the place that I associate with handling the path of that file.
It is (thankfully!) possible to paste full paths into GtkFileChooserDialog, why not allow the natural counterpart - to copy a currently navigated/selected path?
Comment 7 Alexandre Prokoudine 2007-09-12 11:27:33 UTC
Any update on this?
Comment 8 Matthias Clasen 2013-01-20 22:55:58 UTC
There is a 'Copy file's location' context menu item nowadays.