]> Pileus Git - ~andy/gtk/commitdiff
In the Save modes, set the Name entry of the file chooser if we get a
authorFederico Mena Quintero <federico@ximian.com>
Mon, 15 Mar 2004 19:23:54 +0000 (19:23 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Mon, 15 Mar 2004 19:23:54 +0000 (19:23 +0000)
2004-03-15  Federico Mena Quintero  <federico@ximian.com>

* gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
modes, set the Name entry of the file chooser if we get a
nonexistent filename from the file entry.  Fixes #135911.
(gtk_file_chooser_default_set_current_name): Oops, this should
also work if we are in CREATE_FOLDER mode.

* gtk/gtkfilesystem.c (gtk_file_path_real_copy): Use
gtk_file_path_copy().

* gtk/gtkfilechooserentry.c (check_completion_callback): Free the
path that we got from the model.
(completion_match_func): Use DISPLAY_NAME_COLUMN rather than a
hard-coded constant.

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

index da789d4131348c3f8df49ee956cb29be9ac18268..eb0e478f160c8f59d5978a4537cafc756c3dc3f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2004-03-15  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
+       modes, set the Name entry of the file chooser if we get a
+       nonexistent filename from the file entry.  Fixes #135911.
+       (gtk_file_chooser_default_set_current_name): Oops, this should
+       also work if we are in CREATE_FOLDER mode.
+
+       * gtk/gtkfilesystem.c (gtk_file_path_real_copy): Use
+       gtk_file_path_copy().
+
+       * gtk/gtkfilechooserentry.c (check_completion_callback): Free the
+       path that we got from the model.
+       (completion_match_func): Use DISPLAY_NAME_COLUMN rather than a
+       hard-coded constant.
+
 Mon Mar 15 13:50:14 2004  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_set_property):
index da789d4131348c3f8df49ee956cb29be9ac18268..eb0e478f160c8f59d5978a4537cafc756c3dc3f8 100644 (file)
@@ -1,3 +1,19 @@
+2004-03-15  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
+       modes, set the Name entry of the file chooser if we get a
+       nonexistent filename from the file entry.  Fixes #135911.
+       (gtk_file_chooser_default_set_current_name): Oops, this should
+       also work if we are in CREATE_FOLDER mode.
+
+       * gtk/gtkfilesystem.c (gtk_file_path_real_copy): Use
+       gtk_file_path_copy().
+
+       * gtk/gtkfilechooserentry.c (check_completion_callback): Free the
+       path that we got from the model.
+       (completion_match_func): Use DISPLAY_NAME_COLUMN rather than a
+       hard-coded constant.
+
 Mon Mar 15 13:50:14 2004  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_set_property):
index da789d4131348c3f8df49ee956cb29be9ac18268..eb0e478f160c8f59d5978a4537cafc756c3dc3f8 100644 (file)
@@ -1,3 +1,19 @@
+2004-03-15  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
+       modes, set the Name entry of the file chooser if we get a
+       nonexistent filename from the file entry.  Fixes #135911.
+       (gtk_file_chooser_default_set_current_name): Oops, this should
+       also work if we are in CREATE_FOLDER mode.
+
+       * gtk/gtkfilesystem.c (gtk_file_path_real_copy): Use
+       gtk_file_path_copy().
+
+       * gtk/gtkfilechooserentry.c (check_completion_callback): Free the
+       path that we got from the model.
+       (completion_match_func): Use DISPLAY_NAME_COLUMN rather than a
+       hard-coded constant.
+
 Mon Mar 15 13:50:14 2004  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_set_property):
index da789d4131348c3f8df49ee956cb29be9ac18268..eb0e478f160c8f59d5978a4537cafc756c3dc3f8 100644 (file)
@@ -1,3 +1,19 @@
+2004-03-15  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
+       modes, set the Name entry of the file chooser if we get a
+       nonexistent filename from the file entry.  Fixes #135911.
+       (gtk_file_chooser_default_set_current_name): Oops, this should
+       also work if we are in CREATE_FOLDER mode.
+
+       * gtk/gtkfilesystem.c (gtk_file_path_real_copy): Use
+       gtk_file_path_copy().
+
+       * gtk/gtkfilechooserentry.c (check_completion_callback): Free the
+       path that we got from the model.
+       (completion_match_func): Use DISPLAY_NAME_COLUMN rather than a
+       hard-coded constant.
+
 Mon Mar 15 13:50:14 2004  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_set_property):
index da789d4131348c3f8df49ee956cb29be9ac18268..eb0e478f160c8f59d5978a4537cafc756c3dc3f8 100644 (file)
@@ -1,3 +1,19 @@
+2004-03-15  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
+       modes, set the Name entry of the file chooser if we get a
+       nonexistent filename from the file entry.  Fixes #135911.
+       (gtk_file_chooser_default_set_current_name): Oops, this should
+       also work if we are in CREATE_FOLDER mode.
+
+       * gtk/gtkfilesystem.c (gtk_file_path_real_copy): Use
+       gtk_file_path_copy().
+
+       * gtk/gtkfilechooserentry.c (check_completion_callback): Free the
+       path that we got from the model.
+       (completion_match_func): Use DISPLAY_NAME_COLUMN rather than a
+       hard-coded constant.
+
 Mon Mar 15 13:50:14 2004  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_set_property):
index f5860d5df16ca3eb116b25372caf3c77e7385a2e..667a0a54723e8c37957816d13261d70176cc2a58 100644 (file)
@@ -3757,7 +3757,8 @@ gtk_file_chooser_default_set_current_name (GtkFileChooser *chooser,
 {
   GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser);
 
-  g_return_if_fail (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE);
+  g_return_if_fail (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
+                   || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
 
   gtk_entry_set_text (GTK_ENTRY (impl->save_file_name_entry), name);
 }
@@ -4951,11 +4952,17 @@ update_from_entry (GtkFileChooserDefault *impl,
 
       if (!info)
        {
-#if 0
-         if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
-           return;
-#endif
-         error_getting_info_dialog (impl, subfolder_path, error);
+         if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
+             || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+           {
+             if (!change_folder_and_display_error (impl, folder_path))
+               goto out;
+
+             gtk_file_chooser_default_set_current_name (GTK_FILE_CHOOSER (impl), file_part);
+           }
+         else
+           error_getting_info_dialog (impl, subfolder_path, error);
+
          goto out;
        }
 
index 6431da94fb071cea5bb183cc4af0d830700fb571..87be48ab528e83c72fa1d44ab5b3cae51dea9915 100644 (file)
@@ -300,7 +300,7 @@ completion_match_func (GtkEntryCompletion *comp,
   if (chooser_entry->no_pop_down)
     return FALSE;
 
-  gtk_tree_model_get (GTK_TREE_MODEL (chooser_entry->completion_store), iter, 0, &name, -1);
+  gtk_tree_model_get (GTK_TREE_MODEL (chooser_entry->completion_store), iter, DISPLAY_NAME_COLUMN, &name, -1);
   if (!name)
     {
       return FALSE; /* Uninitialized row, ugh */
@@ -431,6 +431,7 @@ check_completion_callback (GtkFileChooserEntry *chooser_entry)
        }
 
       g_free (display_name);
+      gtk_file_path_free (path);
       valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (chooser_entry->completion_store),
                                        &iter);
     }
index cd2b072257f24afc24bdb0e9230197188bbee779..4f176f6fe239125c7c0d0e2ba7eec0917b3a6bb8 100644 (file)
@@ -886,7 +886,7 @@ gtk_file_folder_get_info (GtkFileFolder     *folder,
 static gpointer
 gtk_file_path_real_copy (gpointer boxed)
 {
-  return gtk_file_path_new_dup (gtk_file_path_get_string ((GtkFilePath *) boxed));
+  return gtk_file_path_copy ((GtkFilePath *) boxed);
 }
 
 static void