From b03b97dd0aa5bfb4e03f924e79e7f95f95490e79 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 8 May 2007 20:10:16 +0100 Subject: Do not switch to filename entry when not in browse mode The location entry is not shown in either the OPERATION_MODE_SEARCH or the OPERATION_MODE_RECENT modes of the file chooser, so do not switch to it when in one of those modes. This fixes the suddenly appearing of the location entry when unmapping/mapping the file chooser in a non-browse mode. Signed-off-by: Emmanuele Bassi --- gtk/gtkfilechooserdefault.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index f699e48..825ddf0 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -4836,6 +4836,14 @@ location_entry_set_initial_text (GtkFileChooserDefault *impl) static void location_switch_to_filename_entry (GtkFileChooserDefault *impl) { + /* when in search or recent files mode, we are not showing the + * location_entry_box container, so there's no point in switching + * to it. + */ + if (impl->operation_mode == OPERATION_MODE_SEARCH || + impl->operation_mode == OPERATION_MODE_RECENT) + return; + if (impl->location_entry) gtk_widget_destroy (impl->location_entry); @@ -9880,7 +9888,8 @@ list_selection_changed (GtkTreeSelection *selection, GtkFileChooserDefault *impl) { /* See if we are in the new folder editable row for Save mode */ - if (impl->operation_mode == OPERATION_MODE_BROWSE && impl->action == GTK_FILE_CHOOSER_ACTION_SAVE) + if (impl->operation_mode == OPERATION_MODE_BROWSE && + impl->action == GTK_FILE_CHOOSER_ACTION_SAVE) { const GtkFileInfo *info; gboolean had_selection; -- 1.4.4.2