Added a has_editable field. (_gtk_file_system_model_add_editable): New

2004-01-16  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModel): Added a
	has_editable field.
	(_gtk_file_system_model_add_editable): New function.
	(_gtk_file_system_model_remove_editable): New function.
	(gtk_file_system_model_get_value): Return appropriate values for
	the temporary editable row.
	(_gtk_file_system_model_get_info): Handle the editable row.
	(_gtk_file_system_model_get_path): Likewise.

	* gtk/gtkfilechooserdefault.c (shortcuts_append_bookmarks):
	Removed an unused variable.
	(toolbar_button_new): Optionally show the button.
	(up_button_clicked_cb): Renamed from up_button_cb(), fixed prototype.
	(toolbar_create): Add a "New Folder" button for Save mode.
	(error_building_filename_dialog): New helper function.
	(gtk_file_chooser_default_get_paths): Use error_building_filename_dialog().
	(create_file_list): Connect to the "edited" signal of the text
	cell renderer.  Store the name column and text renderer in the
	impl structure.
	(renderer_edited_cb): New callback.
	(gtk_file_chooser_default_set_property): Show/hide the "New
	folder" button when the save action changes.
	(COMPARE_DIRECTORIES): Allow the info values to be NULL.
	(COMPARE_DIRECTORIES): Duh, use the list_model, not the
	tree_model.
	(get_list_file_info): Likewise!
	(list_icon_data_func): Handle the path being NULL.
	(new_folder_button_clicked): New callback.
	(list_name_data_func): If we are on the editable row, set the text
	to "Type name of new folder".
	(list_selection_changed): Handle the editable row.
	(list_mtime_data_func): Likewise.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_make_path): Return
	NULL, not FALSE.
	(gtk_file_system_unix_create_folder): Test the result of mkdir() correctly.
This commit is contained in:
Federico Mena Quintero
2004-01-17 04:34:49 +00:00
committed by Federico Mena Quintero
parent 07d4d314b6
commit 02cb455471
9 changed files with 479 additions and 43 deletions

View File

@ -324,7 +324,7 @@ gtk_file_system_unix_create_folder (GtkFileSystem *file_system,
filename = filename_from_path (path);
g_return_val_if_fail (filename != NULL, FALSE);
result = mkdir (filename, 0777) != 0;
result = mkdir (filename, 0777) == 0;
if (!result)
{
@ -448,7 +448,7 @@ gtk_file_system_unix_make_path (GtkFileSystem *file_system,
g_error_free (tmp_error);
g_free (base_filename);
return FALSE;
return NULL;
}
full_filename = g_build_filename (base_filename, filename, NULL);