diff options
author | Federico Mena Quintero <federico@ximian.com> | 2004-03-05 00:10:59 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2004-03-05 00:10:59 +0000 |
commit | d64c7c08a8e742158d49a129f8b68215dd8d2eff (patch) | |
tree | 8b208d81b5b5219737efd74e1f8446ffe3b02c48 /gtk/gtkfilechooserembed.c | |
parent | 1810dba3384c18152bf9993467acbf8f36528312 (diff) | |
download | gtk+-d64c7c08a8e742158d49a129f8b68215dd8d2eff.tar.gz |
New handler. Ask the GtkFileChooser widget if it wants to do something
2004-03-04 Federico Mena Quintero <federico@ximian.com>
* gtk/gtkfilechooserdialog.c (response_cb): New handler. Ask the
GtkFileChooser widget if it wants to do something special rather
than letting us terminate the dialog.
(gtk_file_chooser_dialog_init): Connect to "response"; see the
comment in the sources to see why we don't override the method in
class_init.
* gtk/gtkfilechooserembed.h (struct _GtkFileChooserEmbedIface):
Added a ::should_respond() method.
* gtk/gtkfilechooserembed.c
(_gtk_file_chooser_embed_delegate_iface_init): Add a delegate for ::should_respond().
(delegate_should_respond): New delegate.
(_gtk_file_chooser_embed_should_respond): New function.
* gtk/gtkfilechooserdefault.c (set_list_model, create_file_list):
Use dashes in signal names rather than underscores.
(gtk_file_chooser_default_init): Hook up our ::should_respond() implementation.
(gtk_file_chooser_default_should_respond): Implement. go into a
folder rather than responding if we are in File mode and the
selected file is a folder.
(get_selection): New helper function.
(add_bookmark_button_clicked_cb): Use get_selection().
(bookmarks_check_add_sensitivity): Likewise.
(gtk_file_chooser_default_get_paths): Likewise.
(check_save_entry): New helper function.
(gtk_file_chooser_default_get_paths): Use check_save_entry().
(selection_check): Renamed from selection_is_folders(). Now
checks whether the selection is empty, all files, all folders.
(bookmarks_check_add_sensitivity): Use selection_check().
Diffstat (limited to 'gtk/gtkfilechooserembed.c')
-rw-r--r-- | gtk/gtkfilechooserembed.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gtk/gtkfilechooserembed.c b/gtk/gtkfilechooserembed.c index 61a48fff56..696efc50df 100644 --- a/gtk/gtkfilechooserembed.c +++ b/gtk/gtkfilechooserembed.c @@ -8,6 +8,7 @@ static void delegate_get_default_size (GtkFileChooserEmbed *chooser_embe static void delegate_get_resizable_hints (GtkFileChooserEmbed *chooser_embed, gboolean *resize_horizontally, gboolean *resize_vertically); +static gboolean delegate_should_respond (GtkFileChooserEmbed *chooser_embed); static void delegate_default_size_changed (GtkFileChooserEmbed *chooser_embed, gpointer data); @@ -31,6 +32,7 @@ _gtk_file_chooser_embed_delegate_iface_init (GtkFileChooserEmbedIface *iface) { iface->get_default_size = delegate_get_default_size; iface->get_resizable_hints = delegate_get_resizable_hints; + iface->should_respond = delegate_should_respond; } /** @@ -74,6 +76,12 @@ delegate_get_resizable_hints (GtkFileChooserEmbed *chooser_embed, _gtk_file_chooser_embed_get_resizable_hints (get_delegate (chooser_embed), resize_horizontally, resize_vertically); } +static gboolean +delegate_should_respond (GtkFileChooserEmbed *chooser_embed) +{ + return _gtk_file_chooser_embed_should_respond (get_delegate (chooser_embed)); +} + static void delegate_default_size_changed (GtkFileChooserEmbed *chooser_embed, gpointer data) @@ -135,6 +143,14 @@ _gtk_file_chooser_embed_get_default_size (GtkFileChooserEmbed *chooser_embed, GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->get_default_size (chooser_embed, default_width, default_height); } +gboolean +_gtk_file_chooser_embed_should_respond (GtkFileChooserEmbed *chooser_embed) +{ + g_return_val_if_fail (GTK_IS_FILE_CHOOSER_EMBED (chooser_embed), FALSE); + + return GTK_FILE_CHOOSER_EMBED_GET_IFACE (chooser_embed)->should_respond (chooser_embed); +} + void _gtk_file_chooser_embed_get_resizable_hints (GtkFileChooserEmbed *chooser_embed, gboolean *resize_horizontally, |