[glade] GladeGtkFileChooserButton: cleanup support
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] GladeGtkFileChooserButton: cleanup support
- Date: Wed, 5 Aug 2020 22:39:26 +0000 (UTC)
commit 8ea0085747ae001128a6a9f3cbd933afa4fd7cf6
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Sat Aug 1 14:40:52 2020 -0300
GladeGtkFileChooserButton: cleanup support
Disable save and create folder actions and select multiple property
plugins/gtk+/glade-gtk-file-chooser-widget.c | 12 ++++++------
plugins/gtk+/gtk+.xml | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-file-chooser-widget.c b/plugins/gtk+/glade-gtk-file-chooser-widget.c
index 417672cd6..22e67440d 100644
--- a/plugins/gtk+/glade-gtk-file-chooser-widget.c
+++ b/plugins/gtk+/glade-gtk-file-chooser-widget.c
@@ -55,12 +55,12 @@ glade_gtk_file_chooser_button_set_property (GladeWidgetAdaptor *adaptor,
const gchar *id,
const GValue *value)
{
- /* Avoid a warning */
- if (!strcmp (id, "action"))
+ if (!strcmp (id, "filter") && !g_value_get_object (value))
{
- if (g_value_get_enum (value) == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER ||
- g_value_get_enum (value) == GTK_FILE_CHOOSER_ACTION_SAVE)
- return;
+ /* Filter can not be NULL, so we use a empty filter instead */
+ gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (object),
+ gtk_file_filter_new ());
+ return;
}
GLADE_WIDGET_ADAPTOR_GET_ADAPTOR_CLASS (GTK_TYPE_BOX)->set_property (adaptor, object, id, value);
@@ -74,5 +74,5 @@ glade_gtk_file_chooser_button_create_editable (GladeWidgetAdaptor *adaptor,
if (type == GLADE_PAGE_GENERAL)
return (GladeEditable *) glade_file_chooser_button_editor_new ();
- return GLADE_WIDGET_ADAPTOR_GET_ADAPTOR_CLASS (GTK_TYPE_WIDGET)->create_editable (adaptor, type);
+ return GLADE_WIDGET_ADAPTOR_GET_ADAPTOR_CLASS (GTK_TYPE_BOX)->create_editable (adaptor, type);
}
diff --git a/plugins/gtk+/gtk+.xml b/plugins/gtk+/gtk+.xml
index bd194641f..8551e3f7b 100644
--- a/plugins/gtk+/gtk+.xml
+++ b/plugins/gtk+/gtk+.xml
@@ -1942,13 +1942,13 @@
<property id="action" custom-layout="True">
<displayable-values>
<!-- GtkFileChooserAction enumeration value -->
- <value id="GTK_FILE_CHOOSER_ACTION_SAVE" name="Save"/>
+ <value id="GTK_FILE_CHOOSER_ACTION_SAVE" name="Save" disabled="True"/>
<!-- GtkFileChooserAction enumeration value -->
<value id="GTK_FILE_CHOOSER_ACTION_OPEN" name="Open"/>
<!-- GtkFileChooserAction enumeration value -->
<value id="GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER" name="Select Folder"/>
<!-- GtkFileChooserAction enumeration value -->
- <value id="GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER" name="Create Folder"/>
+ <value id="GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER" name="Create Folder" disabled="True"/>
</displayable-values>
</property>
<property id="filter" custom-layout="True"/>
@@ -1957,7 +1957,7 @@
<property id="do-overwrite-confirmation" custom-layout="True"/>
<property id="preview-widget-active" custom-layout="True"/>
<property id="use-preview-label" custom-layout="True"/>
- <property id="select-multiple" custom-layout="True"/>
+ <property id="select-multiple" custom-layout="True" disabled="True"/>
</properties>
</glade-widget-class>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]