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 136216 - bookmark naming
bookmark naming
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.5.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
: 143179 159145 159996 170440 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-03-04 21:05 UTC by Sean Middleditch
Modified: 2011-02-04 16:18 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
implement bookmark renaming (21.95 KB, patch)
2005-02-06 06:31 UTC, Matthias Clasen
none Details | Review

Description Sean Middleditch 2004-03-04 21:05:36 UTC
Bookmarks should have an (optional) title/display name aside from their
path.  Namely, say I have two folders with the same name but in different
paths (~/Source/awemud/arch/mainline and ~/Source/scriptix/arch/mainline)
that I wish to add to the bookmarks list.  Both would show as "mainline". 
If I could change them to "AweMUD" and "Scriptix" they would become much
more useful.
Comment 1 Federico Mena Quintero 2004-03-05 18:05:25 UTC
Please see this:
http://mail.gnome.org/archives/gtk-devel-list/2004-February/msg00256.html
Comment 2 Federico Mena Quintero 2004-05-31 16:48:04 UTC
*** Bug 143179 has been marked as a duplicate of this bug. ***
Comment 3 Federico Mena Quintero 2004-05-31 16:49:00 UTC
I should have pointed out that the mail in question contains a workaround.  This
would indeed be nice to have.
Comment 4 Sven Neumann 2004-08-08 13:03:07 UTC
Asking people to create symlinks is not really a reasonable workaround,
especially since you can't do that from within the file chooser dialog. After
all bookmarks have been invented to make life easier for newbies.

IMHO the severity of this report should be changed from enhancement to major.
Comment 5 Antonio Ognio 2004-08-12 16:57:43 UTC
I also would love to see the user being able to rename any bookmark to whatever
she wants. Using symlink is a workaround for now and should work for geeks but
it's not a realistic option for all other users that we're aiming GNOME at.

Combined with the full path of the shortcut available as a tooltip 
(Bug #137503) the bookmark system could improve a lot.
Comment 6 Sven Neumann 2004-11-23 09:40:10 UTC
*** Bug 159145 has been marked as a duplicate of this bug. ***
Comment 7 Matthias Clasen 2004-11-30 19:29:58 UTC
*** Bug 159996 has been marked as a duplicate of this bug. ***
Comment 8 Morten Welinder 2004-11-30 19:40:53 UTC
Ok, dupe it is...  Importing the essence from 159996:

Bookmark naming should work for application-specific bookmarks too
(those added by gtk_file_chooser_add_shortcut_folder) and there should
be an API to set the name.

Updating version, OS, adding "I18N".
Comment 9 Christian Neumair 2005-01-31 17:13:55 UTC
Any ideas how we could implement this in a backwards-compliant way for UNIX?
Since we currently have ~/.gtk-bookmarks which contains one URI per line, I'd
suggest one of these options:

1.)
create ~/.gtk-bookmarks-links/
on rename, create a link from ~/.gtk-bookmarks-links/somename to the target
destination and add the link URI to ~/.gtk-bookmarks, removing the original URI

pro: backward-compatible
con: link/hd clutter

2.)
change ~/.gtk-bookmarks format
add optional possibility to set a name for an URI, maybe through a separator
character (like file:///home/federico###My Home)

pro: no link/hd clutter
con: not backwards-compatible at all. Will break my bookmark-applet, for instance

3.)
moving completely to a new location, maybe using GKeyFile

pro: we can even put i18n info into the bookmarks, no link/hd clutter
con: neither backwards-compatible. Might create sync headache for
pseudo-backwards compatibility (syncing old bookmarks, but those have different
 UI names?!)

4.)
adding some new association file, line:name or such

pro: no link/hd clutter
con (see 3.))
Comment 10 Sean Middleditch 2005-01-31 18:03:05 UTC
If you change the format, just use a space for the separator.  Spaces are not
valid characters in a URI, so you shouldn't have any conflicts, and it'll make
it a lot easier to use normal UNIX tools on the file.
Comment 11 Matthias Clasen 2005-02-06 06:31:57 UTC
Created attachment 37050 [details] [review]
implement bookmark renaming

Here is a patch which implements bookmark renaming. To avoid compatibility
issues, I write a separate file, $HOME/.gtk-bookmark-labels, which contains
lines of uris and labels, separated by ' '. Only bookmarks which actually have
custom labels are  listed in that file, thus .gtk-bookmarks is still necessary.
The GtkFileSystem interface gets two new methods, 

gchar	*gtk_file_system_get_bookmark_label (GtkFileSystem     *file_system,
					     const GtkFilePath *path);
void	 gtk_file_system_set_bookmark_label (GtkFileSystem     *file_system,
					     const GtkFilePath *path,
					     const gchar       *label);

In the UI, renaming is realized via a context menu on the bookmarks list with
a "Rename..." item. Since single-item menus are a bit silly, I added a "Remove"
item as well.
Comment 12 Sven Neumann 2005-02-06 13:29:58 UTC
Please do also allow to set labelled bookmarks from the application. Perhaps
gtk_file_chooser_shortcut_folder_set_label()?
Comment 13 Matthias Clasen 2005-02-06 15:40:39 UTC
Good point, I had forgotten about that. 

I also think we may want to ditch the idea of a new file, and just
change the format of .gtk-bookmarks. The file was clearly not meant or
documented as a public interface, and anybody using it right now is doing so 
his own risk.

One more think we may want to add to the file format is support for grouping
bookmarks, so that we can implement application-specific bookmarks later on.
Or we could switch to a file format that is more extensible than a mere text
file.
Comment 14 Amadeus 2005-02-06 18:59:55 UTC
Wouldn't GConf be perfect for this?

I think we have already too many .files in ours $HOME

Comment 15 Sven Neumann 2005-02-06 19:35:12 UTC
GTK+ doesn't use GConf (and it shouldn't).
Comment 16 Christian Neumair 2005-02-07 17:37:54 UTC
Matthias: EEEK! GNOME-Panel uses it. Please don't change it. This will create
major headache.

Martin: GConf CAN in fact interact with GTK+ through xsettings. But for being
ready for a non-GConf environment, we have to add a disk-backed storing anyway.
Besides, syncing GConf and files on disk is evil, since GConf internally works
with other files on the HD as well.
Comment 17 Matthias Clasen 2005-02-07 17:40:38 UTC
Well, if gnome-panel uses private interfaces, it gets what it deserves.

It can easily be fixedi to work with the both formats.  Simply cut
off uris at the first space.
Comment 18 Vincent Untz 2005-02-08 20:42:43 UTC
I can update the panel code before 2.10.0 to handle the old and the new formats.
Comment 19 Vincent Untz 2005-02-26 17:47:23 UTC
I committed code to the panel so that it supports this new format.
Comment 20 Matthias Clasen 2005-03-16 17:48:24 UTC
*** Bug 170440 has been marked as a duplicate of this bug. ***
Comment 21 Matthias Clasen 2005-03-22 20:29:28 UTC
2005-03-22  Matthias Clasen  <mclasen@redhat.com>

	Implement bookmark renaming  (#136216, Sean Middleditch)
	
	* gtk/gtkfilesystem.h (struct _GtkFileSystemIface): Add 
	get_bookmark_label and set_bookmark_label vfuncs.

	* gtk/gtkfilesystem.h:
	* gtk/gtkfilesystem.c (gtk_file_system_set_bookmark_label): 
	(gtk_file_system_get_bookmark_label): Wrappers for the
	vfuncs.

	* gtk/gtk.symbols: Add new exported symbols.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_set_bookmark_label): 
	(gtk_file_system_unix_get_bookmark_label): Implementations
	for the Unix backend.

	* gtk/gtkfilechooserdefault.c: Add a context menu to
	the bookmarks pane, and allow to rename bookmarks.