Transfer the Mac SDK bockbuild profiles & resources inside the Mono repository.
[mono.git] / bockbuild / mac-sdk / patches / gtk / 0075-filechooserwidget-location-entry-activation.patch
1 diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
2 index f94f4d6..eeb501b 100644
3 --- a/gtk/gtkfilechooserdefault.c
4 +++ b/gtk/gtkfilechooserdefault.c
5 @@ -4409,17 +4409,26 @@ file_pane_create (GtkFileChooserDefault *impl,
6  }
7
8  static void
9 +on_folder_loaded (GtkFileChooserEntry *entry, GtkFileChooserDefault *chooser)
10 +{
11 +  gtk_file_chooser_default_should_respond (GTK_FILE_CHOOSER_EMBED (chooser));
12 +  g_signal_emit_by_name (chooser, "response-requested");
13 +}
14 +
15 +static void
16  location_entry_create (GtkFileChooserDefault *impl)
17  {
18    if (!impl->location_entry)
19 -    impl->location_entry = _gtk_file_chooser_entry_new (TRUE);
20 +    {
21 +      impl->location_entry = _gtk_file_chooser_entry_new (TRUE);
22 +      g_signal_connect (impl->location_entry, "xam-load-folder", G_CALLBACK (on_folder_loaded), impl);
23 +    }
24
25    _gtk_file_chooser_entry_set_file_system (GTK_FILE_CHOOSER_ENTRY (impl->location_entry),
26                                            impl->file_system);
27    _gtk_file_chooser_entry_set_local_only (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), impl->local_only);
28    _gtk_file_chooser_entry_set_action (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), impl->action);
29    gtk_entry_set_width_chars (GTK_ENTRY (impl->location_entry), 45);
30 -  gtk_entry_set_activates_default (GTK_ENTRY (impl->location_entry), TRUE);
31  }
32
33  /* Creates the widgets specific to Save mode */
34 diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c
35 index c06fe3f..a0548a6 100644
36 --- a/gtk/gtkfilechooserdialog.c
37 +++ b/gtk/gtkfilechooserdialog.c
38 @@ -254,7 +254,7 @@ file_chooser_widget_response_requested (GtkWidget            *widget,
39
40    g_list_free (children);
41  }
42 -
43 +
44  static GObject*
45  gtk_file_chooser_dialog_constructor (GType                  type,
46                                      guint                  n_construct_properties,
47 diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
48 index 3caa7b8..44cf665 100644
49 --- a/gtk/gtkfilechooserentry.c
50 +++ b/gtk/gtkfilechooserentry.c
51 @@ -28,6 +28,7 @@
52  #include "gtkfilechooserentry.h"
53  #include "gtklabel.h"
54  #include "gtkmain.h"
55 +#include "gtkmarshalers.h"
56  #include "gtkwindow.h"
57  #include "gtkintl.h"
58  #include "gtkalias.h"
59 @@ -45,6 +46,11 @@ struct _GtkFileChooserEntryClass
60    GtkEntryClass parent_class;
61  };
62
63 +enum {
64 +  XAM_LOAD_FOLDER,
65 +  LAST_SIGNAL
66 +};
67 +
68  /* Action to take when the current folder finishes loading (for explicit or automatic completion) */
69  typedef enum {
70    LOAD_COMPLETE_NOTHING,
71 @@ -168,6 +174,8 @@ static void pop_up_completion_feedback (GtkFileChooserEntry *chooser_entry,
72
73  static GtkEditableClass *parent_editable_iface;
74
75 +static guint signals[LAST_SIGNAL] = { 0 };
76 +
77  G_DEFINE_TYPE_WITH_CODE (GtkFileChooserEntry, _gtk_file_chooser_entry, GTK_TYPE_ENTRY,
78                          G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE,
79                                                 gtk_file_chooser_entry_iface_init))
80 @@ -188,6 +196,14 @@ _gtk_file_chooser_entry_class_init (GtkFileChooserEntryClass *class)
81    widget_class->focus_out_event = gtk_file_chooser_entry_focus_out_event;
82
83    entry_class->activate = gtk_file_chooser_entry_activate;
84 +
85 +  signals[XAM_LOAD_FOLDER] = g_signal_new (I_("xam-load-folder"),
86 +                                           G_OBJECT_CLASS_TYPE (gobject_class),
87 +                                           G_SIGNAL_RUN_LAST,
88 +                                           NULL,
89 +                                           NULL, NULL,
90 +                                           _gtk_marshal_VOID__VOID,
91 +                                           G_TYPE_NONE, 0);
92  }
93
94  static void
95 @@ -1301,6 +1317,7 @@ gtk_file_chooser_entry_activate (GtkEntry *entry)
96    GtkFileChooserEntry *chooser_entry = GTK_FILE_CHOOSER_ENTRY (entry);
97
98    commit_completion_and_refresh (chooser_entry);
99 +  g_signal_emit (chooser_entry, signals[XAM_LOAD_FOLDER], 0);
100    GTK_ENTRY_CLASS (_gtk_file_chooser_entry_parent_class)->activate (entry);
101  }
102
103 diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
104 index d69d854..3ad8a19 100644
105 --- a/gtk/gtkfilechooserwidget.c
106 +++ b/gtk/gtkfilechooserwidget.c
107 @@ -24,6 +24,7 @@
108  #include "gtkfilechooserwidget.h"
109  #include "gtkfilechooserdefault.h"
110  #include "gtkfilechooserutils.h"
111 +#include "gtkmarshalers.h"
112  #include "gtktypebuiltins.h"
113  #include "gtkfilechooserembed.h"
114  #include "gtkintl.h"
115 @@ -101,7 +102,6 @@ gtk_file_chooser_widget_constructor (GType                  type,
116    gtk_widget_push_composite_child ();
117
118    priv->impl = _gtk_file_chooser_default_new ();
119 -
120    gtk_box_pack_start (GTK_BOX (object), priv->impl, TRUE, TRUE, 0);
121    gtk_widget_show (priv->impl);