This is Tristan's *excellent* work, minus the old code for the shortcuts bar - that is all done
in GtkPlacesSidebar now.
The UI gets loaded from a Glade resource; most of the old code to create the UI by hand is gone.
There is still code for save_widgets_create(); this needs to be moved into the UI file, but it
is not a big deal.
gtk_file_chooser_default_init() calls a new post_process_ui() that takes care of all the things
that cannot be done directly in Glade.
Having the changes for composite widget templates makes it impossible
to merge the places-sidebar branch. So, we will merge that branch,
and *then* apply the changes for composite templates.
This reverts commit bf909f5615.
In the case of checking for local_only, g_file_is_native() is not useful, since it
will return FALSE for something in a FUSE mount.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
Since FUSE locations can be handled safely by applications show these mounted locations regardless of whether gtk_file_chooser_set_local_only()
is set to TRUE
https://bugzilla.gnome.org/show_bug.cgi?id=586367
Previously we could end up in a situation where browse_list_model==NULL, and yet load_state==LOAD_FINISHED.
This is not a valid state. So, when we get rid of the list model, really ensure that we end up
in LOAD_EMPTY so nothing assumes that there is a valid list model around.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This is akin to commit cfb09e5654 in the gtk-2-24 branch;
the last_folder_uri is no longer being used for anything meaningful, so we
remove it altogether.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
The code is always instantiating this schema at a fixed location, so why
is it relocatable?
Add a path so that it shows up properly in dconf-editor, and from the
gsettings commandline tool.
https://bugzilla.gnome.org/show_bug.cgi?id=692163
We used to have set_current_location() and get_selected_location(), with confusing
semantics. Now they are symmetric, with the exception that if set_location() is
called with a location that is not shown in the sidebar, then it will both clear
the selection in the list and make get_selection() return NULL.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This lets us handle the 'Open in new tab' and 'Open in new window' menu items
on our own, and allows callers to have less code to deal with each mode.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
We still lack a button to activate Search, like in Nautilus, but that will come later.
And with this, the last REMOVE_FOR_PLACES_SIDEBAR is gone!
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
Reading recent:/// as-is is probably fine for OPEN mode. But for SAVE mode, we want to present
a list of recent directories. So, we go back to our old machinery for now; in the future
we'll probably just use recent:/// and extract the list of recent directories from there.
This also fixes showing the Recent item as highlighted when the file chooser starts up.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
Oh, the giant void.
I stare into it
and it makes me afraid
that I've screwed up.
But I know I haven't.
Because any remaining bugs
will be yours to fix.
Not mine.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
That URI is not a native file, and so it would not show up if local_only=TRUE.
Add a special case for it so that recent:/// can always be visited.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
It has two possible values, 'recent' and 'cwd'. We will use these to determine
whether to set the default starting mode, if a folder has not been pre-set,
to showing the Recent Files list or the current working directory.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
Application code can set shortcut folders that are already bookmarks.
This code causes the bookmarks to be refreshed after the shortcut is
added removing any possible bookmark duplicates
https://bugzilla.gnome.org/show_bug.cgi?id=577806