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
This commit is contained in:
Nelson Benítez León
2019-05-20 01:25:18 -04:00
parent c0321d6948
commit c925221aa8
5 changed files with 225 additions and 2 deletions

View File

@ -230,6 +230,18 @@
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="list_type_column">
<property name="title" translatable="yes">Type</property>
<property name="resizable">1</property>
<child>
<object class="GtkCellRendererText" id="list_type_renderer">
<property name="xalign">0</property>
<property name="xpad">6</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="list_time_column">
<property name="title" translatable="yes">Modified</property>

View File

@ -4,6 +4,7 @@ N_("All Files");
N_("Files");
N_("Name");
N_("Size");
N_("Type");
N_("Modified");
N_("Location");
N_("Select which types of files are shown");