Setting a tooltip on a widget unfortunately triggers several roundtrips
to the X server. We reduce this overhead by only doing it if the
widget is visible, and by deferring to an idle. See bug 585626.
The virtual method list_shortcut_folders returns a GSList * of GFile *.
In turn, gtk_file_chooser_list_shortcut_folders() converts those to strings.
However, the delegate in gtkfilechooserutils.c was calling
gtk_file_chooser_list_shortcut_folders() every time, so we were trying
to convert invalid data.
Now we have an internal function that deals with GFile *. That
function is called by the delegate, and the conversion is done only
once by the API entry points.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
We can't set the sort column when we load the GtkFileChooser's settings, as the
file models may not have been created yet. Wait until the models are actually
present; then we can set the sort column.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
Use g_*gettext functions in gdk-pixbuf instead direct gettext
calls to benefit from the maybe-dont-translate functionality
in GLib. Also, replace a hand-rolled version by g_dpgettext2
in gtkbuilderparser.c. Fixes bug 585791.
The documentation for the function says that the app_exec string
should be freed, but we return a pointer to the internal string
without duplicating it. Since the app_exec string is valid as long
as the GtkRecentInfo is valid the documentation should be fixed
and the out argument should be constified. Fixes#584832.
(gtk_cell_renderer_pixbuf_set_property): add back evil code that makes
sure that the current image is only unset if the new image was created
from the same property or the new property is not NULL.
GtkFileChooserDefault actually implements a binding signal for
Backspace, to make it go to the parent directory. However,
GtkTreeView was eating our Backspace, and thus the file chooser was
not getting a chance to execute its binding signal.
GtkTreeView implements a Backspace binding itself, which it uses to
move to the parent node of the current cursor node. However, the
binding handler would return TRUE even if there was no parent to the
current node. Now the binding handler only returns TRUE if it
actually changed the cursor.
Additionally, gtk_tree_view_key_press() sees if no bindings handled a
key press; in that case, it re-sends the key press to the treeview's
search entry. However, sending a Backspace to an empty entry makes
the entry beep. Thus, we add a flag that gets set from GtkTreeView's
Backspace binding handler, to tell gtk_tree_view_key_press() when it
should *not* re-emit the key press on the search entry. Sort of,
"yeah, I didn't handle this key press, but I don't want you to send it
to the search entry, either!".
Signed-off-by: Federico Mena Quintero <federico@novell.com>
We can use this to test bugs that happen when setting a filename before the
file chooser is shown, as in bgo#161670
Signed-off-by: Federico Mena Quintero <federico@novell.com>
The previous patch for this bug was about the initial *file* not existing,
but this also handles the initial *folder* not existing
(such as /usr/nonexistent/nonexistent.txt).
Signed-off-by: Federico Mena Quintero <federico@novell.com>
We now use a GtkSizeGroup to control the vertical size of the various widgets
that get put in the path bar's area: the location bar, the search entry,
the recently-used title label.
This keeps the shortcuts pane and the file list from jumping up and down
when one switches between operation modes (browse/search/recently-used).
Signed-off-by: Federico Mena Quintero <federico@novell.com>
Among other things, the description mentions the problem in
bug 585024, that some settings may not be available before the
widget class has been realized.