Now that _gtk_file_chooser_uri_has_prefix() deals with NULL prefix lists,
we can remove all such checks.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
This allows us to just call that function with whatever root_uris we
have, instead of manually comparing the root_uris for NULL every time.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
Roots will be shown only if:
1) They're not the user's Desktop or Home directories (which would already
be listed otherwise).
2) It's not the URI of an existing volume.
3) The parent volume isn't already a root.
4) The root actually does exist (preventing non-browseable roots, like "ftp:")
This introduces support for multiple roots on the file chooser. Instead
of rooting to a single URI, there can now be several roots, which will be
taken into account when selecting files, typing custom file paths, or showing
parts of the UI.
This makes it possible to, for example, limit the file chooser to the user's
home directory and memory stick.
This changes the path bar to only show those folders accessible within
the root URI. If a particular folder has been set as the root URI, it will
appear as the top-most button in the path bar, much like the File System
does.
This also hides the scroll buttons in the Path Bar when no buttons are set
(in the case of an invalid root URI) and hides the left scroll button if the
first shown folder is the very first folder in the path bar.
The old custom shortcut code assumed that the entry would be added to the
sidebar and never removed programatically within that instance of the file
chooser. That, clearly, doesn't work when dynamically changing the root URIs.
We now maintain a list of added custom shortcuts and add/remove these based
on the root URI whenever the root changes.
Root URI and Local Only properties are very similar, so this change combines
them into one concept. A root URI of "file://" is now the same as the old
Local Only. The old Local Only property remains, and we may even want to keep
it around indefinitely, but it just simply wraps a root URI of "file://".
The set_local_only and set_root_uri functions have been merged, and improved
logic for setting the current folder on root URI/local-only property changes
has been added.
The Recently Used list only shows matches that are within the root URI.
The entry in the sidebar is available at all times, as recently used items
can be on remote URIs.
The sidebar generation code has been made more flexible so that it can be
run more than once, instead of assuming it will only ever be run once.
Various sidebar entries are now dependent on the type of root. Search, for
example, only shows up with a file:-based root.
When deciding whether a volume can be added, the root URI is checked to make
sure the volume resides within that root.
The only UI elements (shortcuts, bookmarks, special folders, etc.) that will
show up are ones within the root URI.
At this point, we have the UI filtering out the special sidebar entries
that are not within the root URI, and we have some API calls set up for
specifying the root URI.
Future changes will limit browsing within the root URI, limit search
results, and other such fixes.
When a file was inserted during the period that the editable row was
active, the node IDs would not get updated correctly.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
WM_KILLFOCUS means that a keyboard grab (not a pointer grab), if any,
has been broken. I don't think this bug has matterd much as gtk
generates a grab-broken-event signal for both keybord and pointer
grabs being broken anyway.
We now exit early from gdk_window_register_dnd() to avoid crashing if the
window type is GDK_WINDOW_OFFSCREEN and does not support dnd operations.
This makes it possible to use any dnd-enabled widgets, such as GtkEntry,
within a GtkOffscreenWindow.
* gtk/gtkrange.c: (gtk_range_adjustment_value_change):
Queue the draw also if the range is a scale and the value is drawn,
fixing bug #533946 (Markus Brinkmann), when two HScales use one
adjustment.