diff options
author | Federico Mena Quintero <federico@ximian.com> | 2004-03-15 19:23:54 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2004-03-15 19:23:54 +0000 |
commit | 3e3ca555359d7fbf563281dd918feaa201b60f64 (patch) | |
tree | 4916d9c6a236c5687df5fb70e8b07dbf5a1b69e1 /gtk/gtkfilechooserdefault.c | |
parent | afc7df895c4f704afed61e78691e33cc4ab39856 (diff) | |
download | gtk+-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/gtkfilechooserdefault.c')
-rw-r--r-- | gtk/gtkfilechooserdefault.c | 19 |
1 files changed, 13 insertions, 6 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; } |