Expand the Save example to point out the correct usage of

2005-07-21  Federico Mena Quintero  <federico@ximian.com>

	* gtk/tmpl/gtkfilechooserdialog.sgml (dialog): Expand the Save
	example to point out the correct usage of _set_current_folder()
	and _set_current_name(), versus _set_filename() alone.
This commit is contained in:
Federico Mena Quintero 2005-07-22 02:51:37 +00:00 committed by Federico Mena Quintero
parent 49e9aef502
commit 66bcd52099
2 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2005-07-21 Federico Mena Quintero <federico@ximian.com>
* gtk/tmpl/gtkfilechooserdialog.sgml (dialog): Expand the Save
example to point out the correct usage of _set_current_folder()
and _set_current_name(), versus _set_filename() alone.
2005-07-15 Matthias Clasen <mclasen@redhat.com>
* === Released 2.7.3 ===

View File

@ -65,6 +65,15 @@ dialog = gtk_file_chooser_dialog_new ("Save File",
NULL);
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
if (user_edited_a_new_document)
{
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), default_folder_for_saving);
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "Untitled document");
}
else
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog), filename_for_existing_document);
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
{
char *filename;