[gtk+/filesystemmodel] make sure the "Create folder" button doesn't get shown accidentally



commit 98facaf1ebe434e9a47cee5935bd2113f5ddd0be
Author: Benjamin Otte <otte gnome org>
Date:   Thu Jun 25 15:50:55 2009 +0200

    make sure the "Create folder" button doesn't get shown accidentally
    
    Switching to search or recent files mode and back to browse mode made
    the button visible previously

 gtk/gtkfilechooserdefault.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 0da6879..c33831e 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -5258,8 +5258,6 @@ update_appearance (GtkFileChooserDefault *impl)
 	  gtk_widget_hide (impl->browse_widgets);
 	}
 
-      gtk_widget_show (impl->browse_new_folder_button);
-
       if (impl->select_multiple)
 	{
 	  g_warning ("Save mode cannot be set in conjunction with multiple selection mode.  "
@@ -8740,7 +8738,11 @@ search_switch_to_browse_mode (GtkFileChooserDefault *impl)
   impl->search_entry = NULL;
 
   gtk_widget_show (impl->browse_path_bar);
-  gtk_widget_show (impl->browse_new_folder_button);
+  if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN)
+    gtk_widget_hide (impl->browse_new_folder_button);
+  else
+    gtk_widget_show (impl->browse_new_folder_button);
+
 
   if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
       impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
@@ -9043,7 +9045,10 @@ recent_switch_to_browse_mode (GtkFileChooserDefault *impl)
   impl->recent_hbox = NULL;
 
   gtk_widget_show (impl->browse_path_bar);
-  gtk_widget_show (impl->browse_new_folder_button);
+  if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN)
+    gtk_widget_hide (impl->browse_new_folder_button);
+  else
+    gtk_widget_show (impl->browse_new_folder_button);
 
   if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
       impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]