Commit Graph

715 Commits

Author SHA1 Message Date
Tristan Van Berkom
a6f9ef0d3a Load the file chooser's widgets from the .ui file
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.
2013-04-15 19:29:12 -05:00
Federico Mena Quintero
4d4904ed8a Move all of GtkFileChooserDefault's fields into a private structure
I love Emacs macros, by the way.
2013-04-11 22:44:19 -05:00
Federico Mena Quintero
b0eed8680c Move GtkFileChooserDefault to gtkfilechooserdefault.c
We will move all the fields to a private structure next.
2013-04-11 21:44:21 -05:00
Federico Mena Quintero
5b827c53e5 Merge branch 'places-sidebar' into master
This lands the GtkPlacesSidebar widget.  It is used in
GtkFileChooserDefault, and it can also be used by third-party
applications.
2013-04-11 19:45:12 -05:00
Federico Mena Quintero
21083978f0 Revert "GtkFileChooserDefault: Define children with a GtkBuilder template"
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.
2013-04-11 16:47:38 -05:00
Tristan Van Berkom
bf909f5615 GtkFileChooserDefault: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Federico Mena Quintero
a89d420270 filechooser: Use _gtk_file_has_native_path() throughout when testing for local_only
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>
2013-03-05 17:17:42 -06:00
Federico Mena Quintero
56bcb1933f filechooser: Rename _gtk_file_is_path_not_local() to _gtk_file_has_native_path()
Negatives in names of boolean functions are confusing.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-05 17:17:42 -06:00
Timothy Arceri
cf216d780c filechooser: Show FUSE mounted locations in shortcuts
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
2013-03-05 17:17:42 -06:00
Federico Mena Quintero
a46976fb79 Merge branch 'origin/master' into places-sidebar 2013-02-27 10:29:35 -06:00
Federico Mena Quintero
2deb41fe63 filechooser: When stopping/clearing BROWSE model, really ensure that we end up in LOAD_EMPTY state
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>
2013-02-20 20:09:08 -06:00
Federico Mena Quintero
039cc929ad filechooser: Tighten up some assertions when actually selecting files in the treeview
The model must be fully loaded, and it must be inserted in the treeview.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:09:02 -06:00
Federico Mena Quintero
936045e82b Merge branch 'master' into places-sidebar
Conflicts:
	docs/reference/gtk/gtk-docs.sgml
	gtk/gtkfilechooserdefault.c
	gtk/org.gtk.Settings.FileChooser.gschema.xml
2013-02-13 20:37:36 -06:00
Federico Mena Quintero
22e5e77232 filechooser: Oops, cancel a file operation that was missing
In addition, remove a list of pending_cancellables that was no longer being used.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 18:01:39 -06:00
Federico Mena Quintero
7e2c467e64 filechooser: Remove some unused code
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 18:01:39 -06:00
Cosimo Cecchi
880391cded filechooser: follow the gtk-recent-files-enabled GtkSetting
Avoid showing the Recent files entry if the setting is FALSE.

https://bugzilla.gnome.org/show_bug.cgi?id=693709
2013-02-13 12:06:43 -05:00
Benjamin Otte
e26031e0c7 filechooser: Move saving geometry to where it belongs
Move it from the filechooserwidget to the filechooserdialog unmap
function. It was previously only working for filechooserdialogs, too.
2013-01-26 21:04:55 +01:00
Benjamin Otte
c83a7a13e1 filechooser: Move settings key defines into header
... so we can read/write those keys from different source files.
2013-01-26 21:04:55 +01:00
Federico Mena Quintero
e57de53108 GtkFileChooser: Remove the last remains of the last_folder_uri logic
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>
2013-01-24 18:07:03 -06:00
Benjamin Otte
78d91aaf9b filechooser: Attach GSettings object to GtkSettings
... instead of keeping one per GtkFileChooserDefault. This allows using
it in other places, too.
2013-01-24 14:28:58 +01:00
Benjamin Otte
b112a85395 filechooser: Use macros
Thanks for not letting me catch that place when I was greeping...
2013-01-24 14:28:57 +01:00
Ryan Lortie
dc8b67de92 file chooser: give GSettings schema a path
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
2013-01-23 07:46:05 -05:00
Federico Mena Quintero
7d30e601de GtkFileChooserDefault: Don't use Backspace anymore to to to the parent folder
This is for consistency with Nautilus.

https://bugzilla.gnome.org/show_bug.cgi?id=692188
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-01-21 13:33:43 -06:00
Federico Mena Quintero
da2e081786 Make the set_location()/get_location() API consistent
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>
2013-01-10 18:12:15 -06:00
Federico Mena Quintero
0b4183234b New API, gtk_places_sidebar_set_open_flags()
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>
2013-01-10 16:19:03 -06:00
Federico Mena Quintero
42d239f6d5 Remove gtk_places_sidebar_set_show_cwd(), implement that in the file chooser
This removes more idiosyncratic API from the sidebar.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-12-11 15:52:17 -06:00
Federico Mena Quintero
c4f40a92ca Remove the GError from the shortcut-related functions
See https://bugzilla.gnome.org/show_bug.cgi?id=650363#c8 and the next comment; this
argument just makes the API harder to use without real benefit.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-12-11 15:29:11 -06:00
Federico Mena Quintero
72ce506cfc Rename signal location-selected to open-location
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-12-11 12:09:13 -06:00
Federico Mena Quintero
9124766d7b Implement the Search keyboard shortcut
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>
2012-12-10 17:26:53 -06:00
Federico Mena Quintero
bd28aad834 Remove unused code 2012-12-10 17:16:36 -06:00
Federico Mena Quintero
c1c1823634 Go back to our machinery for Recent files instead of reading recent:/// as-is
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>
2012-12-10 17:14:12 -06:00
Federico Mena Quintero
016dd28a9f Remove an obsolete function 2012-12-10 16:05:18 -06:00
Federico Mena Quintero
c26293eacd Implement the Alt-number quick bookmark shortcuts
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-12-10 16:00:42 -06:00
Federico Mena Quintero
8b0aea9f3d Implement the Desktop keyboard shortcut
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-12-10 14:45:18 -06:00
Federico Mena Quintero
e6ba6e7e06 Implement the Home keyboard shortcut
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-12-10 14:23:06 -06:00
Federico Mena Quintero
f3beff7556 Implement the 'Add to bookmarks' command as before
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-12-10 14:18:00 -06:00
Federico Mena Quintero
0dca40e851 Remove an obsolete function 2012-12-10 14:09:40 -06:00
Federico Mena Quintero
976672ad4b Implement the application-side shortcuts in GtkFileChooserDefault
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-12-10 14:06:07 -06:00
Benjamin Otte
1b1f4da5c7 gtk: Query font size directly
... instead of calling gtk_style_context_get_font() and then
pango_font_description_get_size().
2012-12-06 02:57:18 +01:00
Federico Mena Quintero
1681cf9b16 Remove the old shortcuts pane code from GtkFileChooserDefault
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>
2012-12-05 18:09:44 -06:00
Timothy Arceri
50acce4074 In the file chooser, use a proper apostrophe rather than a prime mark (tick mark)
https://bugzilla.gnome.org/show_bug.cgi?id=689012
2012-11-29 11:34:29 -06:00
Philip Withnall
ceb866dfe6 Bug 595615 — Use proper ellipses
Use ‘…’ instead of ‘...’ in translatable strings.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=595615
2012-11-26 08:59:27 +00:00
Federico Mena Quintero
b706e1b76b Highlight the currently-viewed location in the places sidebar
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-11-24 10:41:40 -06:00
Federico Mena Quintero
fc6bfcddde Actually switch to recent:/// in its key shortcut handler
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-11-23 13:24:55 -06:00
Federico Mena Quintero
f623329e95 Allow switching to recent:/// even though GIO thinks it is not a native file
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>
2012-11-23 12:53:41 -06:00
Federico Mena Quintero
e6b9ad404f Switch to Recent Files or $CWD at startup
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-11-21 13:16:43 -06:00
Federico Mena Quintero
043cac11f3 Add a new org.gtk.SettingsFileChooser startup-mode settings key
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>
2012-11-21 13:16:41 -06:00
Federico Mena Quintero
ec9bdc6397 New way to show in the sidebar
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-11-20 20:04:20 -06:00
Jonny Lamb
2f8c2a3244 filechooser: remember sidebar width
https://bugzilla.gnome.org/show_bug.cgi?id=524295

Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
2012-11-14 20:03:23 -06:00
Timothy Arceri
50a09957a4 Remove bookmark duplicate of shortcut
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
2012-11-13 12:54:15 -06:00