]> Pileus Git - ~andy/gtk/commitdiff
Only hide the "create folder" button in OPEN mode; all the others should
authorFederico Mena Quintero <federico@ximian.com>
Mon, 15 Mar 2004 23:15:31 +0000 (23:15 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Mon, 15 Mar 2004 23:15:31 +0000 (23:15 +0000)
2004-03-15  Federico Mena Quintero  <federico@ximian.com>

* gtk/gtkfilechooserdefault.c (update_appearance): Only hide the
"create folder" button in OPEN mode; all the others should show it
it.
(get_paths_foreach): Handle the editable row.

* gtk/gtkfilesystemunix.c (gtk_file_system_unix_create_folder):
Force a re-get of the folder so that the new directory gets added
to its hash table of file info.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkfilechooserdefault.c
gtk/gtkfilesystemunix.c

index eb0e478f160c8f59d5978a4537cafc756c3dc3f8..71ac56405c1fa3d7d61e0231f301b514842a9de6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-03-15  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (update_appearance): Only hide the
+       "create folder" button in OPEN mode; all the others should show it
+       it.
+       (get_paths_foreach): Handle the editable row.
+
+       * gtk/gtkfilesystemunix.c (gtk_file_system_unix_create_folder):
+       Force a re-get of the folder so that the new directory gets added
+       to its hash table of file info.
+
 2004-03-15  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
index eb0e478f160c8f59d5978a4537cafc756c3dc3f8..71ac56405c1fa3d7d61e0231f301b514842a9de6 100644 (file)
@@ -1,3 +1,14 @@
+2004-03-15  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (update_appearance): Only hide the
+       "create folder" button in OPEN mode; all the others should show it
+       it.
+       (get_paths_foreach): Handle the editable row.
+
+       * gtk/gtkfilesystemunix.c (gtk_file_system_unix_create_folder):
+       Force a re-get of the folder so that the new directory gets added
+       to its hash table of file info.
+
 2004-03-15  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
index eb0e478f160c8f59d5978a4537cafc756c3dc3f8..71ac56405c1fa3d7d61e0231f301b514842a9de6 100644 (file)
@@ -1,3 +1,14 @@
+2004-03-15  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (update_appearance): Only hide the
+       "create folder" button in OPEN mode; all the others should show it
+       it.
+       (get_paths_foreach): Handle the editable row.
+
+       * gtk/gtkfilesystemunix.c (gtk_file_system_unix_create_folder):
+       Force a re-get of the folder so that the new directory gets added
+       to its hash table of file info.
+
 2004-03-15  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
index eb0e478f160c8f59d5978a4537cafc756c3dc3f8..71ac56405c1fa3d7d61e0231f301b514842a9de6 100644 (file)
@@ -1,3 +1,14 @@
+2004-03-15  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (update_appearance): Only hide the
+       "create folder" button in OPEN mode; all the others should show it
+       it.
+       (get_paths_foreach): Handle the editable row.
+
+       * gtk/gtkfilesystemunix.c (gtk_file_system_unix_create_folder):
+       Force a re-get of the folder so that the new directory gets added
+       to its hash table of file info.
+
 2004-03-15  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
index eb0e478f160c8f59d5978a4537cafc756c3dc3f8..71ac56405c1fa3d7d61e0231f301b514842a9de6 100644 (file)
@@ -1,3 +1,14 @@
+2004-03-15  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (update_appearance): Only hide the
+       "create folder" button in OPEN mode; all the others should show it
+       it.
+       (get_paths_foreach): Handle the editable row.
+
+       * gtk/gtkfilesystemunix.c (gtk_file_system_unix_create_folder):
+       Force a re-get of the folder so that the new directory gets added
+       to its hash table of file info.
+
 2004-03-15  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
index 667a0a54723e8c37957816d13261d70176cc2a58..fb79fa8607e1889d88562febd0e0bc5616867a57 100644 (file)
@@ -1216,7 +1216,7 @@ shortcuts_add_volumes (GtkFileChooserDefault *impl)
       GtkFileSystemVolume *volume;
 
       volume = l->data;
-      
+
       if (impl->local_only)
        {
          GtkFilePath *base_path = gtk_file_system_volume_get_base_path (impl->file_system, volume);
@@ -3155,8 +3155,7 @@ update_appearance (GtkFileChooserDefault *impl)
        _gtk_file_system_model_set_show_files (impl->browse_files_model, TRUE);
     }
 
-  if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
-      || impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
+  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);
@@ -3700,7 +3699,7 @@ gtk_file_chooser_default_set_current_folder (GtkFileChooser    *chooser,
                   GTK_FILE_SYSTEM_ERROR,
                   GTK_FILE_SYSTEM_ERROR_FAILED,
                   _("Can't change to folder because it isn't local"));
-      
+
       return FALSE;
     }
 
@@ -3913,6 +3912,8 @@ get_paths_foreach (GtkTreeModel *model,
   gtk_tree_model_sort_convert_iter_to_child_iter (info->impl->sort_model, &sel_iter, iter);
 
   file_path = _gtk_file_system_model_get_path (GTK_FILE_SYSTEM_MODEL (fs_model), &sel_iter);
+  if (!file_path)
+    return; /* We are on the editable row */
 
   if (!info->path_from_entry
       || gtk_file_path_compare (info->path_from_entry, file_path) != 0)
@@ -5018,7 +5019,7 @@ location_popup_handler (GtkFileChooserDefault *impl)
     {
       title = _("Open Location");
     }
-  else 
+  else
     {
       g_assert (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
                || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
@@ -5062,7 +5063,7 @@ location_popup_handler (GtkFileChooserDefault *impl)
            {
              gtk_widget_grab_focus (impl->browse_files_tree_view);
            }
-         else 
+         else
            {
              g_assert (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
                        || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
index 5a6d6cf0b0c57aa788d306d58f6761e539757de4..01528ce533e9b2a8c7b5493f4719e11483370ff6 100644 (file)
@@ -501,12 +501,31 @@ gtk_file_system_unix_create_folder (GtkFileSystem     *file_system,
       folder_unix = g_hash_table_lookup (system_unix->folder_hash, parent);
       if (folder_unix)
        {
+         GtkFileInfoType types;
+         GtkFilePath *parent_path;
          GSList *paths;
+         GtkFileFolder *folder;
 
-         paths = g_slist_append (NULL, (GtkFilePath *) path);
-         g_signal_emit_by_name (folder_unix, "files-added", paths);
-         g_slist_free (paths);
+         /* This is sort of a hack.  We re-get the folder, to ensure that the
+          * newly-created directory gets read into the folder's info hash table.
+          */
+
+         types = folder_unix->types;
+
+         parent_path = gtk_file_path_new_dup (parent);
+         folder = gtk_file_system_get_folder (file_system, parent_path, types, NULL);
+         gtk_file_path_free (parent_path);
+
+         if (folder)
+           {
+             paths = g_slist_append (NULL, (GtkFilePath *) path);
+             g_signal_emit_by_name (folder, "files-added", paths);
+             g_slist_free (paths);
+             g_object_unref (folder);
+           }
        }
+
+      g_free (parent);
     }
 
   return TRUE;