2004-03-19  Federico Mena Quintero  <federico@ximian.com>

	Fix #137520.

	* gtk/gtkfilesystem.h (struct _GtkFileFolderIface): Added slots
	for an ::is_finished_loading() method and a ::finished_loading()
	signal at the end of the struct.

	* gtk/gtkfilesystem.c (gtk_file_folder_base_init): Create the
	"finished-loading" signal.
	(gtk_file_folder_is_finished_loading): New function.

	* gtk/gtkfilesystemunix.c
	(gtk_file_folder_unix_is_finished_loading): Implement.

	* gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModelClass): New
	slot for a "finished-loading" signal.
	(gtk_file_system_model_class_init): Create the "finished-loading"
	signal.
	(struct _GtkFileSystemModel): New field
	idle_finished_loading_source.  We emit the "finished-loading"
	signal in an idle if the root folder was done loading right in
	_gtk_file_system_model_new(), so that the caller has a chance to
	connect to the signal.
	(_gtk_file_system_model_new): Connect to the normal signals of the
	folder even if the initial _list_children() fails.  Also, see if
	the folder is finished loading; connect to the "finished-loading"
	signal otherwise.
	(gtk_file_system_model_finalize): Remove the idle handler.

	* gtk/gtkfilechooserdefault.c (set_list_model): Set a busy cursor
	and connect to the model's "finished-loading" signal.
	(get_toplevel): New helper function.
	(error_message): Use get_toplevel().
	(trap_activate_cb): Likewise.
	(location_popup_handler): Likewise.
	(set_busy_cursor): New function.
	(browse_files_model_finished_loading_cb): New callback.
This commit is contained in:
Federico Mena Quintero
2004-03-19 19:41:06 +00:00
committed by Federico Mena Quintero
parent 0da002e0f2
commit 68030a7ee7
10 changed files with 368 additions and 36 deletions

View File

@ -203,6 +203,8 @@ static gboolean gtk_file_folder_unix_list_children (GtkFileFolder *folder,
GSList **children,
GError **error);
static gboolean gtk_file_folder_unix_is_finished_loading (GtkFileFolder *folder);
static GtkFilePath *filename_to_path (const gchar *filename);
static gboolean filename_is_root (const char *filename);
@ -1464,6 +1466,7 @@ gtk_file_folder_unix_iface_init (GtkFileFolderIface *iface)
{
iface->get_info = gtk_file_folder_unix_get_info;
iface->list_children = gtk_file_folder_unix_list_children;
iface->is_finished_loading = gtk_file_folder_unix_is_finished_loading;
}
static void
@ -1623,6 +1626,12 @@ gtk_file_folder_unix_list_children (GtkFileFolder *folder,
return TRUE;
}
static gboolean
gtk_file_folder_unix_is_finished_loading (GtkFileFolder *folder)
{
/* Since we don't do asynchronous loads, we are always finished loading */
return TRUE;
}
static void
free_stat_info_entry (struct stat_info_entry *entry)