Commit Graph

78 Commits

Author SHA1 Message Date
Timm Bäder
a8b559e99f filechooser: Remove SETTINGS_KEY_WINDOW_POSITION
Now unused.
2019-07-19 18:14:50 +02:00
Timm Bäder
a9364bc053 Revert "file chooser: Stop using gtk_window_get_position"
This reverts commit 2ed533c3e1.

This also made the filechooser dialog not save the window size anymore,
which does not depend on the gtk_window_get_position() removal.
2019-07-19 18:14:49 +02:00
Nelson Benítez León
c789a39660 GtkFileChooser: add a sortable "Type" column
along with a new 'type-format' setting that allows
to choose the output format for the "Type" column.

The options implemented for this setting are:

'mime' : Output from g_content_type_get_mime_type().

'description' : Output from g_content_type_get_description().

'category' : It uses the corresponding generic icon
  of the mime type to group by categories (aka basic types).

  This produces a more compact output than previous options,
  and allows for type families to be grouped together, so eg.
  after sorting by "Type" column, jpeg and png images will
  be placed together, or the various types of archiver files
  will also be grouped together.

  This format was copied from and currently used by Nautilus
  list view, so we also improve consistency with Nautilus.
  Bugzilla entry for Nautilus implementation is:
  https://bugzilla.gnome.org/show_bug.cgi?id=683722

  The list of type families or categories can be checked on:
  https://developer.gnome.org/icon-naming-spec/#mimetypes

  This 'category' format is set as default.

Issue #362
2019-06-22 13:22:59 -04:00
Matthias Clasen
2ed533c3e1 file chooser: Stop using gtk_window_get_position
It is going away.
2019-03-26 17:55:29 -04:00
Matthias Clasen
6fc7485077 GtkFileChooser: Add abstract api for comboboxes and checkbuttons
This commit adds API for adding combo boxes and check buttons to
GtkFileChooser, and getting the selected value back in ::response.

In contrast to gtk_file_chooser_set_extra_widget, these APIs are
abstract and suitable for implementation in GtkFileChooserNative.

https://bugzilla.gnome.org/show_bug.cgi?id=768499
2016-07-08 00:08:21 -04:00
Matthias Clasen
5763199e43 file chooser: Clean up enum handling
Use g_settings_get_set_enum to handle the clock and date format
settings.
2015-07-04 00:29:25 -04:00
William Jon McCann
a34702a61f file-chooser: add a sort-directories-first gsetting
Add an option to sort folders before files in order to be
more constistent with the file manager.
2013-12-03 12:12:54 -05:00
Jonh Wendell
84b4910b39 filechooser: Add gtk_file_chooser_get_current_name()
Currently you can only set the current filename, but not
get it. It's useful to be able to get it in save
dialogs, where the user has typed the desired filename
and you are not in a real directory (recent used, for
example).

https://bugzilla.gnome.org/show_bug.cgi?id=702497
2013-06-19 13:37:35 -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
e2c9797994 Move GtkFileChooserWidgetPrivate to gtkfilechooserwidget.c
In addition, remove the unused "file_system" field from that
structure.
2013-04-11 20:51:09 -05:00
Federico Mena Quintero
70fce923bc Move GtkFileChooserDialogPrivate into gtkfilechooserdialog.c
We'll take private structures out of gtkfilechooserprivate.h and move
them to the appropriate place.
2013-04-11 20:46:47 -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
b537e1badd GtkFileChooserDialog: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Tristan Van Berkom
bf909f5615 GtkFileChooserDefault: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09: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
936a7f62a5 filechooserbutton: Remove unused function prototypes 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
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
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
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
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
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
Federico Mena Quintero
4fe3cd8f1e Create the places sidebar instead of the old custom treeview
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-09-05 19:48:16 -05:00
Federico Mena Quintero
c242e88a37 #if out a few things 2012-09-03 20:55:59 -05:00
Federico Mena Quintero
30c2fc3dc0 Make GtkFileChooserDefault use GtkBookmarksManager
It no longer uses GtkFileSystem to deal with bookmarks.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-09-03 20:42:26 -05:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Federico Mena Quintero
2476d35142 Menu item to visit the selected files in recent-files mode
This will take you to the file's folder and select the file in question.
The menu item is only available in Recently-used and Search modes, so that
you can go from files in them to the 'normal' browsing mode.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-09-05 13:31:57 -05:00
Arx Cruz
c9023cadbf [filechooser] bgo#349502: Context menu option to copy selected files to the clipboard 2011-08-23 17:10:03 -05:00
Federico Mena Quintero
3de864cfff Move the widgets above the hpaned to their own box
This way we can re-create the contents of that box easily without disrupting
the rest of the file chooser.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:56:02 -05:00
Federico Mena Quintero
6bb34d7dd4 Centralize the setting of the pathbar's widgets
It used to be that every part of the file chooser's code would show/hide the widgets
near the pathbar as needed.  Now we have two central functions:

  path_bar_update()
  path_bar_set_mode()

These take care of all the widget shuffling;  setting the visibility of the
pathbar, info bar, and Create Folder button as appropriate; setting the contents
of the info bar, etc. - based on the current operation_mode and action.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:12 -05:00
Federico Mena Quintero
4d9fdb1c1b Warn the user when he still needs to type a filename or choose a folder
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:11 -05:00
Federico Mena Quintero
064ff39ad7 Instruct the user to pick a folder when nothing is selected in the recent-folders list
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:11 -05:00
Federico Mena Quintero
252ace6681 Start in recently-used mode when no folder is set
In RELOAD_EMPTY mode, when no folder has been selected by the calling app, we now
start showing the recently-used list.  The rationale is as follows:

  - In Open mode, the user is likely to pick a file he has used recently.

  - In Save mode, the user is likely to want a destination folder which
    he has used recently.

For the Save case, where we want to present the user with recent folders instead
of recent files, we will make the recent-list do so in subsequent commits.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:10 -05:00
Federico Mena Quintero
1ffd36814a Put the pathbar in the 'Save in folder:' row in Save mode
Now we reparent the browse_path_bar_hbox to that spot in Save mode,
or to be above the file lists in Open mode.  The pathbar makes for a very
clear indication of the location to save in.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:09 -05:00
Federico Mena Quintero
4353a5f88c Get rid of the save_folder_combo
And with this we get rid of the craziness of having a separate filter model
for the combobox's model.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:05:12 -05:00
Federico Mena Quintero
3146c790a7 Remove the expander in Save mode, and the configuration key
This effectively makes the file chooser always be in 'expanded' mode.
Later, we'll move the pathbar to the 'Save in folder:' line.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:05:12 -05:00
Matthias Clasen
5b5c8f23d9 GtkFileChooserDefault: derive from GtkBox, not GtkVBox 2011-06-07 18:36:57 -04:00
Federico Mena Quintero
b8cde53350 bgo#634558 - filechooser - Actually focus the Search entry when selecting the Search shortcut
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-11-16 10:58:16 -06:00
Christian Persch
803233cc14 Use GSettings for the filechooser settings
Bug #630850.
2010-10-13 14:31:07 +02:00
Federico Mena Quintero
3a1ba3bd1e bgo#625416 - Don't reload the filechooser's folder during a re-map event
Long ago, before we had file monitoring at the GIO/Glib level, we would
reload the current folder each time a file chooser gets (re)mapped.
This was basically to let the GIMP recycle the same file chooser for all
file/open or file/save operations, instead of creating a new one every time.
In that case, we reloaded the folder with each ::map() event so that the
file chooser would present an up-to-date view of the folder that was being
displayed.  Now, the folder should always be up-to-date as we do
file monitoring all the time.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2010-08-10 11:36:03 -05:00
Benjamin Otte
836c3ab043 Improve show_and_select_files() function
The previous function enumerated the whole directory and used a lot of
outdated API to decide how to show files.
The new code queries the filesystem model to decide about this.
The now unused old functions were removed.
2009-10-15 22:01:40 +02:00
Benjamin Otte
53a00e3cc3 Convert recent files to a GtkFileSystemModel
This does to the recent files what the last commit did to the search. It
uses a GtkFileSystemModel and its API niceties to show the recent files.
2009-10-15 22:01:39 +02:00
Benjamin Otte
5a31dfd66b Convert search to use a GtkFileSystemModel
Replace the list model code with the file system model and use all the
file system model API niceties we get from that.
Also adds the function _gtk_file_system_model_add_and_query_file() which
g_file_query_info()'s the file before adding it, so it gets added with
the right information.
2009-10-15 22:01:09 +02:00
Benjamin Otte
105e6fbc11 Use the GtkTreeSortable of the filesystem model
Previously, there was a GtkTreeSortModel wrapped around the filesystem
model to make it sortable. As the new implementation implements the
GtkTreeSortable interface, we can use this instead.
2009-10-15 22:00:08 +02:00
Benjamin Otte
3c9a34dba3 move GtkFileSystemModel private stuff out of the private header 2009-10-15 22:00:06 +02:00
Pascal Terjan
a4514f993e Allow disabling New Folder button in File Choser
Bug #570516. Add a new property "create-folders" meaning that the
"New Folder" button should be displayed in the modes where it used
to be.
2009-07-30 16:58:42 +02:00
Federico Mena Quintero
3d527afadb bgo#586315 - gtk_file_chooser_list_shortcut_folders() was crashing
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>
2009-06-18 21:57:54 -05:00
Benjamin Gramlich
1d4cba6876 bgo#484922 - Remember the sort column and order in the file chooser
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 17:31:28 -05:00