Commit Graph

24 Commits

Author SHA1 Message Date
Federico Mena Quintero
764b163ce6 Duh, duh, duh! Don't bail out if the bookmarks file doesn't exist the very
2004-02-13  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_add_bookmark):
	Duh, duh, duh!  Don't bail out if the bookmarks file doesn't exist
	the very first time you try to save one.
2004-02-14 02:00:40 +00:00
Federico Mena Quintero
52383cbb58 If the folder is already open, add the requested info types to it.
2004-02-09  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_folder): If
	the folder is already open, add the requested info types to it.
2004-02-09 19:01:25 +00:00
Federico Mena Quintero
bf54dcdc5c Fix #132327.
2004-02-06  Federico Mena Quintero  <federico@ximian.com>

	Fix #132327.

	* gtk/gtkfilesystemunix.c (struct _GtkFileSystemUnix): Add a
	folder_hash field to keep a list of live folder objects.
	(gtk_file_system_unix_init): Create the folder_hash.
	(gtk_file_system_unix_finalize): Destroy the folder_hash.
	(gtk_file_system_unix_get_folder): Ref and return an existing
	folder if we have it around, otherwise return a new folder object.
	(struct _GtkFileFolderUnix): Add a field for the parent file system.
	(gtk_file_folder_unix_finalize): Remove the folder from the file
	system's hash table.
	(gtk_file_system_unix_create_folder):  Emit "files-added" on the
	newly-created folder's parent.  Fixes #132327.
2004-02-06 16:15:01 +00:00
Matthias Clasen
4b50166b82 Initialize result to FALSE. (#133539, Morten Welinder)
Thu Feb  5 22:05:52 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkfilesystemunix.c (bookmark_list_read): Initialize result
	to FALSE.  (#133539, Morten Welinder)
2004-02-05 21:03:13 +00:00
Federico Mena Quintero
275cf046cf Fix #129872, based on a patch by Jan Arne Petersen <jpetersen@uni-bonn.de>
2004-01-30  Federico Mena Quintero  <federico@ximian.com>

	Fix #129872, based on a patch by Jan Arne Petersen
	<jpetersen@uni-bonn.de>

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_list_bookmarks):
	Implement.
	(gtk_file_system_unix_add_bookmark): Implement.
	(gtk_file_system_unix_remove_bookmark): Implement.

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

	Fixes #132693.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_parent): Don't
	use filename_from_path().  Also, check that the filename is
	absolute.
	(gtk_file_system_unix_get_folder): Likewise.
	(gtk_file_system_unix_create_folder): Likewise.
	(gtk_file_system_unix_make_path): Likewise.
	(gtk_file_system_unix_parse): Likewise.
	(gtk_file_folder_unix_get_info): Likewise.
	(filename_from_path): Removed.
2004-01-30 18:02:44 +00:00
Federico Mena Quintero
7af769f92c Fix #132314.
2004-01-27  Federico Mena Quintero  <federico@ximian.com>

	Fix #132314.

	* gtk/gtkfilesystem.h: Removed the #ifdef-ed out, old icon API.

	* gtk/gtkfilesystem.c: Likewise.

	* gtk/gtkfilesystemunix.c (filename_get_info): Removed the old
	icon-type code.
	(gtk_file_system_unix_render_icon): Moved the icon-rendering code
	from GtkFileInfo to here.
	(gtk_file_system_unix_volume_render_icon): Implement.
2004-01-27 23:20:01 +00:00
Federico Mena Quintero
02cb455471 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.
2004-01-17 04:34:49 +00:00
Federico Mena Quintero
f2f12b9aae New get_volume_for_path() method. (struct _GtkFileSystemIface): Finally
2004-01-16  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystem.h (struct _GtkFileSystemIface): New
	get_volume_for_path() method.
	(struct _GtkFileSystemIface): Finally removed the list_roots() and
	get_root_info() methods, and the "roots-changed" signal.

	* gtk/gtkfilesystem.c (gtk_file_system_get_volume_for_path): New
	function.
	(gtk_file_system_list_roots): Removed.
	(gtk_file_system_get_root_info): Removed.

	* gtk/gtkfilesystemunix.c
	(gtk_file_system_unix_get_volume_for_path): Implement.
	(get_root_volume): New helper function.
	(gtk_file_system_unix_list_volumes): Use get_root_volume().
	(gtk_file_system_unix_list_roots): Removed.
	(gtk_file_system_unix_get_root_info): Removed.

	* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_new): Don't
	accept a NULL root_path.
	(struct _GtkFileSystemModel): Add a field to remember the
	root_path.
	(_gtk_file_system_model_new): Store the root_path in the model
	structure.
	(find_and_ref_path): Stop going up the hierarchy at the root_path
	of the model.  Also, don't return prematurely when walking up the
	hierarchy.

	* gtk/gtkfilechooserdefault.c (create_file_list): Sigh, restore
	the rules_hint.
	(struct _GtkFileChooserDefault): Added a current_volume_path field.
	(set_tree_model): New function; create the folder tree model here.
	(create_folder_tree): Don't create the model here.
	(set_list_model): Set the show_hidden flag on the list model.
2004-01-16 03:35:33 +00:00
Federico Mena Quintero
24b50606f9 g_path_skip_root() can return NULL; handle this. Fixes #129565.
2004-01-06  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystemunix.c (filename_is_root): g_path_skip_root()
	can return NULL; handle this.  Fixes #129565.
2004-01-06 20:20:43 +00:00
Federico Mena Quintero
8baf8571b5 Added a "volumes-changed" signal. Added the following methods:
2003-12-16  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystem.h (struct _GtkFileSystemIface): Added a
	"volumes-changed" signal.  Added the following methods:
		list_volumes
		volume_free
		volume_get_base_path
		volume_get_is_mounted
		volume_mount
		volume_get_display_name
		volume_render_icon

	* gtk/gtkfilesystem.c (gtk_file_system_base_init): Create the
	"volumes-changed" signal.
	(gtk_file_system_list_volumes): New function.
	(gtk_file_system_volume_free): New function.
	(gtk_file_system_volume_get_base_path): New function.
	(gtk_file_system_volume_get_is_mounted): New function.
	(gtk_file_system_volume_mount): New function.
	(gtk_file_system_volume_get_display_name): New function.
	(gtk_file_system_volume_render_icon): New function.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_volume_free): Implement.
	(gtk_file_system_unix_volume_get_base_path): Implement.
	(gtk_file_system_unix_volume_get_is_mounted): Implement.
	(gtk_file_system_unix_volume_mount): Implement.
	(gtk_file_system_unix_volume_get_display_name): Implement.
	(gtk_file_system_unix_volume_render_icon): Implement.

	* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
	Added a field for the "volumes-changed" signal connection.
	(gtk_file_chooser_default_set_property): Connect to
	"volumes-changed" on the file system.
	(gtk_file_chooser_default_finalize): Disconnect from
	"volumes-changed".

	* gtk/gtkfilechooserdefault.c (shortcuts_remove_rows): New helper
	function.
	(shortcuts_get_index): New helper function.
	(shortcuts_insert_path): Can now insert volumes as well as paths.
	(shortcuts_append_paths): Don't take is_file_system_root.
	(shortcuts_add_volumes): New function.
	(shortcuts_append_file_system_roots): Removed.
	(create_shortcuts_model): Use shortcuts_add_volumes().
	(remove_bookmark_button_clicked_cb): Check that the index is
	within range.
	(bookmarks_check_add_sensitivity): Take volumes into account.
	(shortcuts_get_selected_index): New helper function.
	(remove_bookmark_button_clicked_cb): Use
	shortcuts_get_selected_index().
	(bookmarks_check_remove_sensitivity): Likewise.
	(shortcuts_select_func): Likewise.
	(shortcuts_row_activated_cb): Handle volumes as well as normal
	paths.
	(shortcuts_activate_volume): New function.
	(struct _GtkFileChooserDefault): Removed the bookmarks_set and
	bookmarks_iter fields.
	(shortcuts_append_bookmarks): Use shortcuts_remove_rows().
	(bookmarks_changed_cb): Use shortcuts_add_bookmarks().
	(remove_bookmark_rows): Removed.
	(shortcuts_add_bookmarks): New function; moved most of the code
	over from shortcuts_append_bookmarks().
	(shortcuts_append_bookmarks): Add the separator node here, and
	then call shortcuts_add_bookmarks().
2003-12-17 05:55:16 +00:00
Federico Mena Quintero
a3976b68b6 Added a render_icon virtual method.
2003-11-19  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystem.h (struct _GtkFileSystemIface): Added a
	render_icon virtual method.

	* gtk/gtkfilesystem.c (gtk_file_system_render_icon): New function.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_render_icon):
	Implement as a stub for now.

	* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Use
	gtk_file_system_render_icon().
	(list_icon_data_func): Likewise.
	(toolbar_create): Set the toolbar style to icons only.

	* gtk/gtkfilechooser.c (gtk_file_chooser_add_shortcut_folder_uri):
	Fix doc comments.
2003-11-19 17:03:32 +00:00
Federico Mena Quintero
3dbad630ac Add a stock icon to the "Add bookmark" button.
2003-11-03  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (create_shortcuts_tree): Add a stock
	icon to the "Add bookmark" button.

	* gtk/gtkfilesystemunix.c: Mark missing strings for translation.
	* gtk/gtkfilesystemmodel.c: Likewise.
	* gtk/gtkfilechooser.c: Likewise.
	* gtk/gtkfilechooserdefault.c: Likewise.

Mon Nov  3 20:56:28 2003  Matthias Clasen  <maclas@gmx.de>
2003-11-03 20:24:04 +00:00
Owen Taylor
b3bae3b40a gtk/gtkfilechooserutils.c gtk/gtkfilechooserprivate.[ch]: Basic framework
Wed Oct 22 23:20:04 2003  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkfilechooser.[ch] gtk/gtkfilefilter.[ch]
        gtk/gtkfilechooserwidget.[ch] gtk/gtkfilechooserdialog.[ch]:
        gtk/gtkfilechooserutils.c gtk/gtkfilechooserprivate.[ch]:
        Basic framework for the new file selector widget.

        * gtk/gtkfilechooserdefault.[ch] gtk/gtkcellrenderersep.[ch]
        gtk/gtkfilechooserentry.[ch] gtk/gtkfilesystemmodel.[ch]:
        Initial implementation of the GtkFileChooser user interface.

        * gtk/gtkfilesystemunix.[ch]: GtkFileSystem implementation
        for Unix files.

        * configure.in gtk/Makefile.am gtk/xdgmime: Build code
        for freedesktop.org MIME system on Unix.

        * tests/testfilechooser.c: Test program for GtkFileChooser

        * tests/prop-editor.c: Add support for properties on interfaces.
2003-10-23 04:22:32 +00:00
Federico Mena Quintero
1e49d49a3e New utility function. (gtk_file_system_gnome_vfs_get_folder): Use
2003-10-20  Federico Mena Quintero  <federico@ximian.com>

	* gtkfilesystemgnomevfs.c (folder_child_new): New utility
	function.
	(gtk_file_system_gnome_vfs_get_folder): Use folder_child_new().
	(gtk_file_folder_gnome_vfs_get_info): Likewise.
	(directory_load_callback): Likewise.
	(monitor_callback): Likewise.

	* TODO: Removed the item about factoring out the code that creates
	FolderChild structures.
2003-10-20 20:17:35 +00:00
Federico Mena Quintero
b49a5ec5b4 Removed. (gtk_file_system_gnome_vfs_set_bookmarks): Removed.
2003-10-17  Federico Mena Quintero  <federico@ximian.com>

	* gtkfilesystemgnomevfs.c
	(gtk_file_system_gnome_vfs_get_supports_bookmarks): Removed.
	(gtk_file_system_gnome_vfs_set_bookmarks): Removed.
	(gtk_file_system_gnome_vfs_add_bookmark): Implement.
	(gtk_file_system_gnome_vfs_remove_bookmark): Implement.

	* gtkfilechooserprivate.h (struct _GtkFileChooserIface): Replaced
	the ::set_shortcut_folders() method with :;add_shortcut_folder()
	and ::remove_shortcut_folder().

	* gtkfilechooserutils.c (delegate_add_shortcut_folder): New function.
	(delegate_remove_shortcut_folder): New function.
	(delegate_list_shortcut_folders): New function.

	* gtkfilechooserimpldefault.c (create_shortcuts_model): Insert the
	Desktop directory as well.
	(shortcuts_insert_path): Renamed from shortcuts_append_path; now
	takes a position index instead of a parent node iter.  Also takes
	a GError argument.
	(struct _GtkFileChooserImplDefault): Removed the shortcuts_folder
	list.  It is all kept in the model now.
	(shortcuts_append_home): Save whether adding a shortcut for the
	home directory was successful.
	(shortcuts_append_desktop): Likewise for the desktop.
	(shortcuts_append_file_system_roots): Count and save the number of
	roots added.
	(shortcuts_append_shortcut_folders): Removed.
	(gtk_file_chooser_impl_default_add_shortcut_folder): Implement.
	(shortcuts_append_bookmarks): Now that we don't have a bookmarks
	parent node, don't expand the tree.
	(add_bookmark_button_clicked_cb): Use gtk_file_system_add_bookmark().
	(remove_bookmark_button_clicked_cb): Use gtk_file_system_remove_bookmark().
	(gtk_file_chooser_impl_default_list_shortcut_folders): Get the
	folders from the shortcuts model; we no longer keep a separate list.

	* gtkfilesystem.h (struct _GtkFileSystemIface): Oops, there
	shouldn't be shortcuts-related virtual methods here.

	* gtkfilechooser.c (file_paths_to_strings): New helper function.
	(gtk_file_chooser_get_filenames): Use file_paths_to_strings().
	(gtk_file_chooser_get_uris): Likewise.
	(gtk_file_chooser_set_shortcut_folders): Removed.
	(gtk_file_chooser_list_shortcut_folders): Return a list of
	strings, not of GtkFilePath*.
	(gtk_file_chooser_list_shortcut_folder_uris): New function.
	(gtk_file_chooser_add_shortcut_folder): New function.
	(gtk_file_chooser_remove_shortcut_folder): New function.
	(gtk_file_chooser_add_shortcut_folder_uri): New function.
	(gtk_file_chooser_remove_shortcut_folder_uri): New function.
	(_gtk_file_chooser_add_shortcut_folder): New function.
	(_gtk_file_chooser_remove_shortcut_folder): New function.

	* gtkfilechooser.h: New enum.

	* gtkfilechooser.c (gtk_file_chooser_error_quark): New function.

	* gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): Removed.
	(gtk_file_system_set_bookmarks): Removed.
	(gtk_file_system_add_bookmark): New function.
	(gtk_file_system_remove_bookmark): New function.

	* gtkfilesystemunix.c
	(gtk_file_system_unix_get_supports_bookmarks): Removed.
	(gtk_file_system_unix_set_bookmarks): Removed.
	(gtk_file_system_unix_add_bookmark): Just a stub for now.
	(gtk_file_system_unix_remove_bookmark): Likewise.

	* testfilechooser.c (main): Add a shortcut for testing purposes.
2003-10-18 04:29:40 +00:00
Federico Mena Quintero
462aab4a64 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.
2003-10-08 04:14:55 +00:00
Federico Mena Quintero
cc4836c90b s/nonexistant/nonexistent Likewise. Likewise. Likewise.
2003-09-02  Federico Mena Quintero  <federico@ximian.com>

	* gtkfilesystem.h: s/nonexistant/nonexistent
	* gtkfilesystem.c: Likewise.
	* gtkfilesystemgnomevfs.c: Likewise.
	* gtkfilesystemunix.c: Likewise.

2003-08-27  Federico Mena Quintero  <federico@ximian.com>

	* README: The required GtkTreeView patches are already on CVS.
	Removed the part that mentions them.
2003-09-02 20:20:46 +00:00
Owen Taylor
7e54248bc3 auto-ize.
Wed Jul 16 16:50:31 2003  Owen Taylor  <otaylor@redhat.com>

        * configure.ac Makefile.am: auto-ize.

        * xdgmime/: Add freedesktop.org MIME spec implementatin
        by Jonathan Blandford.

        * gtkfilesystem.[ch]: Add gtk_file_info_render_icon()
        gtk_file_info_set/get_icon_type to do icon handling
        based on MIME type. Add a simple icon caching system.

        * gtkfilesystemgnomevfs.c: Implement ensure_types()
        so that extending the set of types for a loaded
        directory works. Set the MIME type to get the default
        icon handling.

        * gtkfilesystemunix.c: Look up the MIME type using
        xdgmime.

        * gtkfilechooserimpldefault.c: Display icons in the list.
2003-07-16 21:07:38 +00:00
Owen Taylor
bc3fb55c1b Move interface definition into a private header so it can refer to
Fri Apr  4 17:30:27 2003  Owen Taylor  <otaylor@redhat.com>

        * gtkfilechooserprivate.h gtkfilechooser.h: Move
        interface definition into a private header so it
        can refer to GtkFileSystem.

        * *.[ch]: Switch over from using gchar *uri internally
        to using GtkFilePath * internally, and add
        conversion routines to GtkFileSystem.

        * TODO README: Updates.
2003-04-04 22:43:12 +00:00
Owen Taylor
b4c81288e4 Finish monitoring, add a TODO, fill in details in README, fix some missing finalization chainups 2003-03-27 00:10:25 +00:00
Owen Taylor
bb320fcb5b Add GtkFileSystem::parse, and a chooser entry with completion 2003-03-25 00:11:06 +00:00
Owen Taylor
fe1c0a8bfd Add sorting, a size column.
Try making the tree view on the left auto-expand/collapse when
  the selection changes.
Some bug fixes.
2003-03-21 23:59:22 +00:00
Owen Taylor
d9748614f1 Add some documentation comments, fix some missing statics 2003-03-21 21:26:38 +00:00
Owen Taylor
e3849905a9 Initial revision 2003-03-21 20:34:02 +00:00