Updated based on running check-THANKS.pl Fixed some typos in people's

* THANKS: Updated based on running check-THANKS.pl
	* AUTHORS, ChangeLog-200001018: Fixed some typos in
	people's email addresses.


	Fix bugs 3641 (text preview gets garbled when switching files in
	the middle of a load) and 3479 (Nautilus crashes if
	nautilus-adapter* missing).

	* components/adapter/nautilus-adapter-progressive-load-strategy.c
	(call_when_stopped, load_and_free_uri, declare_done_loading,
	stop_loading,
	nautilus_adapter_progressive_load_strategy_load_location): Make
	sure previous load is completely stopped before ever starting a
	new load.

	* components/adapter/nautilus-adapter.c:
	(nautilus_adapter_destroy, nautilus_adapter_new): Avoid reporting
	signals to the view frame while in the middle of destroying the
	adapter.
	* src/nautilus-component-adapter-factory.c
	(nautilus_component_adapter_factory_get): Return NULL when loading
	the adapter factory component fails.
	(nautilus_component_adapter_factory_initialize,
	component_adapter_factory_at_exit_destructor): Changes required by
	the above.
	* src/nautilus-view-frame.c
	(nautilus_view_frame_set_to_component): report failure if we can't
	load the adapter factory.
	* src/nautilus-window-manage-views.c
	(report_content_view_failure_to_user, load_content_view,
	handle_view_failure, nautilus_window_set_sidebar_panels): Do a
	somewhat better job of reporting view load failures.
This commit is contained in:
Maciej Stachowiak 2000-11-13 16:22:19 +00:00
parent 5777ef2437
commit fe3a8f5e6f
9 changed files with 234 additions and 67 deletions

View file

@ -3,7 +3,7 @@ Andy Hertzfeld <andy@eazel.com>
Arlo Rose <arlo@eazel.com>
Bud Tribble <bud@eazel.com>
Darin Adler <darin@eazel.com>
Eli Goldberg <eli@eazel.com
Eli Goldberg <eli@eazel.com>
Elliot Lee <sopwith@redhat.com>
Eskil Heyn Olsen <eskil@eazel.com>
Ettore Perazzoli <ettore@helixcode.com>

View file

@ -1,3 +1,40 @@
2000-11-13 Maciej Stachowiak <mjs@eazel.com>
* THANKS: Updated based on running check-THANKS.pl
* AUTHORS, ChangeLog-200001018: Fixed some typos in
people's email addresses.
2000-11-13 Maciej Stachowiak <mjs@eazel.com>
Fix bugs 3641 (text preview gets garbled when switching files in
the middle of a load) and 3479 (Nautilus crashes if
nautilus-adapter* missing).
* components/adapter/nautilus-adapter-progressive-load-strategy.c
(call_when_stopped, load_and_free_uri, declare_done_loading,
stop_loading,
nautilus_adapter_progressive_load_strategy_load_location): Make
sure previous load is completely stopped before ever starting a
new load.
* components/adapter/nautilus-adapter.c:
(nautilus_adapter_destroy, nautilus_adapter_new): Avoid reporting
signals to the view frame while in the middle of destroying the
adapter.
* src/nautilus-component-adapter-factory.c
(nautilus_component_adapter_factory_get): Return NULL when loading
the adapter factory component fails.
(nautilus_component_adapter_factory_initialize,
component_adapter_factory_at_exit_destructor): Changes required by
the above.
* src/nautilus-view-frame.c
(nautilus_view_frame_set_to_component): report failure if we can't
load the adapter factory.
* src/nautilus-window-manage-views.c
(report_content_view_failure_to_user, load_content_view,
handle_view_failure, nautilus_window_set_sidebar_panels): Do a
somewhat better job of reporting view load failures.
2000-11-13 Maciej Stachowiak <mjs@eazel.com>
* components/tree/nautilus-tree-view.c

View file

@ -1462,7 +1462,7 @@
file conflict errors by attempting to download upgraded versions
of what we'd break.
2000-10-12 Andy Hertzfeld <andy@eazel>
2000-10-12 Andy Hertzfeld <andy@eazel.com>
* src/nautilus-shell-ui.xml:
set the "pack-end" property on the throbber. This, combined

16
THANKS
View file

@ -2,6 +2,7 @@
The Nautilus team would like to thank the following contributors:
Anders Carlsson <andersca@gnu.org> - background drawing optimizations
Brian Frank <bfrank@eazel.com> - fixes to default bookmarks
Christopher Blizzard <blizzard@redhat.com> - mozilla component fixes
Christopher James Lahey <clahey@helixcode.com> - bug fixes
Cody Russell <car0969@gamma2.uta.edu> - bug fixes
@ -14,6 +15,7 @@ JP Rosevear <jpr@arcavia.com> - bug fixes
Kenneth Christiansen <kenneth@gnu.org> - icons
Kjartan Maraas <kmaraas@online.no> - bug fixes, i18n code
Martin Baulig <martin@home-of-linux.org> - added PersistFile support
Matt Bissiri <bissiri@eecs.umich.edu> - list widget improvements
Michael Meeks <michael@helixcode.com> - vfs stream update
Morten Welinder <terra@diku.dk> - check-fixme suggestions
Richard Hult <rhult@hem.passagen.se> - bug reporting
@ -26,20 +28,28 @@ As well as the following people who contributed translations:
Akira TAGOH <tagoh@gnome.gr.jp>
Alastair McKinstry <mckinstry@computer.org>
Almer S. Tigelaar <almer1@dds.nl>
Almer S. Tigelaar <almer1@dds.nl>
Andreas Hyden <a.hyden@cyberpoint.se>
Andrew V. Samoilov <sav@bcs.zp.ua>
Benedikt Roth <Benedikt.Roth@gmx.net>
Carlos Perelló Marín <carlos@hispalinux.es>
Christian Meyer <linux@chrisime.de>
Christian Rose <menthos@menthos.com>
Christopher R. Gabriel <cgabriel@softwarelibero.org>
Eric Brayeur <eb@ibelgique.com>
Fatih Demir <kabalak@gmx.net>
Jarkko Ranta <jjranta@cc.joensuu.fi>
Jean-Michel Ardantz <jmardantz@ifrance.com>
Jesus Bravo Alvarez <jba@pobox.com>
Kenneth Christiansen <kenneth@gnu.org>
Kjartan Maraas <kmaraas@gnome.org>
Matthias Warkus <mawa@iname.com>
Pablo Saratxaga <pablo@mandrakesoft.com>
Kjartan Maraas <kmaraas@gnome.org>
Kenneth Christiansen <kenneth@gnu.org>
Robert Brady <robert@suse.co.uk>
Takuo Kitame <kitame@debian.org>
Valek Filippov <frob@df.ru>
Young-Ho Cha <ganadist@dacome.co.kr>
Yukihiro Nakai <nakai@gnome.gr.jp>
Yuri Syrota <rasta@renome.rovno.ua>
Young-Ho Cha <ganadist@dacome.co.kr>
Zbigniew Chyla <cyba@gnome.pl>

View file

@ -39,9 +39,18 @@
#include <stdio.h>
typedef void (*StopLoadingCallback) (NautilusAdapterProgressiveLoadStrategy *strategy,
void *user_data);
struct NautilusAdapterProgressiveLoadStrategyDetails {
Bonobo_ProgressiveDataSink progressive_data_sink;
gboolean stop;
gboolean loading;
gboolean no_report_stop;
StopLoadingCallback callback;
void *user_data;
};
@ -121,34 +130,86 @@ nautilus_adapter_progressive_load_strategy_new (Bonobo_ProgressiveDataSink prog
}
static void
call_when_stopped (NautilusAdapterProgressiveLoadStrategy *strategy,
StopLoadingCallback callback,
void *user_data)
{
strategy->details->callback = callback;
strategy->details->user_data = user_data;
}
static void
load_and_free_uri (NautilusAdapterProgressiveLoadStrategy *strategy,
gpointer data)
{
char *uri;
uri = (char *) data;
nautilus_adapter_progressive_load_strategy_load_location
(NAUTILUS_ADAPTER_LOAD_STRATEGY (strategy), uri);
g_free (uri);
}
static void
declare_done_loading (NautilusAdapterProgressiveLoadStrategy *strategy)
{
StopLoadingCallback cb;
void *data;
strategy->details->loading = FALSE;
if (strategy->details->callback != NULL) {
cb = strategy->details->callback;
strategy->details->callback = NULL;
data = strategy->details->user_data;
strategy->details->user_data = NULL;
(*cb) (strategy, data);
}
}
static void
stop_loading (NautilusAdapterProgressiveLoadStrategy *strategy,
GnomeVFSHandle *handle,
Bonobo_ProgressiveDataSink_iobuf *iobuf,
gboolean failed,
CORBA_Environment *ev)
{
Bonobo_ProgressiveDataSink_end (strategy->details->progressive_data_sink, ev);
nautilus_adapter_load_strategy_report_load_failed (NAUTILUS_ADAPTER_LOAD_STRATEGY (strategy));
if (! strategy->details->no_report_stop) {
if (failed) {
nautilus_adapter_load_strategy_report_load_failed (NAUTILUS_ADAPTER_LOAD_STRATEGY (strategy));
} else {
nautilus_adapter_load_strategy_report_load_complete (NAUTILUS_ADAPTER_LOAD_STRATEGY (strategy));
}
}
gtk_object_unref (GTK_OBJECT (strategy));
gnome_vfs_close (handle);
CORBA_free (iobuf);
CORBA_exception_free (ev);
declare_done_loading (strategy);
}
#define STOP_LOADING \
do { \
stop_loading (strategy, handle, iobuf, &ev); \
return; \
#define STOP_LOADING \
do { \
stop_loading (strategy, handle, iobuf, TRUE, &ev); \
return; \
} while (0)
#define CHECK_IF_STOPPED \
do { \
if (strategy->details->stop) { \
STOP_LOADING; \
} \
} while (0)
#define CHECK_IF_STOPPED \
do { \
if (strategy->details->stop) { \
stop_loading (strategy, handle, iobuf, FALSE, &ev); \
return; \
} \
} while (0)
#define LOAD_CHUNK 16384
@ -168,9 +229,23 @@ nautilus_adapter_progressive_load_strategy_load_location (NautilusAdapterLoadStr
strategy = NAUTILUS_ADAPTER_PROGRESSIVE_LOAD_STRATEGY (abstract_strategy);
strategy->details->stop = FALSE;
if (strategy->details->loading == TRUE) {
strategy->details->no_report_stop = TRUE;
nautilus_adapter_progressive_load_strategy_stop_loading (abstract_strategy);
call_when_stopped (strategy, load_and_free_uri, g_strdup (uri));
return;
}
strategy->details->no_report_stop = FALSE;
gtk_object_ref (GTK_OBJECT (strategy));
strategy->details->loading = TRUE;
strategy->details->stop = FALSE;
CORBA_exception_init (&ev);
/* FIXME bugzilla.eazel.com 3455: this code is stupid and
@ -182,6 +257,7 @@ nautilus_adapter_progressive_load_strategy_load_location (NautilusAdapterLoadStr
nautilus_adapter_load_strategy_report_load_failed (abstract_strategy);
gtk_object_unref (GTK_OBJECT (strategy));
CORBA_exception_free (&ev);
declare_done_loading (strategy);
return;
}
@ -193,9 +269,10 @@ nautilus_adapter_progressive_load_strategy_load_location (NautilusAdapterLoadStr
nautilus_adapter_load_strategy_report_load_underway (abstract_strategy);
if (strategy->details->stop) {
nautilus_adapter_load_strategy_report_load_failed (abstract_strategy);
nautilus_adapter_load_strategy_report_load_complete (abstract_strategy);
gtk_object_unref (GTK_OBJECT (strategy));
CORBA_exception_free (&ev);
declare_done_loading (strategy);
return;
}
@ -234,6 +311,7 @@ nautilus_adapter_progressive_load_strategy_load_location (NautilusAdapterLoadStr
gnome_vfs_close (handle);
CORBA_free (iobuf);
CORBA_exception_free (&ev);
declare_done_loading (strategy);
return;
} else {
STOP_LOADING;
@ -254,3 +332,4 @@ nautilus_adapter_progressive_load_strategy_stop_loading (NautilusAdapterLoadStr
strategy->details->stop = TRUE;
}

View file

@ -45,9 +45,13 @@
#include <libnautilus-adapter/nautilus-adapter-factory.h>
struct NautilusAdapterDetails {
NautilusAdapterLoadStrategy *load_strategy;
NautilusAdapterEmbedStrategy *embed_strategy;
NautilusView *nautilus_view;
NautilusAdapterEmbedStrategy *embed_strategy;
NautilusAdapterLoadStrategy *load_strategy;
guint report_load_underway_id;
guint report_load_progress_id;
guint report_load_complete_id;
guint report_load_failed_id;
};
@ -111,20 +115,29 @@ nautilus_adapter_initialize (NautilusAdapter *adapter)
static void
nautilus_adapter_destroy (GtkObject *object)
{
NautilusAdapter *server;
NautilusAdapter *adapter;
server = NAUTILUS_ADAPTER (object);
adapter = NAUTILUS_ADAPTER (object);
if (server->details->load_strategy != NULL) {
nautilus_adapter_load_strategy_stop_loading (server->details->load_strategy);
gtk_object_unref (GTK_OBJECT (server->details->load_strategy));
gtk_signal_disconnect (GTK_OBJECT (adapter->details->load_strategy),
adapter->details->report_load_underway_id);
gtk_signal_disconnect (GTK_OBJECT (adapter->details->load_strategy),
adapter->details->report_load_progress_id);
gtk_signal_disconnect (GTK_OBJECT (adapter->details->load_strategy),
adapter->details->report_load_complete_id);
gtk_signal_disconnect (GTK_OBJECT (adapter->details->load_strategy),
adapter->details->report_load_failed_id);
if (adapter->details->load_strategy != NULL) {
nautilus_adapter_load_strategy_stop_loading (adapter->details->load_strategy);
gtk_object_unref (GTK_OBJECT (adapter->details->load_strategy));
}
if (server->details->embed_strategy != NULL) {
gtk_object_unref (GTK_OBJECT (server->details->embed_strategy));
if (adapter->details->embed_strategy != NULL) {
gtk_object_unref (GTK_OBJECT (adapter->details->embed_strategy));
}
g_free (server->details);
g_free (adapter->details);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
}
@ -186,28 +199,26 @@ nautilus_adapter_new (Bonobo_Unknown component)
}
/* hook up load strategy signals */
gtk_signal_connect_object_while_alive (GTK_OBJECT (adapter->details->load_strategy),
"report_load_underway",
nautilus_adapter_load_underway_callback,
GTK_OBJECT (adapter));
/* hook up load strategy signals */
gtk_signal_connect_object_while_alive (GTK_OBJECT (adapter->details->load_strategy),
"report_load_progress",
nautilus_adapter_load_progress_callback,
GTK_OBJECT (adapter));
/* hook up load strategy signals */
gtk_signal_connect_object_while_alive (GTK_OBJECT (adapter->details->load_strategy),
"report_load_complete",
nautilus_adapter_load_complete_callback,
GTK_OBJECT (adapter));
/* hook up load strategy signals */
gtk_signal_connect_object_while_alive (GTK_OBJECT (adapter->details->load_strategy),
"report_load_failed",
nautilus_adapter_load_failed_callback,
GTK_OBJECT (adapter));
adapter->details->report_load_underway_id =
gtk_signal_connect_object (GTK_OBJECT (adapter->details->load_strategy),
"report_load_underway",
nautilus_adapter_load_underway_callback,
GTK_OBJECT (adapter));
adapter->details->report_load_progress_id =
gtk_signal_connect_object (GTK_OBJECT (adapter->details->load_strategy),
"report_load_progress",
nautilus_adapter_load_progress_callback,
GTK_OBJECT (adapter));
adapter->details->report_load_complete_id =
gtk_signal_connect_object (GTK_OBJECT (adapter->details->load_strategy),
"report_load_complete",
nautilus_adapter_load_complete_callback,
GTK_OBJECT (adapter));
adapter->details->report_load_failed_id =
gtk_signal_connect_object (GTK_OBJECT (adapter->details->load_strategy),
"report_load_failed",
nautilus_adapter_load_failed_callback,
GTK_OBJECT (adapter));
/* complete the embedding */

View file

@ -72,8 +72,6 @@ nautilus_component_adapter_factory_initialize (NautilusComponentAdapterFactory *
(BONOBO_OBJECT (object_client), "IDL:Nautilus/ComponentAdapterFactory:1.0");
bonobo_object_unref (BONOBO_OBJECT (object_client));
}
/* FIXME: Since corba_factory could now be NULL, what do we do in that case? */
}
@ -98,7 +96,11 @@ static NautilusComponentAdapterFactory *global_component_adapter_factory = NULL;
static void
component_adapter_factory_at_exit_destructor (void)
{
gtk_object_unref (GTK_OBJECT (global_component_adapter_factory));
if (global_component_adapter_factory != NULL) {
gtk_object_unref (GTK_OBJECT (global_component_adapter_factory));
}
global_component_adapter_factory = NULL;
}
@ -114,6 +116,12 @@ nautilus_component_adapter_factory_get (void)
g_atexit (component_adapter_factory_at_exit_destructor);
}
if (global_component_adapter_factory->details->corba_factory == CORBA_OBJECT_NIL) {
gtk_object_unref (GTK_OBJECT (global_component_adapter_factory));
global_component_adapter_factory = NULL;
}
return global_component_adapter_factory;
}

View file

@ -559,15 +559,21 @@ nautilus_view_frame_set_to_component (NautilusViewFrame *view, BonoboObjectClien
Nautilus_View adapted;
Bonobo_Control control;
BonoboControlFrame *control_frame;
NautilusComponentAdapterFactory *adapter_factory;
/* Either create an adapter or query for the Nautilus:View
* interface. Either way, we don't need to keep the original
* reference around once that happens.
*/
adapter_factory = nautilus_component_adapter_factory_get ();
if (adapter_factory == NULL) {
return FALSE;
}
adapted = nautilus_component_adapter_factory_create_adapter
(nautilus_component_adapter_factory_get (),
(adapter_factory,
component);
bonobo_object_unref (BONOBO_OBJECT (component));

View file

@ -660,6 +660,19 @@ nautilus_window_open_location_in_new_window (NautilusWindow *window,
open_location (window, location, TRUE, selection);
}
static void
report_content_view_failure_to_user (NautilusWindow *window,
const char *name)
{
char *message;
message = g_strdup_printf ("The %s view encountered an error and can't continue. "
"You can choose another view or go to a different location.",
name);
nautilus_error_dialog (message, _("View Failed"), GTK_WINDOW (window));
g_free (message);
}
static NautilusViewFrame *
load_content_view (NautilusWindow *window,
NautilusViewIdentifier *id)
@ -708,8 +721,16 @@ load_content_view (NautilusWindow *window,
new_view = nautilus_view_frame_new (window->details->ui_container,
window->application->undo_manager);
connect_view (window, new_view);
if (!nautilus_view_frame_load_client (new_view, iid)) {
gtk_widget_unref (GTK_WIDGET(new_view));
/* FIXME: We need a way to report the specific
error that happens in this case - adapter
factory not found, component failed to
load, etc. */
report_content_view_failure_to_user (window, id->name);
gtk_widget_unref (GTK_WIDGET (new_view));
new_view = NULL;
}
@ -733,17 +754,7 @@ load_content_view (NautilusWindow *window,
return new_view;
}
static void
report_content_view_failure_to_user (NautilusWindow *window)
{
char *message;
message = g_strdup_printf ("The %s view encountered an error and can't continue. "
"You can choose another view or go to a different location.",
window->content_view_id->name);
nautilus_error_dialog (message, _("View Failed"), GTK_WINDOW (window));
g_free (message);
}
static void
report_sidebar_panel_failure_to_user (NautilusWindow *window)
@ -778,7 +789,7 @@ handle_view_failure (NautilusWindow *window,
gtk_container_remove (GTK_CONTAINER (GTK_WIDGET (window->content_view)->parent),
GTK_WIDGET (window->content_view));
}
report_content_view_failure_to_user (window);
report_content_view_failure_to_user (window, window->content_view_id->name);
window->content_view = NULL;
window->cv_progress_error = TRUE;
} else {
@ -1437,6 +1448,11 @@ nautilus_window_set_sidebar_panels (NautilusWindow *window,
/* If the load failed, tell the user. */
if (!load_succeeded) {
/* FIXME: This needs to report the error to the user. */
window->details->dead_view_name = identifier->name;
report_sidebar_panel_failure_to_user (window);
window->details->dead_view_name = NULL;
g_warning ("sidebar_panels_changed_callback: Failed to load_client for '%s' meta view.",
identifier->iid);
gtk_object_sink (GTK_OBJECT (sidebar_panel));