Added methods for ::get_supports_bookmarks(), ::set_bookmarks(),

2003-10-07  Federico Mena Quintero  <federico@ximian.com>

	* gtkfilesystem.h (struct _GtkFileSystemIface): Added methods for
	::get_supports_bookmarks(), ::set_bookmarks(), ::list_bookmarks().
	Added a ::bookmarks_changed() signal.

	* gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): New function.
	(gtk_file_system_set_bookmarks): New function.
	(gtk_file_system_list_bookmarks): New function.
	(gtk_file_system_base_init): Create the "bookmarks-changed" signal.
	(gtk_file_paths_copy): New function.

	* gtkfilesystemunix.c (gtk_file_system_unix_get_supports_bookmarks): Implement.
	(gtk_file_system_unix_set_bookmarks): Implement.
	(gtk_file_system_unix_get_bookmarks): Implement.

	* gtkfilesystemgnomevfs.c (struct _GtkFileSystemGnomeVFS): Added
	fields for the bookmarks and the GConfClient.
	(gtk_file_system_gnome_vfs_set_bookmarks): Implement.
	(gtk_file_system_gnome_vfs_list_bookmarks): Implement.

	* gtkfilechooserprivate.h (struct _GtkFileChooserIface): Added
	methods for ::set_shortcut_folders(), ::list_shortcut_folders().

	* gtkfilechooser.c (gtk_file_chooser_set_shortcut_folders): New
	function.
	(gtk_file_chooser_list_shortcut_folders): New function.

	* gtkfilechooserimpldefault.c (create_shortcuts_model): Unref the
	old shortcuts model if it exists.  Create the nodes for the
	app-specific shortcut folders.
	(struct _GtkFileChooserImplDefault): Added a field for the
	shortcut_folders.
	(gtk_file_chooser_impl_default_set_shortcut_folders): Implement.
	(select_shortcuts_folder): New helper function.
	(gtk_file_chooser_impl_default_set_current_folder): Use
	select_shortcuts_folder().
	(shortcuts_append_path): Get the file info here, instead of the
	caller.
	(shortcuts_append_home): Use shortcuts_append_path().
	(shortcuts_append_file_system_roots): Likewise.
	(create_shortcuts_model): Add the app-specific shortcut folders
	and the bookmarks.
	(gtk_file_chooser_impl_default_list_shortcut_folders): Implement.
	(create_shortcuts_tree): Added a button to let the user add the
	current folder to the bookmarks.
	(gtk_file_chooser_impl_default_set_property): Connect to
	"bookmarks-changed" on the file system.
	(shortcuts_append_bookmarks): New function.

	* configure.ac: Depend on GConf.
This commit is contained in:
Federico Mena Quintero
2003-10-08 04:14:55 +00:00
committed by Federico Mena Quintero
parent cc46d181bd
commit 462aab4a64
7 changed files with 478 additions and 135 deletions

View File

@ -112,6 +112,12 @@ static GtkFilePath *gtk_file_system_unix_uri_to_path (GtkFileSystem *fi
static GtkFilePath *gtk_file_system_unix_filename_to_path (GtkFileSystem *file_system,
const gchar *filename);
static gboolean gtk_file_system_unix_get_supports_bookmarks (GtkFileSystem *file_system);
static void gtk_file_system_unix_set_bookmarks (GtkFileSystem *file_system,
GSList *bookmarks,
GError **error);
static GSList * gtk_file_system_unix_list_bookmarks (GtkFileSystem *file_system);
static GType gtk_file_folder_unix_get_type (void);
static void gtk_file_folder_unix_class_init (GtkFileFolderUnixClass *class);
static void gtk_file_folder_unix_iface_init (GtkFileFolderIface *iface);
@ -213,6 +219,9 @@ gtk_file_system_unix_iface_init (GtkFileSystemIface *iface)
iface->path_to_filename = gtk_file_system_unix_path_to_filename;
iface->uri_to_path = gtk_file_system_unix_uri_to_path;
iface->filename_to_path = gtk_file_system_unix_filename_to_path;
iface->get_supports_bookmarks = gtk_file_system_unix_get_supports_bookmarks;
iface->set_bookmarks = gtk_file_system_unix_set_bookmarks;
iface->list_bookmarks = gtk_file_system_unix_list_bookmarks;
}
static void
@ -532,6 +541,29 @@ gtk_file_system_unix_filename_to_path (GtkFileSystem *file_system,
return gtk_file_path_new_dup (filename);
}
static gboolean
gtk_file_system_unix_get_supports_bookmarks (GtkFileSystem *file_system)
{
return FALSE;
}
static void
gtk_file_system_unix_set_bookmarks (GtkFileSystem *file_system,
GSList *bookmarks,
GError **error)
{
g_set_error (error,
GTK_FILE_SYSTEM_ERROR,
GTK_FILE_SYSTEM_ERROR_FAILED,
"This file system does not support bookmarks");
}
static GSList *
gtk_file_system_unix_list_bookmarks (GtkFileSystem *file_system)
{
return NULL;
}
/*
* GtkFileFolderUnix
*/