GNOME Bugzilla – Bug 137503
Shortcuts should show location as tooltip
Last modified: 2008-05-24 18:57:00 UTC
Shortcuts should reveal where they go as a tooltip.
Need a tooltip mechanism for GtkTreeView.
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.
You need to fix 80980 first...
*** Bug 155925 has been marked as a duplicate of this bug. ***
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
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).
Created attachment 110906 [details] [review] Updated patch. * Use g_file_get_parse_name * Don't leak GtkTreePath
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 */
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.
Looks fine to me.
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).