Commit 78860f9f authored by Maciej Stachowiak's avatar Maciej Stachowiak
Browse files

Added stop_location_change method to NautilusView interface. New signal,

	* idl/nautilus.idl: Added stop_location_change method to NautilusView interface.
	* ntl-view-client.c, ntl-view-client.h (stop_location_change): New
	signal, triggered on receipt of stop_location_change request via
	CORBA.

	* ntl-view.c, ntl-view.h, ntl-view-private.h, ntl-view-nautilus.c,
	ntl-view-bonobo-control.c, ntl-view-bonobo-subdoc.c
	(nautilus_view_stop_location_change): Added this function; also
	added implementation to nautilus view type function table and
	NULL'd out for now for Bonobo control and subdoc view types (need
	to find out if loading is synchronous or asynchronous for those,
	and if there is a way to abort).

	* ntl-window.c: Stop loading for all views when Stop button is
	pressed.

	* ntl-window-msgs.c: Enable stop button when we start loading;
	enable Stop button when

	* src/file-manager/fm-directory-view.c: Call
	request_progress_change() when loading is done or an error is
	reached; implement handler for stop_location_change signal.
parent e992a1c7
2000-01-03 Maciej Stachowiak <mjs@eazel.com>
* idl/nautilus.idl: Added stop_location_change method to NautilusView interface.
* ntl-view-client.c, ntl-view-client.h (stop_location_change): New
signal, triggered on receipt of stop_location_change request via
CORBA.
* ntl-view.c, ntl-view.h, ntl-view-private.h, ntl-view-nautilus.c,
ntl-view-bonobo-control.c, ntl-view-bonobo-subdoc.c
(nautilus_view_stop_location_change): Added this function; also
added implementation to nautilus view type function table and
NULL'd out for now for Bonobo control and subdoc view types (need
to find out if loading is synchronous or asynchronous for those,
and if there is a way to abort).
* ntl-window.c: Stop loading for all views when Stop button is
pressed.
* ntl-window-msgs.c: Enable stop button when we start loading;
enable Stop button when
* src/file-manager/fm-directory-view.c: Call
request_progress_change() when loading is done or an error is
reached; implement handler for stop_location_change signal.
2000-01-03 Maciej Stachowiak <mjs@eazel.com>
* src/ntl-prefs.c: Fix warnings.
......
......@@ -44,6 +44,8 @@ module Nautilus {
oneway void show_properties(); // Requests that the client show its properties
oneway void notify_selection_change(in SelectionInfo selinfo);
oneway void stop_location_change();
};
interface MetaView : View {
......
......@@ -58,6 +58,10 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
Nautilus_SelectionInfo * selinfo,
CORBA_Environment * ev);
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev);
POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
{
NULL, /* _private */
......@@ -65,7 +69,8 @@ POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
(gpointer) & impl_Nautilus_View_load_state,
(gpointer) & impl_Nautilus_View_notify_location_change,
(gpointer) & impl_Nautilus_View_show_properties,
(gpointer) & impl_Nautilus_View_notify_selection_change
(gpointer) & impl_Nautilus_View_notify_selection_change,
(gpointer) & impl_Nautilus_View_stop_location_change
};
static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
......@@ -116,6 +121,13 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "notify_selection_change", selinfo);
}
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev)
{
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "stop_location_change");
}
static void
impl_Nautilus_View__destroy(GnomeObject *obj, impl_POA_Nautilus_View *servant)
......@@ -276,6 +288,12 @@ nautilus_view_client_class_init (NautilusViewClientClass *klass)
GTK_SIGNAL_OFFSET (NautilusViewClientClass, notify_selection_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 1, GTK_TYPE_BOXED);
klass->view_client_signals[i++] = gtk_signal_new("stop_location_change",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusViewClientClass, stop_location_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, klass->view_client_signals, i);
}
......
......@@ -53,6 +53,7 @@ struct _NautilusViewClientClass
void (*load_state) (NautilusViewClient *view, const char *config_path);
void (*save_state) (NautilusViewClient *view, const char *config_path);
void (*show_properties) (NautilusViewClient *view);
void (*stop_location_change) (NautilusViewClient *view);
GtkBinClass *parent_class;
......
......@@ -58,6 +58,10 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
Nautilus_SelectionInfo * selinfo,
CORBA_Environment * ev);
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev);
POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
{
NULL, /* _private */
......@@ -65,7 +69,8 @@ POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
(gpointer) & impl_Nautilus_View_load_state,
(gpointer) & impl_Nautilus_View_notify_location_change,
(gpointer) & impl_Nautilus_View_show_properties,
(gpointer) & impl_Nautilus_View_notify_selection_change
(gpointer) & impl_Nautilus_View_notify_selection_change,
(gpointer) & impl_Nautilus_View_stop_location_change
};
static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
......@@ -116,6 +121,13 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "notify_selection_change", selinfo);
}
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev)
{
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "stop_location_change");
}
static void
impl_Nautilus_View__destroy(GnomeObject *obj, impl_POA_Nautilus_View *servant)
......@@ -276,6 +288,12 @@ nautilus_view_client_class_init (NautilusViewClientClass *klass)
GTK_SIGNAL_OFFSET (NautilusViewClientClass, notify_selection_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 1, GTK_TYPE_BOXED);
klass->view_client_signals[i++] = gtk_signal_new("stop_location_change",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusViewClientClass, stop_location_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, klass->view_client_signals, i);
}
......
......@@ -53,6 +53,7 @@ struct _NautilusViewClientClass
void (*load_state) (NautilusViewClient *view, const char *config_path);
void (*save_state) (NautilusViewClient *view, const char *config_path);
void (*show_properties) (NautilusViewClient *view);
void (*stop_location_change) (NautilusViewClient *view);
GtkBinClass *parent_class;
......
......@@ -58,6 +58,10 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
Nautilus_SelectionInfo * selinfo,
CORBA_Environment * ev);
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev);
POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
{
NULL, /* _private */
......@@ -65,7 +69,8 @@ POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
(gpointer) & impl_Nautilus_View_load_state,
(gpointer) & impl_Nautilus_View_notify_location_change,
(gpointer) & impl_Nautilus_View_show_properties,
(gpointer) & impl_Nautilus_View_notify_selection_change
(gpointer) & impl_Nautilus_View_notify_selection_change,
(gpointer) & impl_Nautilus_View_stop_location_change
};
static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
......@@ -116,6 +121,13 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "notify_selection_change", selinfo);
}
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev)
{
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "stop_location_change");
}
static void
impl_Nautilus_View__destroy(GnomeObject *obj, impl_POA_Nautilus_View *servant)
......@@ -276,6 +288,12 @@ nautilus_view_client_class_init (NautilusViewClientClass *klass)
GTK_SIGNAL_OFFSET (NautilusViewClientClass, notify_selection_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 1, GTK_TYPE_BOXED);
klass->view_client_signals[i++] = gtk_signal_new("stop_location_change",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusViewClientClass, stop_location_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, klass->view_client_signals, i);
}
......
......@@ -53,6 +53,7 @@ struct _NautilusViewClientClass
void (*load_state) (NautilusViewClient *view, const char *config_path);
void (*save_state) (NautilusViewClient *view, const char *config_path);
void (*show_properties) (NautilusViewClient *view);
void (*stop_location_change) (NautilusViewClient *view);
GtkBinClass *parent_class;
......
......@@ -58,6 +58,10 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
Nautilus_SelectionInfo * selinfo,
CORBA_Environment * ev);
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev);
POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
{
NULL, /* _private */
......@@ -65,7 +69,8 @@ POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
(gpointer) & impl_Nautilus_View_load_state,
(gpointer) & impl_Nautilus_View_notify_location_change,
(gpointer) & impl_Nautilus_View_show_properties,
(gpointer) & impl_Nautilus_View_notify_selection_change
(gpointer) & impl_Nautilus_View_notify_selection_change,
(gpointer) & impl_Nautilus_View_stop_location_change
};
static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
......@@ -116,6 +121,13 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "notify_selection_change", selinfo);
}
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev)
{
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "stop_location_change");
}
static void
impl_Nautilus_View__destroy(GnomeObject *obj, impl_POA_Nautilus_View *servant)
......@@ -276,6 +288,12 @@ nautilus_view_client_class_init (NautilusViewClientClass *klass)
GTK_SIGNAL_OFFSET (NautilusViewClientClass, notify_selection_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 1, GTK_TYPE_BOXED);
klass->view_client_signals[i++] = gtk_signal_new("stop_location_change",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusViewClientClass, stop_location_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, klass->view_client_signals, i);
}
......
......@@ -53,6 +53,7 @@ struct _NautilusViewClientClass
void (*load_state) (NautilusViewClient *view, const char *config_path);
void (*save_state) (NautilusViewClient *view, const char *config_path);
void (*show_properties) (NautilusViewClient *view);
void (*stop_location_change) (NautilusViewClient *view);
GtkBinClass *parent_class;
......
......@@ -58,6 +58,10 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
Nautilus_SelectionInfo * selinfo,
CORBA_Environment * ev);
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev);
POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
{
NULL, /* _private */
......@@ -65,7 +69,8 @@ POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
(gpointer) & impl_Nautilus_View_load_state,
(gpointer) & impl_Nautilus_View_notify_location_change,
(gpointer) & impl_Nautilus_View_show_properties,
(gpointer) & impl_Nautilus_View_notify_selection_change
(gpointer) & impl_Nautilus_View_notify_selection_change,
(gpointer) & impl_Nautilus_View_stop_location_change
};
static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
......@@ -116,6 +121,13 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "notify_selection_change", selinfo);
}
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev)
{
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "stop_location_change");
}
static void
impl_Nautilus_View__destroy(GnomeObject *obj, impl_POA_Nautilus_View *servant)
......@@ -276,6 +288,12 @@ nautilus_view_client_class_init (NautilusViewClientClass *klass)
GTK_SIGNAL_OFFSET (NautilusViewClientClass, notify_selection_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 1, GTK_TYPE_BOXED);
klass->view_client_signals[i++] = gtk_signal_new("stop_location_change",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusViewClientClass, stop_location_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, klass->view_client_signals, i);
}
......
......@@ -53,6 +53,7 @@ struct _NautilusViewClientClass
void (*load_state) (NautilusViewClient *view, const char *config_path);
void (*save_state) (NautilusViewClient *view, const char *config_path);
void (*show_properties) (NautilusViewClient *view);
void (*stop_location_change) (NautilusViewClient *view);
GtkBinClass *parent_class;
......
......@@ -58,6 +58,10 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
Nautilus_SelectionInfo * selinfo,
CORBA_Environment * ev);
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev);
POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
{
NULL, /* _private */
......@@ -65,7 +69,8 @@ POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
(gpointer) & impl_Nautilus_View_load_state,
(gpointer) & impl_Nautilus_View_notify_location_change,
(gpointer) & impl_Nautilus_View_show_properties,
(gpointer) & impl_Nautilus_View_notify_selection_change
(gpointer) & impl_Nautilus_View_notify_selection_change,
(gpointer) & impl_Nautilus_View_stop_location_change
};
static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
......@@ -116,6 +121,13 @@ impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant,
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "notify_selection_change", selinfo);
}
static void
impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant,
CORBA_Environment * ev)
{
gtk_signal_emit_by_name(GTK_OBJECT(servant->view), "stop_location_change");
}
static void
impl_Nautilus_View__destroy(GnomeObject *obj, impl_POA_Nautilus_View *servant)
......@@ -276,6 +288,12 @@ nautilus_view_client_class_init (NautilusViewClientClass *klass)
GTK_SIGNAL_OFFSET (NautilusViewClientClass, notify_selection_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 1, GTK_TYPE_BOXED);
klass->view_client_signals[i++] = gtk_signal_new("stop_location_change",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusViewClientClass, stop_location_change),
gtk_marshal_NONE__BOXED,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, klass->view_client_signals, i);
}
......
......@@ -53,6 +53,7 @@ struct _NautilusViewClientClass
void (*load_state) (NautilusViewClient *view, const char *config_path);
void (*save_state) (NautilusViewClient *view, const char *config_path);
void (*show_properties) (NautilusViewClient *view);
void (*stop_location_change) (NautilusViewClient *view);
GtkBinClass *parent_class;
......
......@@ -504,6 +504,13 @@ real_location_change(NautilusViewClient *directory_view, Nautilus_NavigationInfo
fm_directory_view_load_uri(FM_DIRECTORY_VIEW(directory_view), nav_context->requested_uri);
}
static void
real_stop_location_change(NautilusViewClient *directory_view)
{
g_message("Directory view is stopping");
fm_directory_view_stop(FM_DIRECTORY_VIEW(directory_view));
}
/* GtkObject methods. */
static void
......@@ -550,6 +557,7 @@ class_init (FMDirectoryViewClass *class)
object_class->destroy = destroy;
vc->notify_location_change = real_location_change;
vc->stop_location_change = real_stop_location_change;
}
static void
......@@ -594,8 +602,10 @@ init (FMDirectoryView *directory_view)
/* Utility functions. */
static void
stop_load (FMDirectoryView *view)
stop_load (FMDirectoryView *view, gboolean error)
{
Nautilus_ProgressRequestInfo pri;
if (view->vfs_async_handle != NULL) {
gnome_vfs_async_cancel (view->vfs_async_handle);
view->vfs_async_handle = NULL;
......@@ -609,6 +619,12 @@ stop_load (FMDirectoryView *view)
view->current_position = GNOME_VFS_DIRECTORY_LIST_POSITION_NONE;
view->entries_to_display = 0;
view->directory_list = NULL;
pri.amount = 100.0;
pri.type = error ? Nautilus_PROGRESS_DONE_ERROR : Nautilus_PROGRESS_DONE_OK;
nautilus_view_client_request_progress_change(NAUTILUS_VIEW_CLIENT(view),
&pri);
}
......@@ -704,7 +720,7 @@ static gboolean
display_timeout_cb (gpointer data)
{
FMDirectoryView *view;
FM_DEBUG (("Entering function"));
view = FM_DIRECTORY_VIEW (data);
......@@ -783,10 +799,10 @@ directory_load_cb (GnomeVFSAsyncHandle *handle,
if (result == GNOME_VFS_ERROR_EOF) {
display_pending_entries (view);
display_icons_not_in_layout (view);
stop_load (view);
stop_load (view, FALSE);
/* gtk_signal_emit (GTK_OBJECT (view), signals[LOAD_DONE]); */
} else if (result != GNOME_VFS_OK) {
stop_load (view);
stop_load (view, TRUE);
/* gtk_signal_emit (GTK_OBJECT (view), signals[LOAD_FAILED],
result); */
return;
......@@ -937,7 +953,9 @@ fm_directory_view_stop (FMDirectoryView *view)
if (view->vfs_async_handle == NULL)
return;
stop_load (view);
display_pending_entries (view);
display_icons_not_in_layout (view);
stop_load (view, FALSE);
}
......
......@@ -882,9 +882,20 @@ nautilus_window_home (GtkWidget *btn, NautilusWindow *window)
nautilus_window_set_initial_state(window, NULL);
}
static void
nv_stop_location_change_adapter(NautilusView *view, gpointer dummy)
{
nautilus_view_stop_location_change (view);
}
static void
nautilus_window_stop (GtkWidget *btn, NautilusWindow *window)
{
if (window->content_view != NULL) {
nautilus_view_stop_location_change (window->content_view);
}
g_slist_foreach(window->meta_views, (GFunc) nv_stop_location_change_adapter, NULL);
}
......
......@@ -882,9 +882,20 @@ nautilus_window_home (GtkWidget *btn, NautilusWindow *window)
nautilus_window_set_initial_state(window, NULL);
}
static void
nv_stop_location_change_adapter(NautilusView *view, gpointer dummy)
{
nautilus_view_stop_location_change (view);
}
static void
nautilus_window_stop (GtkWidget *btn, NautilusWindow *window)
{
if (window->content_view != NULL) {
nautilus_view_stop_location_change (window->content_view);
}
g_slist_foreach(window->meta_views, (GFunc) nv_stop_location_change_adapter, NULL);
}
......
......@@ -882,9 +882,20 @@ nautilus_window_home (GtkWidget *btn, NautilusWindow *window)
nautilus_window_set_initial_state(window, NULL);
}
static void
nv_stop_location_change_adapter(NautilusView *view, gpointer dummy)
{
nautilus_view_stop_location_change (view);
}
static void
nautilus_window_stop (GtkWidget *btn, NautilusWindow *window)
{
if (window->content_view != NULL) {
nautilus_view_stop_location_change (window->content_view);
}
g_slist_foreach(window->meta_views, (GFunc) nv_stop_location_change_adapter, NULL);
}
......
......@@ -62,5 +62,6 @@ NautilusViewComponentType bonobo_control_component_type = {
NULL, /* load_state */
NULL, /* notify_location_change */
NULL, /* notify_selection_change */
NULL, /* stop_location_change */
&bonobo_control_get_label /* get_label */
};
......@@ -75,7 +75,8 @@ NautilusViewComponentType bonobo_subdoc_component_type = {
NULL, /* show_properties */
NULL, /* save_state */
NULL, /* load_state */
bonobo_subdoc_notify_location_change, /* notify_location_change */
&bonobo_subdoc_notify_location_change, /* notify_location_change */
NULL, /* notify_selection_change */
NULL, /* stop_location_change */
NULL, /* get_label */
};
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