Sharing the places sidebar between Nautilus and GTK+
- From: Federico Mena Quintero <federico gnome org>
- To: gtk-devel-list <gtk-devel-list gnome org>
- Cc: nautilus-list gnome org, jmccann redhat com
- Subject: Sharing the places sidebar between Nautilus and GTK+
- Date: Tue, 06 Sep 2011 17:44:01 -0500
There is a patch in , by Jon McCann, to make the shortcuts bar in
GtkFileChooser be pretty much the same as the one in Nautilus.
Rather than patch the wobbly edifice that is gtkfilechooserdefault.c,
this sounds like the perfect time to actually pull out the shortcuts bar
as a public class of its own, that is shared by both the file chooser
My plan is this:
1. Copy nautilus-places-sidebar.[ch] into the GTK+ sources.
3. Remove obvious nautilus-isms like the use of nautilus_bookmark, which
should be easy enough to replicate in GTK+ (or with things which already
happen through the file chooser's code).
4. See what common, public interfaces we need. For example,
nautilus_window_set_initiated_unmount (sidebar->window, TRUE);
seems like it could be replaced with a signal on the GtkPlacesSidebar
class, and then Nautilus can start a spinner or whatever when an unmount
operation starts. Another common interface would be something like
gtk_places_sidebar_select_path (sidebar, "file:///foo/selected") to
highlight a particular item.
5. See what nautilus-isms *should* be doable with plain GIO, and see if
there is anything else that Nautilus needs to do about them via signals;
maybe for something like
nautilus_file_operations_mount_volume_full (NULL, volume,
6. See what things should be available or not in the file chooser...
when dropping files on the shortcuts bar, Nautilus can do
nautilus_file_operations_copy_move (uris, NULL, drop_uri,
real_action, GTK_WIDGET (tree_view),
Same thing for
nautilus_file_operations_empty_trash (GTK_WIDGET (sidebar->window));
I'm starting a branch in GTK+, "places-sidebar" to do this. Comments
are appreciated, especially from Nautilus hackers who may know dark
places in this code well.
One little caveat: that part of Nautilus is GPL, and GTK+ is LGPL,
although it *seems* that the places sidebar code may initially have come
from GTK+ and then reworked heavily. I haven't checked the history
closely. What do we do about this?
] [Thread Prev