Merge branch 'mcatanzaro/#1492' into 'gtk-3-24'
filechoosernative: Implement gtk_file_chooser_set_filter() See merge request GNOME/gtk!435
This commit is contained in:
commit
b984074e29
@ -466,6 +466,7 @@ gtk_file_chooser_native_set_property (GObject *object,
|
|||||||
|
|
||||||
case GTK_FILE_CHOOSER_PROP_FILTER:
|
case GTK_FILE_CHOOSER_PROP_FILTER:
|
||||||
self->current_filter = g_value_get_object (value);
|
self->current_filter = g_value_get_object (value);
|
||||||
|
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (self->dialog), self->current_filter);
|
||||||
g_object_notify (G_OBJECT (self), "filter");
|
g_object_notify (G_OBJECT (self), "filter");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -332,10 +332,13 @@ show_portal_file_chooser (GtkFileChooserNative *self,
|
|||||||
g_variant_builder_add (&opt_builder, "{sv}", "modal",
|
g_variant_builder_add (&opt_builder, "{sv}", "modal",
|
||||||
g_variant_new_boolean (data->modal));
|
g_variant_new_boolean (data->modal));
|
||||||
g_variant_builder_add (&opt_builder, "{sv}", "filters", get_filters (GTK_FILE_CHOOSER (self)));
|
g_variant_builder_add (&opt_builder, "{sv}", "filters", get_filters (GTK_FILE_CHOOSER (self)));
|
||||||
if (GTK_FILE_CHOOSER_NATIVE (self)->current_name)
|
if (self->current_filter)
|
||||||
|
g_variant_builder_add (&opt_builder, "{sv}", "current_filter",
|
||||||
|
gtk_file_filter_to_gvariant (self->current_filter));
|
||||||
|
if (self->current_name)
|
||||||
g_variant_builder_add (&opt_builder, "{sv}", "current_name",
|
g_variant_builder_add (&opt_builder, "{sv}", "current_name",
|
||||||
g_variant_new_string (GTK_FILE_CHOOSER_NATIVE (self)->current_name));
|
g_variant_new_string (GTK_FILE_CHOOSER_NATIVE (self)->current_name));
|
||||||
if (GTK_FILE_CHOOSER_NATIVE (self)->current_folder)
|
if (self->current_folder)
|
||||||
{
|
{
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
||||||
@ -344,7 +347,7 @@ show_portal_file_chooser (GtkFileChooserNative *self,
|
|||||||
g_variant_new_bytestring (path));
|
g_variant_new_bytestring (path));
|
||||||
g_free (path);
|
g_free (path);
|
||||||
}
|
}
|
||||||
if (GTK_FILE_CHOOSER_NATIVE (self)->current_file)
|
if (self->current_file)
|
||||||
{
|
{
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
||||||
@ -354,7 +357,7 @@ show_portal_file_chooser (GtkFileChooserNative *self,
|
|||||||
g_free (path);
|
g_free (path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GTK_FILE_CHOOSER_NATIVE (self)->choices)
|
if (self->choices)
|
||||||
g_variant_builder_add (&opt_builder, "{sv}", "choices",
|
g_variant_builder_add (&opt_builder, "{sv}", "choices",
|
||||||
serialize_choices (GTK_FILE_CHOOSER_NATIVE (self)));
|
serialize_choices (GTK_FILE_CHOOSER_NATIVE (self)));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user