Commit graph

286 commits

Author SHA1 Message Date
Elliot Lee dfc585b327 Allocate an extra byte in the buffer, for safety's sake. Fix back/fwd
* libnautilus/nautilus-directory.c: Allocate an extra byte in the
  buffer, for safety's sake.
* src/ntl-window-msgs.c: Fix back/fwd buttons.
2000-01-21 20:56:02 +00:00
Elliot Lee 482a598e30 Remove debugging printouts, and display error dialogs.
* src/ntl-window-msgs.c: Remove debugging printouts, and display error dialogs.
2000-01-21 20:27:31 +00:00
Elliot Lee 84bc7431f1 Fix bug that was causing list view to be blank.
Fix bug that was causing list view to be blank.
2000-01-21 20:00:44 +00:00
Darin Adler 49f7a162e1 Started some cleanup of the icon view.
* libnautilus/Makefile.am:
	libnautilus/gnome-icon-container-layout.c:
	libnautilus/gnome-icon-container-layout.h:
	libnautilus/gnome-icon-container.c:
	libnautilus/gnome-icon-container.h:
	src/file-manager/fm-directory-view-icons.c:
	src/file-manager/fm-directory-view-icons.h:
	Got rid of the GnomeIconContainerLayout.
	This was the old mechanism for saving and loading
	icon positions and we have a better signal-based one.
	Also made the new mechanism work more the way that
	Ettore had intended to make the layout work, where
	all the icons that have preassigned positions get
	positioned first, then the ones that are auto positioned.
	In the long run, we'll need something a bit fancier.

	* libnautilus/gnome-icon-container-dnd.c:
	libnautilus/gnome-icon-container.c:
	libnautilus/gnome-icon-container.h:
	libnautilus/gnome-icon-container-private.h:
	Change the priv pointer to be named details to match
	what we use in other places in Nautilus.
2000-01-21 17:53:19 +00:00
John Sullivan 7c1de70be9 Activate on single-click in list view. 2000-01-21 16:23:06 +00:00
Andy Hertzfeld 8080e76fc8 disabled the pernicious call to relayout in size_allocate, at least
disabled the pernicious call to relayout in size_allocate, at least
      temporarily
2000-01-21 08:23:09 +00:00
John Sullivan c02264c8e0 Added missing entry. 2000-01-21 01:58:13 +00:00
Elliot Lee 1a5d67010a Missed piece in last commit.
Missed piece in last commit.
2000-01-21 01:19:19 +00:00
Darin Adler 97ce483ddd Fixed double free that was causing lots of nasty errors in the file
* src/file-manager/fm-directory-view.c:
	(fm_directory_view_activate_entry):
	Fixed double free that was causing lots of nasty errors in
	the file manager.
	(fm_directory_view_load_uri):
	Made the old directory hang around a bit longer when loading
	a new uri.
	(display_selection_info):
	(fm_directory_view_send_selection_change):
	(display_selection_info_idle_cb):
	Fixed a storage leak and broke out the selection change into
	its own function instead of mixing it with the status line.
	Also made the selection actually use URIs instead of just
	names for the selected items.

	* libnautilus/nautilus-directory.h:
	libnautilus/nautilus-directory.c:
	(nautilus_file_get_uri):
	Added this function that gets a URI (rather than just a
	leaf name).

	* libnautilus/nautilus-directory.c:
	(nautilus_directory_finalize):
	(nautilus_self_check_directory):
	Added more self checks and fixed a bug where a metadata
	change would get lost if you delete the directory too soon
	after making the change.
2000-01-21 01:13:12 +00:00
John Sullivan fde66d2ddd Moved fields inside private details structure. 2000-01-20 23:27:05 +00:00
Jonathan Blandford f7b5f98c67 more initialization to clean up an warning.
2000-01-20  Jonathan Blandford  <jrb@redhat.com>

        * src/file-manager/fm-directory-view-list.c (column_clicked_cb):
        more initialization to clean up an warning.
2000-01-20 23:03:12 +00:00
Darin Adler c4c5ae7de9 Fixed a bug where dragging an icon would cause the "kbd_selected" icon to
* src/gnome-icon-container.c:
	(gnome_icon_container_xlate_selected):
	Fixed a bug where dragging an icon would cause the "kbd_selected"
	icon to scroll into view. Just passed FALSE instead of TRUE for
	"schedule_visibility".

	* libnautilus/nautilus-background.c:
	(nautilus_background_draw_flat_box):
	Tiny change, to fit our style rule against initializing.
2000-01-20 22:54:35 +00:00
Jonathan Blandford 75cb3ed1f8 fix warning.
2000-01-20  Jonathan Blandford  <jrb@redhat.com>

	* libnautilus/nautilus-background.c
	(nautilus_background_draw_flat_box): fix warning.
2000-01-20 22:45:07 +00:00
Elliot Lee e7df9b4e9b Async notification of navinfo - now we just need an async get_file_info
* src/ntl-uri-map.c: Async notification of navinfo - now we just need an async get_file_info call.
* src/ntl-view.[ch]: Better error handling.
* src/file-manager/fm-directory-view.c (display_selection_info): Send a 'selection change' request.
* src/ntl-window-msgs.c: Totally rewrite the state changing machine. Now handles errors slightly
  better.
* src/ntl-types.h: Remove requesting_view from the navigation info.
* src/ntl-window.h: Move all the state machine stuff into NautilusWindow itself.
* src/ntl-window.c: Update for new 'stop doing stuff' API.
2000-01-20 21:59:03 +00:00
Darin Adler f804c9acd5 Store icon positions as "x,y" in ICON_POSITION instead of
storing ICON_X and ICON_Y.

	Take first step in moving the directory view to use the opaque
	NautilusDirectory and NautilusFile instead of using gnome-vfs
	directly. This will separate the controller from the model:
	FMDirectoryView is a controller and NautilusDirectory a model.

	* src/file-manager/fm-directory-view-icons.c:
	(add_to_icon_container):
	(fm_directory_view_icons_icon_moved_cb):
	Store icons positions as "x,y" in ICON_POSITION instead of storing
	separate numbers in ICON_X and ICON_Y.

	* libnautilus/nautilus-directory.h:
	libnautilus/nautilus-directory.c:
	(nautilus_directory_get_uri):
	Added a new call needed to replace fm_directory_view_get_uri.
	(nautilus_directory_get_file_metadata):
	(nautilus_directory_set_file_metadata):
	(nautilus_file_get_metadata):
	(nautilus_file_set_metadata):
	Moved the calls for getting and setting file metadata into the
	file objects.
	(nautilus_directory_new_file):
	(nautilus_file_get_info):
	Added temporary interfaces for the current situation where we're
	dealing with both NautilusFile and GnomeVFSFileInfo objects at
	once.
	(nautilus_directory_finalize):
	Detach and unref all the files when the directory is destroyed.
	(nautilus_file_unref):
	(nautilus_file_get_name):
	Implemented these functions now that we are using them.

	* src/file-manager/fm-directory-view.h:
	src/file-manager/fm-directory-view.c:
	(fm_directory_view_add_entry):
	(fm_directory_view_activate_entry):
	(display_selection_info):
	(fm_directory_view_get_selection):
	src/file-manager/fm-directory-view-icons.c:
	(add_to_icon_container):
	(fm_directory_view_icons_icon_moved_cb):
	(dm_directory_view_icons_add_entry):
	(fm_directory_view_icons_get_selection):
	(icon_container_activate_cb):
	src/file-manager/fm-directory-view-list.c:
	(add_to_flist):
	(fm_directory_view_list_add_entry):
	Change all the code to work with NautilusFile instead of
	GnomeVFSFileInfo, except for the parts of FMDirectoryView dealing
	with the directory_list.

	* src/file-manager/fm-directory-view.h:
	src/file-manager/fm-directory-view.c:
	(nautilus_file_date_as_string):
	(nautilus_file_size_as_string):
	(nautilus_file_type_as_string):
	libnautilus/nautilus-directory.h:
	libnautilus/nautilus-directory.c:
	(nautilus_file_get_date_as_string):
	(nautilus_file_get_size_as_string):
	(nautilus_file_get_type_as_string):
	Moved and renamed these functions and made them work on
	NautilusFile objects.
2000-01-20 21:23:35 +00:00
John Sullivan 430ca69cea Just fixed date. 2000-01-20 19:37:57 +00:00
John Sullivan 188354f817 Use name of item in status bar when one item selected. 2000-01-20 19:23:44 +00:00
Darin Adler 1546a8b2dc Made backgrounds work better in the list view. Gradients still
won't work because the list view draws its background with calls
	to gdk_draw_rectangle explicitly, and doesn't call the functions
	in the style, so it can't be overridden.

	* libnautilus/nautilus-background.c:
	(nautilus_background_set_widget_style): Fix bug where the list
	items were not highlighting properly. Set only the NORMAL and
	ACTIVE background color. That way we don't screw up the SELECTED
	and other background colors.
2000-01-20 18:19:46 +00:00
Darin Adler 390272a371 Fix segfault when viewing a directory without a metafile. 2000-01-20 17:28:47 +00:00
Darin Adler 72acf48fea The list view now has a background color just like the
icon view does. Some more code could be saved, but that's
	a refactoring for another time.

	* libnautilus/gtkflist.c: Added support for receiving dragged
	colors to set the background of the list.

	* src/file-manager/fm-directory-view-list.c:
	(fm_directory_view_list_initialize_class):
	(fm_directory_view_list_clear):
	(fm_directory_view_list_background_changed_cb): Added code to load
	and save the background color from metadata.

	* libnautilus/nautilus-background.c: Put the background color in
	all the bg and base colors in the style instead of putting it only
	in bg[GTK_STATE_NORMAL].

	* libnautilus/nautilus-gtk-macros.h:
	(NAUTILUS_DEFINE_CLASS_BOILERPLATE): Make sure that the macro only
	evaluates the parent_class_type argument once, like it says in the
	comment. (NAUTILUS_CALL_PARENT_CLASS): Fix this macro so it can
	be used in places where an expression is expected.

	* RENAMING: Added this file to list name changes we are
	planning for the future.

	* libnautilus/gtkflist.h: libnautilus/gtkflist.c:
	src/explorer-location-bar.h: src/explorer-location-bar.c:
	Minimized includes.

	* src/ntl-index-panel.c:
	src/file-manager/fm-directory-view-icons.c: Fixed some comments
	and formatting.
2000-01-20 01:08:12 +00:00
Darin Adler 771cbf47d6 Icon positions are now written out when you drag an icon,
and read in when you visit a directory. But the code then
	immediately re-lays out the icons, so the position is lost!

	* src/file-manager/fm-directory-view-icons.c:
	(fm_directory_view_icons_icon_moved_cb):
	(fm_directory_view_icons_initialize): (add_container_icon): Save
	icon position when an icon is moved. Get icon position when an
	icon is first created.

	* libnautilus/nautilus-directory.c:
	(nautilus_directory_get_metadata_from_node):
	(nautilus_directory_get_metadata):
	(nautilus_directory_create_metafile_tree_root):
	(nautilus_directory_get_metadata):
	(nautilus_directory_set_metadata):
	(nautilus_directory_get_file_metadata):
	(nautilus_directory_set_file_metadata): Added the routines to get
	and set metadata for individual files.

	* libnautilus/nautilus-string.h: libnautilus/nautilus-string.c:
	(nautilus_eat_strcmp): (nautilus_string_to_int):
	(nautilus_eat_string_to_int): Made new string functions that free
	the existing strings, and a function to convert an int to a
	string.

	* libnautilus/gnome-icon-container.h:
	libnautilus/gnome-icon-container.c: (move_icon): (class_init):
	(handle_icon_button_press): Added context_click_background and
	icon_moved signals, and renamed context_click to
	context_click_icon.

	* configure.in: Turned -Wunused back on. I had to turn -W off,
	but I think it's worth it.
2000-01-19 23:39:56 +00:00
John Sullivan 8d1eba0905 Ref and destroy file infos correctly. 2000-01-19 21:02:01 +00:00
Darin Adler edb4ab4e6f After Andy explained his change to me, I realized that it would always
* libnautilus/nautilus-directory.c: (nautilus_directory_finalize):
	(nautilus_directory_try_to_read_metafile):
	(nautilus_directory_read_metafile):
	(nautilus_directory_try_to_write_metafile):
	(nautilus_directory_write_metafile):
	(nautilus_directory_construct_alternate_metafile_uri):
	(nautilus_directory_new): After Andy explained his change to me, I
	realized that it would always write the metafile in the alternate
	place if there was no pre-existing metafile. So I changed the
	logic. The new rule is: read the metafile from the alternate
	location first. If we find it there, write it back
	there. Otherwise, try to write in the directory itself. If that
	fails, write it in the alternate location instead.

	* libnautilus/nautilus-directory.c:
	(nautilus_directory_get_metadata): Allow get_metadata on a NULL
	NautilusDirectory and return NULL for data.
2000-01-19 19:08:03 +00:00
Darin Adler 4dc286da90 Allow changing the background of the icon view by dropping colors
on the icon view.

	* libnautilus/gnome-icon-container-dnd.h:
	libnautilus/gnome-icon-container-dnd.c:
	(gnome_icon_container_position_shadow): (drag_data_received_cb):
	(gnome_icon_container_ensure_drag_data): (drag_motion_cb):
	(drag_drop_cb): (gnome_icon_container_receive_dropped_icons):
	(gnome_icon_container_free_drag_data): (drag_leave_cb): Added
	support for receiving dropped colors to change the background of a
	GnomeIconContainer.

	* src/file-manager/fm-directory-view-icons.c:
	(fm_directory_view_icons_initialize_class):
	(fm_directory_view_icons_clear):
	(fm_directory_view_icons_background_changed_cb): Added code to
	load and save the background color from metadata.

	* libnautilus/gdk-extensions.c: (nautilus_gradient_new): Changed
	nautilus_gradient_new to handle NULLs in the same way that the
	rest of the gradient functions do instead of NULL being an illegal
	input value.

	* src/file-manager/fm-directory-view.h:
	src/file-manager/fm-directory-view.c:
	(fm_directory_view_initialize): (fm_directory_view_destroy):
	(fm_directory_view_get_model): (fm_directory_view_load_uri): Added
	a NautilusDirectory object to each directory view, accessed by
	subclasses with a call to fm_directory_view_get_model.

	* libnautilus/nautilus-gtk-extensions.h:
	libnautilus/nautilus-gtk-extensions.c:
	(gnome_icon_container_dropped_icon_feedback):
	(nautilus_gdk_selection_data_copy_deep): Added deep versions of
	these GtkSelectionData functions.

	* libnautilus/nautilus-gtk-macros.h:
	(NAUTILUS_DEFINE_GET_TYPE_FUNCTION):
	(NAUTILUS_DEFINE_CLASS_BOILERPLATE): Added definition and
	initialization of the parent_class global to
	NAUTILUS_DEFINE_GET_TYPE_FUNCTION and renamed it to
	NAUTILUS_DEFINE_CLASS_BOILERPLATE.

	* libnautilus/nautilus-background-canvas-group:
	(nautilus_background_canvas_group_initialize_class):
	libnautilus/nautilus-background.c:
	(nautilus_background_initialize_class):
	libnautilus/nautilus-directory.c:
	(nautilus_directory_initialize_class): src/ntl-index-panel.c:
	(nautilus_index_panel_initialize_class):
	src/file-manager/fm-directory-view-icons.c:
	(fm_directory_view_icons_initialize_class):
	src/file-manager/fm-directory-view-list.c:
	(fm_directory_view_list_initialize_class):
	src/file-manager/fm-directory-view.c:
	(fm_directory_view_initialize_class): Take advantage of the new
	NAUTILUS_DEFINE_CLASS_BOILERPLATE and get rid of existing code to
	set up parent_class.

	* libnautilus/gnome-icon-container-dnd.h:
	libnautilus/gnome-icon-container-dnd.c:
	libnautilus/gnome-icon-container-layout.h:
	libnautilus/gnome-icon-container-layout.c:
	libnautilus/gnome-icon-container.c: Minimized includes.
2000-01-19 18:34:33 +00:00
Andy Hertzfeld 2689b7f236 made icons centered with respect to the text
made icons centered with respect to the text
2000-01-19 08:03:22 +00:00
Ettore Perazzoli 8881c805e3 Use gnome_vfs_file_info_unref', not gnome_vfs_file_info_destroy'. 2000-01-19 03:12:00 +00:00
Andy Hertzfeld 3067cd62f0 don't activate files if the button was held down for too long
don't activate files if the button was held down for too long
2000-01-19 02:55:48 +00:00
John Sullivan a5ee623e60 Fixed crash going into directory and back up. 2000-01-19 01:18:59 +00:00
John Sullivan b7cb31dbcd Change window title when location changes. 2000-01-18 23:21:02 +00:00
John Sullivan 3a5a36ab79 Call selection "items" rather than "files" 2000-01-18 22:50:46 +00:00
John Sullivan 6e7ca6f3a0 Column headers now sort in list view; added Type column. 2000-01-18 22:25:48 +00:00
Miguel de Icaza 17c50ced8d Initialize before using.
2000-01-18  Miguel de Icaza  <miguel@gnu.org>

	* libnautilus/gnome-icon-container.c (handle_icon_button_press):
	Initialize before using.
2000-01-18 21:33:26 +00:00
Andy Hertzfeld b0e9bb2005 made reading metafile from directory where we don't have write permissions
made reading metafile from directory where we don't have write
	permissions work properly by looking in the common place on any error,
	not just if we get ACCESS_DENIED
2000-01-18 21:18:26 +00:00
Andy Hertzfeld df3078be57 *** empty log message *** 2000-01-18 20:44:05 +00:00
Elliot Lee b591e4c50a Since the prototypes for GtkObjectInitFunc and GtkClassInitFunc just have
* libnautilus/nautilus-gtk-macros.h: Since the prototypes for
	GtkObjectInitFunc and GtkClassInitFunc just have a 'gpointer' for the args,
	cast the given values to these function types, so that people can use the actual
	pointer types as arguments without receiving a warning.

	* src/ntl-index-panel.c: Change to match. Also set
	object_klass->destroy & object_klass->finalize to point to our
	implementation. Also remove unused variables
	(nautilus_index_panel_initialize,
	nautilus_index_panel_set_up_label).

	* libnautilus/nautilus-background.c, src/ntl-window-msgs.c,
	src/ntl-window.c, src/file-manager/fm-directory-icons.c: Remove
	unused variables.

	* src/ntl-window.h: Add a variable (unused) for future handling of content view loading.

	* libnautilus/libnautilus.h: Add an interim g_alloca.

	* libnautilus/nautilus-directory.c: Clean up a bit further, by
	removing the need for another if(), and using g_alloca instead of
	g_malloc.
2000-01-18 19:21:16 +00:00
Darin Adler 7e292ac004 Added first cut at code to put metafiles in the user's home directory if
* libnautilus/nautilus-directory.c:
	(nautilus_directory_read_metafile):
	(nautilus_directory_try_to_read_metafile):
	(nautilus_directory_write_metafile):
	(nautilus_directory_try_to_write_metafile):
	(nautilus_directory_switch_to_alternate_metafile_uri):
	(nautilus_directory_escape_slashes):
	(nautilus_make_directory_and_parents): Added first cut at code to
	put metafiles in the user's home directory if the directory is not
	accessible and you can't read and write a metafile in the
	directory itself. We'll have to refine this later to handle cases
	where you end up with two metafiles.

	* libnautilus/Makefile.am: libnautilus/nautilus-debug.h:
	libnautilus/nautilus-debug.c: Took trick for getting into the
	debugger and put it into a public header file so it can be used
	outside of the nautilus executable.

	* src/ntl-main.c: (stop_in_debugger):
	(nautilus_stop_after_default_log_handler): (main): Use the new
	calls from libnautilus to set up the drop into debugger for
	criticals and warnings.

	* src/file-manager/fm-main.c: (main): Minimized includes and used
	the new calls from libnautilus to set up the drop into debugger
	for criticals and warnings.

	* src/ntl-uri-map.c: (nautilus_navinfo_add_mapping):
	src/ntl-window.c: (nautilus_window_constructed):
	src/file-manager/fm-directory-view.c:
	(fm_directory_view_initialize): (fm_directory_view_destroy):
	(notify_location_change_cb): (stop_location_change_cb):
	(fm_directory_view_sort): Removed some messages that aren't so
	useful.

	* libnautilus/ntl-view-frame.h: Minimized includes.
	* libnautilus/ntl-view-frame.c: Include "ntl-view-frame.h" first
	so it tests to see that it has sufficient includes in it.

	* src/ntl-view.c: (nautilus_view_load_client): Changed function so
	that NULL for an iid is allowed and simply results in a failed
	load instead of being illegal.

	* src/ntl-window-msgs.c:
	(nautilus_window_change_location_internal): src/ntl-window.c:
	(nautilus_window_up): Got rid of calls to gnome_vfs_uri_destroy;
	use gnome_vfs_uri_unref instead since it's safer and Federico is
	getting rid of gnome_vfs_uri_destroy.

	* src/file-manager/fm-directory-view-icons.h:
	src/file-manager/fm-directory-view-icons.c:
	(fm_directory_view_icons_new):
	src/file-manager/fm-directory-view-list.h:
	src/file-manager/fm-directory-view-list.c:
	(fm_directory_view_list_new):
	src/file-manager/fm-directory-view.h:
	src/file-manager/fm-directory-view.c: (fm_directory_view_new):
	Minimized includes and got rid of the unused _new functions.

	* libnautilus/nautilus-directory.h: Added a missing 2000 copyright
	date.
2000-01-18 18:55:36 +00:00
John Sullivan 98d22d4f2b Added size & mod date columns to list view. 2000-01-18 01:23:30 +00:00
Andy Hertzfeld e72fb15b13 made dragging work right by rendering a pixbuf to a pixmap and mask to
made dragging work right by rendering a pixbuf to a pixmap and mask
       to pass to the gtk dragging machinery.
2000-01-17 22:36:13 +00:00
Andy Hertzfeld d4ce3fc6d4 made the dragging code set up an image of the canvas item being dragged
made the dragging code set up an image of the canvas item being dragged
       currently disabled because it's not handling the mask yet
2000-01-17 08:43:27 +00:00
Andy Hertzfeld 497e3e7a48 made single-click open work made dragging to desktop work
made single-click open work
	made dragging to desktop work
2000-01-17 05:49:39 +00:00
Andy Hertzfeld 3b781046af made dragging within a window actually move the canvas item correctly, and
made dragging within a window actually move the canvas item correctly,
	and set the stage for copying between directories
2000-01-16 01:23:46 +00:00
John Sullivan 798b52bb8d Fixed deadly typo (g_free that should have been g_list_free) 2000-01-15 00:50:27 +00:00
John Sullivan 89896e51a7 Finished refactoring FMDirectoryView code into two subclasses. 2000-01-15 00:43:48 +00:00
Darin Adler daa6131835 Made it stop in the debugger for a g_warning, but not abort if the
debugger is not running.
2000-01-14 23:55:54 +00:00
Darin Adler b7c1294461 Turned on gradients for backgrounds. 2000-01-14 23:36:00 +00:00
Darin Adler 8190453e91 Changed to use gnome_vfs_uri_extract_short_name. 2000-01-14 20:52:05 +00:00
Darin Adler 4a8e99789c Added code to load and save metadata. 2000-01-14 19:36:38 +00:00
John Sullivan 38e733fe7d Lots more work pushing code from FMDirectoryView into subclasses. Almost
done now!
2000-01-14 02:04:00 +00:00
John Sullivan fa043157af Defined and deployed macros for signals that must be overridden by
subclass; also deployed Darin's other boilerplate-reducing macros
in fm-directory-view-icons.c and fm-directory-view-list.c
2000-01-13 19:49:33 +00:00
John Sullivan 35d40686c3 More work pushing fm_directory_view code into subclasses. 2000-01-13 01:56:47 +00:00