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 137503 - Shortcuts should show location as tooltip
Shortcuts should show location as tooltip
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
unspecified
Other All
: Normal enhancement
: Medium feature
Assigned To: gtk-bugs
Federico Mena Quintero
: 155925 (view as bug list)
Depends on: 80980
Blocks:
 
 
Reported: 2004-03-17 15:44 UTC by Morten Welinder
Modified: 2008-05-24 18:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implements a query_tooltip callback and shows the URI for path shortcuts (2.17 KB, patch)
2008-05-08 23:28 UTC, Jan Arne Petersen
needs-work Details | Review
Updated patch. (2.41 KB, patch)
2008-05-14 14:34 UTC, Jan Arne Petersen
needs-work Details | Review
Updated Patch (Use gtk_file_system_path_to_uri) (2.49 KB, patch)
2008-05-15 15:27 UTC, Jan Arne Petersen
accepted-commit_now Details | Review

Description Morten Welinder 2004-03-17 15:44:21 UTC
Shortcuts should reveal where they go as a tooltip.
Comment 1 Federico Mena Quintero 2004-04-14 21:18:20 UTC
Need a tooltip mechanism for GtkTreeView.
Comment 2 Antonio Ognio 2004-08-12 17:02:44 UTC
Could someone please provide some hints on how this mechanism could/should be
implemented? Are there any messages at mailing lists related to this topics? Is
a bug filed related to this?

I'll try to do a little research and post the findings here.
Comment 3 Matthias Clasen 2004-08-12 17:08:42 UTC
You need to fix 80980 first...
Comment 4 Matthias Clasen 2004-12-31 06:52:19 UTC
*** Bug 155925 has been marked as a duplicate of this bug. ***
Comment 5 Jan Arne Petersen 2008-05-08 23:28:59 UTC
Created attachment 110607 [details] [review]
Implements a query_tooltip callback and shows the URI for path shortcuts

TODO:
* Use something like g_file_get_parse_name () to get a nice full-pathname string
* Add tooltips for volumes
* Add tooltips for search and recent
Comment 6 Federico Mena Quintero 2008-05-14 03:01:11 UTC
Nice work!  It leaks the GtkTreePath, though.  Simply pass NULL for the path to _get_tooltip_context(), since you don't seem to use the path at all.

Using the parse_name is a good idea.  Can you please implement that?  I guess the patch will be ready to commit once that is done (we can handle volumes and search later).
Comment 7 Jan Arne Petersen 2008-05-14 14:34:45 UTC
Created attachment 110906 [details] [review]
Updated patch.

* Use g_file_get_parse_name
* Don't leak GtkTreePath
Comment 8 Federico Mena Quintero 2008-05-15 15:02:51 UTC
This is looking very good.  One last thing:  you have

+	  file = g_file_new_for_uri (gtk_file_path_get_string (col_data));

However, GtkFilePath may not always contain a URI.  If the file chooser is using the Unix backend, then the shortcut paths will contain plain filenames.  Can g_file_new_for_uri() take non-URI strings?  It should be safer to promote all paths to URIs.

For bonus points, what gets shown in the tooltip should be something like this:

* If paths are filenames or URIs with a file:// scheme, you want to show only the filename part.

* If paths are URIs with a non-file:// scheme, you want to show the whole URI.

path = (GtkFilePath *) col_data;
uri = gtk_file_system_path_to_uri (path); /* promote to URI */

file = g_file_new_for_uri (uri);

if (g_file_is_native (file))
    /* etc */
Comment 9 Jan Arne Petersen 2008-05-15 15:27:25 UTC
Created attachment 110960 [details] [review]
Updated Patch (Use gtk_file_system_path_to_uri)

> For bonus points, what gets shown in the tooltip should be something like this:

g_file_get_parse_name should do it like that.
Comment 10 Matthias Clasen 2008-05-24 04:02:47 UTC
Looks fine to me.
Comment 11 Jan Arne Petersen 2008-05-24 18:57:00 UTC
2008-05-24  Jan Arne Petersen  <jpetersen@jpetersen.org>

	* gtk/gtkfilechooserdefault.c: (shortcuts_query_tooltip_cb),
	(shortcuts_list_create): Show parse name as tooltip for path
	shortcuts (#137503).