summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2004-03-15 19:23:54 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2004-03-15 19:23:54 +0000
commit3e3ca555359d7fbf563281dd918feaa201b60f64 (patch)
tree4916d9c6a236c5687df5fb70e8b07dbf5a1b69e1 /gtk
parentafc7df895c4f704afed61e78691e33cc4ab39856 (diff)
downloadgtk+-3e3ca555359d7fbf563281dd918feaa201b60f64.tar.gz
In the Save modes, set the Name entry of the file chooser if we get a
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.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkfilechooserdefault.c19
-rw-r--r--gtk/gtkfilechooserentry.c3
-rw-r--r--gtk/gtkfilesystem.c2
3 files changed, 16 insertions, 8 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index f5860d5df1..667a0a5472 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -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;
}
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 6431da94fb..87be48ab52 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -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);
}
diff --git a/gtk/gtkfilesystem.c b/gtk/gtkfilesystem.c
index cd2b072257..4f176f6fe2 100644
--- a/gtk/gtkfilesystem.c
+++ b/gtk/gtkfilesystem.c
@@ -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