diff options
author | Andy Hertzfeld <andy@src.gnome.org> | 2001-01-16 03:44:40 +0000 |
---|---|---|
committer | Andy Hertzfeld <andy@src.gnome.org> | 2001-01-16 03:44:40 +0000 |
commit | 995813813f1d2c426a80acfa8745263e037c7f0e (patch) | |
tree | 100d7adf764d78ec8d2b735c614d57fb23cb348b /src | |
parent | be706e1600005c092bd02e5e6cd78134e4c16228 (diff) | |
download | nautilus-995813813f1d2c426a80acfa8745263e037c7f0e.tar.gz |
fixed bug 4369, throbber frozen during long refresh, by making the
fixed bug 4369, throbber frozen during long refresh, by making the
throbber a bonobo component so it's driven by its own thread.
Note that clicking on the throbber is temporarily broken; I'll
fix that soon. Also, made the frame delay be specified by the
theme and set the default to spin somewhat slower than before.
* configure.in:
* components/Makefile.am:
* components/throbber/.cvsignore:
* components/throbber/Makefile.am:
* components/throbber/nautilus-throbber.oafinfo:
added throbber component
* components/throbber/main.c: (throbber_object_destroyed),
(throbber_make_object), (main):
factory for the throbber component
* components/throbber/nautilus-throbber.c,h:
(nautilus_throbber_initialize_class), (is_throbbing),
(get_bonobo_properties), (set_bonobo_properties),
(nautilus_throbber_destroy), (nautilus_throbber_get_control),
(get_throbber_dimensions), (nautilus_throbber_initialize),
(nautilus_throbber_new), (nautilus_throbber_theme_changed),
(draw_pixbuf), (select_throbber_image), (draw_throbber_image),
(nautilus_throbber_draw), (nautilus_throbber_expose),
(nautilus_throbber_map), (bump_throbber_frame),
(nautilus_throbber_start),
(nautilus_throbber_remove_update_callback),
(nautilus_throbber_stop), (nautilus_throbber_unload_images),
(load_themed_image), (make_throbber_frame_name),
(nautilus_throbber_load_images),
(nautilus_throbber_button_press_event),
(nautilus_throbber_set_small_mode),
(nautilus_throbber_size_allocate),
(nautilus_throbber_size_request):
throbber widget for the bonobo component
* src/nautilus-window-toolbars.c: (theme_changed_callback),
(nautilus_window_initialize_toolbars):
set up throbber component in the toolbar
* src/nautilus-window.c,h: (nautilus_window_constructed),
(nautilus_window_allow_stop):
use property interface to start and stop the throbber
* icons/default.xml:
added delay specification to throbber in default theme
* nautilus-clean.sh:
clean throbber component as necessary
* src/Makefile.am:
* src/nautilus-throbber.c,h
removed old throbber widget
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/nautilus-navigation-window.c | 20 | ||||
-rw-r--r-- | src/nautilus-navigation-window.h | 2 | ||||
-rw-r--r-- | src/nautilus-object-window.c | 20 | ||||
-rw-r--r-- | src/nautilus-object-window.h | 2 | ||||
-rw-r--r-- | src/nautilus-spatial-window.c | 20 | ||||
-rw-r--r-- | src/nautilus-spatial-window.h | 2 | ||||
-rw-r--r-- | src/nautilus-window-toolbars.c | 80 | ||||
-rw-r--r-- | src/nautilus-window.c | 20 | ||||
-rw-r--r-- | src/nautilus-window.h | 2 |
10 files changed, 82 insertions, 88 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 7eecf6c20..30e18c842 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -83,7 +83,6 @@ noinst_HEADERS = \ nautilus-switchable-navigation-bar.h \ nautilus-switchable-search-bar.h \ nautilus-theme-selector.h \ - nautilus-throbber.h \ nautilus-view-frame-private.h \ nautilus-view-frame.h \ nautilus-window-manage-views.h \ @@ -123,7 +122,6 @@ nautilus_SOURCES = \ nautilus-switchable-navigation-bar.c \ nautilus-switchable-search-bar.c \ nautilus-theme-selector.c \ - nautilus-throbber.c \ nautilus-view-frame-corba.c \ nautilus-view-frame.c \ nautilus-window-manage-views.c \ diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c index 3818e746c..d4894a60c 100644 --- a/src/nautilus-navigation-window.c +++ b/src/nautilus-navigation-window.c @@ -36,11 +36,11 @@ #include "nautilus-sidebar.h" #include "nautilus-signaller.h" #include "nautilus-switchable-navigation-bar.h" -#include "nautilus-throbber.h" #include "nautilus-window-manage-views.h" #include "nautilus-window-service-ui.h" #include "nautilus-zoom-control.h" #include <bonobo/bonobo-ui-util.h> +#include <bonobo/bonobo-exception.h> #include <ctype.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <gtk/gtkmain.h> @@ -537,8 +537,10 @@ nautilus_window_constructed (NautilusWindow *window) nautilus_window_initialize_toolbars (window); /* watch for throbber location changes, too */ + /* gtk_signal_connect (GTK_OBJECT (window->throbber), "location_changed", goto_uri_callback, window); + */ /* Set initial sensitivity of some buttons & menu items * now that they're all created. @@ -1304,14 +1306,22 @@ nautilus_window_allow_reload (NautilusWindow *window, gboolean allow) void nautilus_window_allow_stop (NautilusWindow *window, gboolean allow) { + CORBA_Environment ev; + Bonobo_PropertyBag property_bag; + nautilus_bonobo_set_sensitive (window->details->shell_ui, NAUTILUS_COMMAND_STOP, allow); + if (window->throbber != NULL) { - if (allow) { - nautilus_throbber_start (NAUTILUS_THROBBER (window->throbber)); - } else { - nautilus_throbber_stop (NAUTILUS_THROBBER (window->throbber)); + CORBA_exception_init (&ev); + property_bag = Bonobo_Control_getProperties (window->throbber, &ev); + + if (property_bag != NULL && !BONOBO_EX (&ev)) { + bonobo_property_bag_client_set_value_gboolean (property_bag, "throbbing", allow, &ev); + bonobo_object_release_unref (property_bag, &ev); } + CORBA_exception_free (&ev); + } } diff --git a/src/nautilus-navigation-window.h b/src/nautilus-navigation-window.h index 5d798ff5a..ed9b189b2 100644 --- a/src/nautilus-navigation-window.h +++ b/src/nautilus-navigation-window.h @@ -100,7 +100,7 @@ struct NautilusWindow { /* Widgets to keep track of (for state changes, etc) */ GtkWidget *zoom_control; - GtkWidget *throbber; + Bonobo_Unknown throbber; /* Pending changes */ NautilusNavigationInfo *pending_ni; diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c index 3818e746c..d4894a60c 100644 --- a/src/nautilus-object-window.c +++ b/src/nautilus-object-window.c @@ -36,11 +36,11 @@ #include "nautilus-sidebar.h" #include "nautilus-signaller.h" #include "nautilus-switchable-navigation-bar.h" -#include "nautilus-throbber.h" #include "nautilus-window-manage-views.h" #include "nautilus-window-service-ui.h" #include "nautilus-zoom-control.h" #include <bonobo/bonobo-ui-util.h> +#include <bonobo/bonobo-exception.h> #include <ctype.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <gtk/gtkmain.h> @@ -537,8 +537,10 @@ nautilus_window_constructed (NautilusWindow *window) nautilus_window_initialize_toolbars (window); /* watch for throbber location changes, too */ + /* gtk_signal_connect (GTK_OBJECT (window->throbber), "location_changed", goto_uri_callback, window); + */ /* Set initial sensitivity of some buttons & menu items * now that they're all created. @@ -1304,14 +1306,22 @@ nautilus_window_allow_reload (NautilusWindow *window, gboolean allow) void nautilus_window_allow_stop (NautilusWindow *window, gboolean allow) { + CORBA_Environment ev; + Bonobo_PropertyBag property_bag; + nautilus_bonobo_set_sensitive (window->details->shell_ui, NAUTILUS_COMMAND_STOP, allow); + if (window->throbber != NULL) { - if (allow) { - nautilus_throbber_start (NAUTILUS_THROBBER (window->throbber)); - } else { - nautilus_throbber_stop (NAUTILUS_THROBBER (window->throbber)); + CORBA_exception_init (&ev); + property_bag = Bonobo_Control_getProperties (window->throbber, &ev); + + if (property_bag != NULL && !BONOBO_EX (&ev)) { + bonobo_property_bag_client_set_value_gboolean (property_bag, "throbbing", allow, &ev); + bonobo_object_release_unref (property_bag, &ev); } + CORBA_exception_free (&ev); + } } diff --git a/src/nautilus-object-window.h b/src/nautilus-object-window.h index 5d798ff5a..ed9b189b2 100644 --- a/src/nautilus-object-window.h +++ b/src/nautilus-object-window.h @@ -100,7 +100,7 @@ struct NautilusWindow { /* Widgets to keep track of (for state changes, etc) */ GtkWidget *zoom_control; - GtkWidget *throbber; + Bonobo_Unknown throbber; /* Pending changes */ NautilusNavigationInfo *pending_ni; diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c index 3818e746c..d4894a60c 100644 --- a/src/nautilus-spatial-window.c +++ b/src/nautilus-spatial-window.c @@ -36,11 +36,11 @@ #include "nautilus-sidebar.h" #include "nautilus-signaller.h" #include "nautilus-switchable-navigation-bar.h" -#include "nautilus-throbber.h" #include "nautilus-window-manage-views.h" #include "nautilus-window-service-ui.h" #include "nautilus-zoom-control.h" #include <bonobo/bonobo-ui-util.h> +#include <bonobo/bonobo-exception.h> #include <ctype.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <gtk/gtkmain.h> @@ -537,8 +537,10 @@ nautilus_window_constructed (NautilusWindow *window) nautilus_window_initialize_toolbars (window); /* watch for throbber location changes, too */ + /* gtk_signal_connect (GTK_OBJECT (window->throbber), "location_changed", goto_uri_callback, window); + */ /* Set initial sensitivity of some buttons & menu items * now that they're all created. @@ -1304,14 +1306,22 @@ nautilus_window_allow_reload (NautilusWindow *window, gboolean allow) void nautilus_window_allow_stop (NautilusWindow *window, gboolean allow) { + CORBA_Environment ev; + Bonobo_PropertyBag property_bag; + nautilus_bonobo_set_sensitive (window->details->shell_ui, NAUTILUS_COMMAND_STOP, allow); + if (window->throbber != NULL) { - if (allow) { - nautilus_throbber_start (NAUTILUS_THROBBER (window->throbber)); - } else { - nautilus_throbber_stop (NAUTILUS_THROBBER (window->throbber)); + CORBA_exception_init (&ev); + property_bag = Bonobo_Control_getProperties (window->throbber, &ev); + + if (property_bag != NULL && !BONOBO_EX (&ev)) { + bonobo_property_bag_client_set_value_gboolean (property_bag, "throbbing", allow, &ev); + bonobo_object_release_unref (property_bag, &ev); } + CORBA_exception_free (&ev); + } } diff --git a/src/nautilus-spatial-window.h b/src/nautilus-spatial-window.h index 5d798ff5a..ed9b189b2 100644 --- a/src/nautilus-spatial-window.h +++ b/src/nautilus-spatial-window.h @@ -100,7 +100,7 @@ struct NautilusWindow { /* Widgets to keep track of (for state changes, etc) */ GtkWidget *zoom_control; - GtkWidget *throbber; + Bonobo_Unknown throbber; /* Pending changes */ NautilusNavigationInfo *pending_ni; diff --git a/src/nautilus-window-toolbars.c b/src/nautilus-window-toolbars.c index ee95dd14c..12c2e3eb1 100644 --- a/src/nautilus-window-toolbars.c +++ b/src/nautilus-window-toolbars.c @@ -29,12 +29,10 @@ #include <config.h> #include "nautilus-application.h" -#include "nautilus-throbber.h" #include "nautilus-window-manage-views.h" #include "nautilus-window-private.h" #include "nautilus-window.h" -#include <bonobo/bonobo-control.h> -#include <bonobo/bonobo-ui-util.h> +#include <bonobo.h> #include <gtk/gtkframe.h> #include <gtk/gtktogglebutton.h> #include <libgnome/gnome-i18n.h> @@ -291,55 +289,6 @@ set_up_toolbar_images (NautilusWindow *window) bonobo_ui_component_thaw (window->details->shell_ui, NULL); } -static GtkWidget * -set_up_throbber_frame_type (NautilusWindow *window) -{ - GtkWidget *frame; - char *frame_type; - GtkShadowType shadow_type; - - frame = window->throbber->parent; - - frame_type = nautilus_theme_get_theme_data ("toolbar", "FRAME_TYPE"); - shadow_type = GTK_SHADOW_NONE; - - if (nautilus_strcmp (frame_type, "in") == 0) { - shadow_type = GTK_SHADOW_IN; - } else if (nautilus_strcmp (frame_type, "out") == 0) { - shadow_type = GTK_SHADOW_OUT; - } else if (nautilus_strcmp (frame_type, "none") == 0) { - shadow_type = GTK_SHADOW_NONE; - } else { - shadow_type = GTK_SHADOW_NONE; - } - - g_free (frame_type); - - /* FIXME bugzilla.eazel.com 5034: for now, force no shadow until bonobo toolbar problems get resolved */ - shadow_type = GTK_SHADOW_NONE; - gtk_frame_set_shadow_type (GTK_FRAME (frame), shadow_type); - - return frame; -} - -static GtkWidget * -allocate_throbber (void) -{ - GtkWidget *throbber, *frame; - gboolean small_mode; - - throbber = nautilus_throbber_new (); - gtk_widget_show (throbber); - - frame = gtk_frame_new (NULL); - gtk_widget_show (frame); - gtk_container_add (GTK_CONTAINER (frame), throbber); - - small_mode = !gnome_preferences_get_toolbar_labels (); - nautilus_throbber_set_small_mode (NAUTILUS_THROBBER (throbber), small_mode); - - return throbber; -} /* handle theme changes */ static void @@ -350,7 +299,6 @@ theme_changed_callback (gpointer callback_data) window = NAUTILUS_WINDOW (callback_data); set_up_toolbar_images (window); - set_up_throbber_frame_type (window); /* if the toolbar is visible, toggle it's visibility to force a relayout */ if (nautilus_window_tool_bar_showing (window)) { @@ -404,18 +352,26 @@ set_up_back_or_forward_tool_bar_item (NautilusWindow *window, void nautilus_window_initialize_toolbars (NautilusWindow *window) { - GtkWidget *frame, *box; + CORBA_Environment ev; + CORBA_exception_init (&ev); - window->throbber = allocate_throbber (); - frame = set_up_throbber_frame_type (window); + window->throbber = bonobo_get_object ("OAFIID:nautilus_throbber", "IDL:Bonobo/Control:1.0", &ev); - /* wrap it in another box to add some visual padding */ - box = gtk_hbox_new (FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (box), 4); - gtk_widget_show (box); - gtk_container_add (GTK_CONTAINER (box), frame); + if (BONOBO_EX (&ev)) { + char *txt; + g_warning ("Activation exception '%s'", + (txt = bonobo_exception_get_text (&ev))); + g_free (txt); + window->throbber = CORBA_OBJECT_NIL; + } + + bonobo_ui_component_object_set (window->details->shell_ui, + "/Tool Bar/ThrobberWrapper", + window->throbber, + &ev); + + CORBA_exception_free (&ev); - set_widget_for_bonobo_control (window, box, "/Tool Bar/ThrobberWrapper"); window->details->back_button_item = set_up_back_or_forward_tool_bar_item (window, _("Back"), "/Tool Bar/BackWrapper"); diff --git a/src/nautilus-window.c b/src/nautilus-window.c index 3818e746c..d4894a60c 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -36,11 +36,11 @@ #include "nautilus-sidebar.h" #include "nautilus-signaller.h" #include "nautilus-switchable-navigation-bar.h" -#include "nautilus-throbber.h" #include "nautilus-window-manage-views.h" #include "nautilus-window-service-ui.h" #include "nautilus-zoom-control.h" #include <bonobo/bonobo-ui-util.h> +#include <bonobo/bonobo-exception.h> #include <ctype.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <gtk/gtkmain.h> @@ -537,8 +537,10 @@ nautilus_window_constructed (NautilusWindow *window) nautilus_window_initialize_toolbars (window); /* watch for throbber location changes, too */ + /* gtk_signal_connect (GTK_OBJECT (window->throbber), "location_changed", goto_uri_callback, window); + */ /* Set initial sensitivity of some buttons & menu items * now that they're all created. @@ -1304,14 +1306,22 @@ nautilus_window_allow_reload (NautilusWindow *window, gboolean allow) void nautilus_window_allow_stop (NautilusWindow *window, gboolean allow) { + CORBA_Environment ev; + Bonobo_PropertyBag property_bag; + nautilus_bonobo_set_sensitive (window->details->shell_ui, NAUTILUS_COMMAND_STOP, allow); + if (window->throbber != NULL) { - if (allow) { - nautilus_throbber_start (NAUTILUS_THROBBER (window->throbber)); - } else { - nautilus_throbber_stop (NAUTILUS_THROBBER (window->throbber)); + CORBA_exception_init (&ev); + property_bag = Bonobo_Control_getProperties (window->throbber, &ev); + + if (property_bag != NULL && !BONOBO_EX (&ev)) { + bonobo_property_bag_client_set_value_gboolean (property_bag, "throbbing", allow, &ev); + bonobo_object_release_unref (property_bag, &ev); } + CORBA_exception_free (&ev); + } } diff --git a/src/nautilus-window.h b/src/nautilus-window.h index 5d798ff5a..ed9b189b2 100644 --- a/src/nautilus-window.h +++ b/src/nautilus-window.h @@ -100,7 +100,7 @@ struct NautilusWindow { /* Widgets to keep track of (for state changes, etc) */ GtkWidget *zoom_control; - GtkWidget *throbber; + Bonobo_Unknown throbber; /* Pending changes */ NautilusNavigationInfo *pending_ni; |