Commit ca6e9f3b authored by Darin Adler's avatar Darin Adler

reviewed by: John Sullivan <sullivan@eazel.com>

	Fixed bug 3245 (When an empty folder is visited, the throbbing
	never stops), bug 2540 (Hook up done_loading signal in
	NautilusMergedDirectory?), and bug 3067 (throbber doesn't start
	again if you do a new "underway" call after load is complete).

	* src/file-manager/fm-directory-view.c: (queue_pending_files):
	Get rid of code that uses nautilus_directory_are_all_files_seen
	to notice we are done loading.
	(done_loading_callback): Use done_loading signal to notice we
	are done loading.
	(finish_loading_uri): Connect to the done_loading signal.
	(disconnect_model_handlers): Disconnect from the done_loading
	signal.

	* libnautilus-extensions/nautilus-merged-directory.c:
	(done_loading_callback),
	(nautilus_merged_directory_add_real_directory),
	(nautilus_merged_directory_remove_real_directory): Add code to
	track all the trash directories and emit done_loading signals
	once all of them are done loading.

	* src/nautilus-window-manage-views.c: (change_state): Turn the
	stop and the throbber back on when a view re-marks itself
	underway.

	* libnautilus-extensions/nautilus-drag.c:
	(nautilus_drag_file_receive_dropped_keyword): Fix storage leak by
	doing a free_deep on the list of keywords.

	* libnautilus-extensions/nautilus-file-operations.h:
	* libnautilus-extensions/nautilus-file-operations.c:
	Get rid of excess includes.

	* libnautilus-extensions/nautilus-icon-dnd.c: Get rid of unused
	ERASE_KEYWORD constant.

	* src/nautilus-window.c: (nautilus_window_constructed): Fix a
	typo in a comment.
parent 43687129
2000-12-07 Darin Adler <darin@eazel.com>
reviewed by: John Sullivan <sullivan@eazel.com>
Fixed bug 3245 (When an empty folder is visited, the throbbing
never stops), bug 2540 (Hook up done_loading signal in
NautilusMergedDirectory?), and bug 3067 (throbber doesn't start
again if you do a new "underway" call after load is complete).
* src/file-manager/fm-directory-view.c: (queue_pending_files):
Get rid of code that uses nautilus_directory_are_all_files_seen
to notice we are done loading.
(done_loading_callback): Use done_loading signal to notice we
are done loading.
(finish_loading_uri): Connect to the done_loading signal.
(disconnect_model_handlers): Disconnect from the done_loading
signal.
* libnautilus-extensions/nautilus-merged-directory.c:
(done_loading_callback),
(nautilus_merged_directory_add_real_directory),
(nautilus_merged_directory_remove_real_directory): Add code to
track all the trash directories and emit done_loading signals
once all of them are done loading.
* src/nautilus-window-manage-views.c: (change_state): Turn the
stop and the throbber back on when a view re-marks itself
underway.
* libnautilus-extensions/nautilus-drag.c:
(nautilus_drag_file_receive_dropped_keyword): Fix storage leak by
doing a free_deep on the list of keywords.
* libnautilus-extensions/nautilus-file-operations.h:
* libnautilus-extensions/nautilus-file-operations.c:
Get rid of excess includes.
* libnautilus-extensions/nautilus-icon-dnd.c: Get rid of unused
ERASE_KEYWORD constant.
* src/nautilus-window.c: (nautilus_window_constructed): Fix a
typo in a comment.
2000-12-07 Gene Z. Ragan <gzr@eazel.com>
Add header files to Makefile.am to make tinderbox happy.
* components/music/Makefile.am:
* components/music/mp3head.h:
Put a header gaurd define in file.
Put a header guard define in file.
2000-12-07 Robey Pointer <robey@eazel.com>
* components/services/trilobite/helper/README:
Update the eazel-helper README to be more current than July. Tell
readers about the softlinks and tell them that eazel-hacking does
this for you now.
......@@ -25,10 +67,11 @@
bugzilla.eazel.com 3940
"DAV: Creating folder in read-only directory does not produce error feedback"
Added an error dialog for the case where gnome-vfs-xfer reports an error
during directory creation. This case is only commonly encountered in
remote filesystems where Nautilus can't check permissions before operations.
(Similar behaviour to 3940 applied to FTP as well).
Added an error dialog for the case where gnome-vfs-xfer reports an
error during directory creation. This case is only commonly
encountered in remote filesystems where Nautilus can't check
permissions before operations. (Similar behaviour to 3940 applied
to FTP as well).
2000-12-06 Gene Z. Ragan <gzr@eazel.com>
......
......@@ -581,7 +581,7 @@ nautilus_drag_autoscroll_start (NautilusDragInfo *drag_info,
void
nautilus_drag_autoscroll_stop (NautilusDragInfo *drag_info)
{
if (drag_info->auto_scroll_timeout_id) {
if (drag_info->auto_scroll_timeout_id != 0) {
gtk_timeout_remove (drag_info->auto_scroll_timeout_id);
drag_info->auto_scroll_timeout_id = 0;
}
......@@ -593,10 +593,11 @@ nautilus_drag_file_receive_dropped_keyword (NautilusFile *file, char *keyword)
{
GList *keywords, *word;
g_assert (keyword != NULL);
g_return_if_fail (NAUTILUS_IS_FILE (file));
g_return_if_fail (keyword != NULL);
/* special case the erase emblem */
if (!nautilus_strcmp (keyword, ERASE_KEYWORD)) {
if (strcmp (keyword, ERASE_KEYWORD) == 0) {
keywords = NULL;
} else {
keywords = nautilus_file_get_keywords (file);
......@@ -611,4 +612,5 @@ nautilus_drag_file_receive_dropped_keyword (NautilusFile *file, char *keyword)
}
nautilus_file_set_keywords (file, keywords);
nautilus_g_list_free_deep (keywords);
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* xfer.c - Bonobo::Desktop::FileOperationService transfer service.
Copyright (C) 1999, 2000 Free Software Foundation
......@@ -21,25 +22,28 @@
Authors:
Ettore Perazzoli <ettore@gnu.org>
Pavel Cisler <pavel@eazel.com>
*/
*/
#include <config.h>
#include "nautilus-file-operations.h"
#include "nautilus-file-operations-progress.h"
#include "nautilus-lib-self-check-functions.h"
#include <gnome.h>
#include <gtk/gtklabel.h>
#include <libgnomevfs/gnome-vfs-async-ops.h>
#include <libgnomevfs/gnome-vfs-find-directory.h>
#include <libgnomevfs/gnome-vfs-ops.h>
#include <libgnomevfs/gnome-vfs-result.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include "nautilus-file-operations.h"
#include "nautilus-file-operations-progress.h"
#include "nautilus-lib-self-check-functions.h"
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libnautilus-extensions/nautilus-file-changes-queue.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-glib-extensions.h>
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
#include <libnautilus-extensions/nautilus-glib-extensions.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
#include <libnautilus-extensions/nautilus-link.h>
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
typedef enum {
XFER_MOVE,
......@@ -2060,7 +2064,6 @@ test_next_duplicate_name (const char *name, const char *expected_next_name)
void
nautilus_self_check_file_operations (void)
{
/* test the next duplicate name generator */
NAUTILUS_CHECK_BOOLEAN_RESULT (test_next_duplicate_name (_(" (copy)"), _(" (another copy)")), TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT (test_next_duplicate_name (_("foo"), _("foo (copy)")), TRUE);
......
......@@ -25,7 +25,7 @@
#ifndef NAUTILUS_FILE_OPERATIONS_H
#define NAUTILUS_FILE_OPERATIONS_H
#include <libgnomevfs/gnome-vfs.h>
#include <gtk/gtkwidget.h>
typedef void (* NautilusCopyCallback) (GHashTable *debuting_uris,
gpointer callback_data);
......@@ -49,5 +49,4 @@ void nautilus_file_operations_new_folder (GtkWidget
void nautilus_file_operations_delete (const GList *item_uris,
GtkWidget *parent_view);
#endif /* NAUTILUS_FILE_OPERATIONS_H */
......@@ -107,9 +107,6 @@ static GtkTargetEntry drop_types [] = {
};
/* special reserved name for the erase emblem */
#define ERASE_KEYWORD "erase"
static GnomeCanvasItem *
create_selection_shadow (NautilusIconContainer *container,
GList *list)
......
......@@ -34,6 +34,7 @@
struct NautilusMergedDirectoryDetails {
GList *directories;
GList *directories_not_done_loading;
GHashTable *callbacks;
GHashTable *monitors;
};
......@@ -436,6 +437,17 @@ forward_files_changed_cover (NautilusDirectory *real_directory,
nautilus_directory_emit_files_changed (NAUTILUS_DIRECTORY (merged), files);
}
static void
done_loading_callback (NautilusDirectory *real_directory,
NautilusMergedDirectory *merged)
{
merged->details->directories_not_done_loading = g_list_remove
(merged->details->directories_not_done_loading, real_directory);
if (merged->details->directories_not_done_loading == NULL) {
nautilus_directory_emit_done_loading (NAUTILUS_DIRECTORY (merged));
}
}
static void
monitor_add_directory (gpointer key,
gpointer value,
......@@ -467,6 +479,8 @@ nautilus_merged_directory_add_real_directory (NautilusMergedDirectory *merged,
nautilus_directory_ref (real_directory);
merged->details->directories = g_list_prepend
(merged->details->directories, real_directory);
merged->details->directories_not_done_loading = g_list_prepend
(merged->details->directories_not_done_loading, real_directory);
/* Connect signals. */
gtk_signal_connect (GTK_OBJECT (real_directory),
......@@ -477,7 +491,14 @@ nautilus_merged_directory_add_real_directory (NautilusMergedDirectory *merged,
"files_changed",
forward_files_changed_cover,
merged);
/* FIXME bugzilla.eazel.com 2540: Hook up the done_loading signal too? */
gtk_signal_connect (GTK_OBJECT (real_directory),
"done_loading",
done_loading_callback,
merged);
/* FIXME: The done_loading part won't work for the case where
* we have no directories in our list.
*/
/* Add the directory to any extant monitors. */
g_hash_table_foreach (merged->details->monitors,
......@@ -532,6 +553,8 @@ nautilus_merged_directory_remove_real_directory (NautilusMergedDirectory *merged
/* Remove from our list of directories. */
merged->details->directories = g_list_remove
(merged->details->directories, real_directory);
merged->details->directories_not_done_loading = g_list_remove
(merged->details->directories_not_done_loading, real_directory);
nautilus_directory_unref (real_directory);
}
......
......@@ -581,7 +581,7 @@ nautilus_drag_autoscroll_start (NautilusDragInfo *drag_info,
void
nautilus_drag_autoscroll_stop (NautilusDragInfo *drag_info)
{
if (drag_info->auto_scroll_timeout_id) {
if (drag_info->auto_scroll_timeout_id != 0) {
gtk_timeout_remove (drag_info->auto_scroll_timeout_id);
drag_info->auto_scroll_timeout_id = 0;
}
......@@ -593,10 +593,11 @@ nautilus_drag_file_receive_dropped_keyword (NautilusFile *file, char *keyword)
{
GList *keywords, *word;
g_assert (keyword != NULL);
g_return_if_fail (NAUTILUS_IS_FILE (file));
g_return_if_fail (keyword != NULL);
/* special case the erase emblem */
if (!nautilus_strcmp (keyword, ERASE_KEYWORD)) {
if (strcmp (keyword, ERASE_KEYWORD) == 0) {
keywords = NULL;
} else {
keywords = nautilus_file_get_keywords (file);
......@@ -611,4 +612,5 @@ nautilus_drag_file_receive_dropped_keyword (NautilusFile *file, char *keyword)
}
nautilus_file_set_keywords (file, keywords);
nautilus_g_list_free_deep (keywords);
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* xfer.c - Bonobo::Desktop::FileOperationService transfer service.
Copyright (C) 1999, 2000 Free Software Foundation
......@@ -21,25 +22,28 @@
Authors:
Ettore Perazzoli <ettore@gnu.org>
Pavel Cisler <pavel@eazel.com>
*/
*/
#include <config.h>
#include "nautilus-file-operations.h"
#include "nautilus-file-operations-progress.h"
#include "nautilus-lib-self-check-functions.h"
#include <gnome.h>
#include <gtk/gtklabel.h>
#include <libgnomevfs/gnome-vfs-async-ops.h>
#include <libgnomevfs/gnome-vfs-find-directory.h>
#include <libgnomevfs/gnome-vfs-ops.h>
#include <libgnomevfs/gnome-vfs-result.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include "nautilus-file-operations.h"
#include "nautilus-file-operations-progress.h"
#include "nautilus-lib-self-check-functions.h"
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libnautilus-extensions/nautilus-file-changes-queue.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-glib-extensions.h>
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
#include <libnautilus-extensions/nautilus-glib-extensions.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
#include <libnautilus-extensions/nautilus-link.h>
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
typedef enum {
XFER_MOVE,
......@@ -2060,7 +2064,6 @@ test_next_duplicate_name (const char *name, const char *expected_next_name)
void
nautilus_self_check_file_operations (void)
{
/* test the next duplicate name generator */
NAUTILUS_CHECK_BOOLEAN_RESULT (test_next_duplicate_name (_(" (copy)"), _(" (another copy)")), TRUE);
NAUTILUS_CHECK_BOOLEAN_RESULT (test_next_duplicate_name (_("foo"), _("foo (copy)")), TRUE);
......
......@@ -25,7 +25,7 @@
#ifndef NAUTILUS_FILE_OPERATIONS_H
#define NAUTILUS_FILE_OPERATIONS_H
#include <libgnomevfs/gnome-vfs.h>
#include <gtk/gtkwidget.h>
typedef void (* NautilusCopyCallback) (GHashTable *debuting_uris,
gpointer callback_data);
......@@ -49,5 +49,4 @@ void nautilus_file_operations_new_folder (GtkWidget
void nautilus_file_operations_delete (const GList *item_uris,
GtkWidget *parent_view);
#endif /* NAUTILUS_FILE_OPERATIONS_H */
......@@ -107,9 +107,6 @@ static GtkTargetEntry drop_types [] = {
};
/* special reserved name for the erase emblem */
#define ERASE_KEYWORD "erase"
static GnomeCanvasItem *
create_selection_shadow (NautilusIconContainer *container,
GList *list)
......
......@@ -34,6 +34,7 @@
struct NautilusMergedDirectoryDetails {
GList *directories;
GList *directories_not_done_loading;
GHashTable *callbacks;
GHashTable *monitors;
};
......@@ -436,6 +437,17 @@ forward_files_changed_cover (NautilusDirectory *real_directory,
nautilus_directory_emit_files_changed (NAUTILUS_DIRECTORY (merged), files);
}
static void
done_loading_callback (NautilusDirectory *real_directory,
NautilusMergedDirectory *merged)
{
merged->details->directories_not_done_loading = g_list_remove
(merged->details->directories_not_done_loading, real_directory);
if (merged->details->directories_not_done_loading == NULL) {
nautilus_directory_emit_done_loading (NAUTILUS_DIRECTORY (merged));
}
}
static void
monitor_add_directory (gpointer key,
gpointer value,
......@@ -467,6 +479,8 @@ nautilus_merged_directory_add_real_directory (NautilusMergedDirectory *merged,
nautilus_directory_ref (real_directory);
merged->details->directories = g_list_prepend
(merged->details->directories, real_directory);
merged->details->directories_not_done_loading = g_list_prepend
(merged->details->directories_not_done_loading, real_directory);
/* Connect signals. */
gtk_signal_connect (GTK_OBJECT (real_directory),
......@@ -477,7 +491,14 @@ nautilus_merged_directory_add_real_directory (NautilusMergedDirectory *merged,
"files_changed",
forward_files_changed_cover,
merged);
/* FIXME bugzilla.eazel.com 2540: Hook up the done_loading signal too? */
gtk_signal_connect (GTK_OBJECT (real_directory),
"done_loading",
done_loading_callback,
merged);
/* FIXME: The done_loading part won't work for the case where
* we have no directories in our list.
*/
/* Add the directory to any extant monitors. */
g_hash_table_foreach (merged->details->monitors,
......@@ -532,6 +553,8 @@ nautilus_merged_directory_remove_real_directory (NautilusMergedDirectory *merged
/* Remove from our list of directories. */
merged->details->directories = g_list_remove
(merged->details->directories, real_directory);
merged->details->directories_not_done_loading = g_list_remove
(merged->details->directories_not_done_loading, real_directory);
nautilus_directory_unref (real_directory);
}
......
......@@ -136,6 +136,7 @@ struct FMDirectoryViewDetails
guint files_added_handler_id;
guint files_changed_handler_id;
guint load_error_handler_id;
guint done_loading_handler_id;
guint file_changed_handler_id;
GList *pending_files_added;
......@@ -1845,16 +1846,7 @@ queue_pending_files (FMDirectoryView *view,
if (files != NULL) {
nautilus_file_list_ref (files);
*pending_list = g_list_concat (*pending_list, filtered_files);
/* If we haven't see all the files yet, then we'll wait for the
* timeout to fire. If we have seen all the files, then we'll use
* an idle instead.
*/
if (nautilus_directory_are_all_files_seen (view->details->model)) {
schedule_idle_display_of_pending_files (view);
} else {
schedule_timeout_display_of_pending_files (view);
}
schedule_timeout_display_of_pending_files (view);
}
}
......@@ -1885,6 +1877,17 @@ files_changed_callback (NautilusDirectory *directory,
schedule_update_menus (view);
}
static void
done_loading_callback (NautilusDirectory *directory,
gpointer callback_data)
{
FMDirectoryView *view;
view = FM_DIRECTORY_VIEW (callback_data);
schedule_idle_display_of_pending_files (view);
}
static void
load_error_callback (NautilusDirectory *directory,
GnomeVFSResult load_error_code,
......@@ -3574,6 +3577,11 @@ finish_loading_uri (FMDirectoryView *view)
"files_changed",
files_changed_callback,
view);
view->details->done_loading_handler_id = gtk_signal_connect
(GTK_OBJECT (view->details->model),
"done_loading",
done_loading_callback,
view);
view->details->load_error_handler_id = gtk_signal_connect
(GTK_OBJECT (view->details->model),
"load_error",
......@@ -3683,6 +3691,7 @@ disconnect_model_handlers (FMDirectoryView *view)
}
disconnect_directory_handler (view, &view->details->files_added_handler_id);
disconnect_directory_handler (view, &view->details->files_changed_handler_id);
disconnect_directory_handler (view, &view->details->done_loading_handler_id);
disconnect_directory_handler (view, &view->details->load_error_handler_id);
disconnect_directory_as_file_handler (view, &view->details->file_changed_handler_id);
nautilus_directory_file_monitor_remove (view->details->model, view);
......
......@@ -535,7 +535,7 @@ nautilus_window_constructed (NautilusWindow *window)
nautilus_window_initialize_menus (window);
nautilus_window_initialize_toolbars (window);
/* watch for throbber locatoin changes, too */
/* watch for throbber location changes, too */
gtk_signal_connect (GTK_OBJECT (window->throbber), "location_changed",
goto_uri_callback, window);
......
......@@ -535,7 +535,7 @@ nautilus_window_constructed (NautilusWindow *window)
nautilus_window_initialize_menus (window);
nautilus_window_initialize_toolbars (window);
/* watch for throbber locatoin changes, too */
/* watch for throbber location changes, too */
gtk_signal_connect (GTK_OBJECT (window->throbber), "location_changed",
goto_uri_callback, window);
......
......@@ -535,7 +535,7 @@ nautilus_window_constructed (NautilusWindow *window)
nautilus_window_initialize_menus (window);
nautilus_window_initialize_toolbars (window);
/* watch for throbber locatoin changes, too */
/* watch for throbber location changes, too */
gtk_signal_connect (GTK_OBJECT (window->throbber), "location_changed",
goto_uri_callback, window);
......
......@@ -1052,7 +1052,9 @@ change_state (NautilusWindow *window,
break;
case LOAD_UNDERWAY: /* We have received an "I am loading" indication from the content view */
nautilus_window_allow_stop (window, TRUE); /* for the case where we are "re-underway" */
window->cv_progress_initial = TRUE;
window->cv_progress_done = FALSE;
break;
case LOAD_DONE: /* The content view is done loading */
......
......@@ -535,7 +535,7 @@ nautilus_window_constructed (NautilusWindow *window)
nautilus_window_initialize_menus (window);
nautilus_window_initialize_toolbars (window);
/* watch for throbber locatoin changes, too */
/* watch for throbber location changes, too */
gtk_signal_connect (GTK_OBJECT (window->throbber), "location_changed",
goto_uri_callback, window);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment