diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-navigation-window.c | 66 | ||||
-rw-r--r-- | src/nautilus-navigation-window.h | 1 | ||||
-rw-r--r-- | src/nautilus-object-window.c | 66 | ||||
-rw-r--r-- | src/nautilus-object-window.h | 1 | ||||
-rw-r--r-- | src/nautilus-spatial-window.c | 66 | ||||
-rw-r--r-- | src/nautilus-spatial-window.h | 1 | ||||
-rw-r--r-- | src/nautilus-window-private.h | 3 | ||||
-rw-r--r-- | src/nautilus-window-toolbars.c | 23 | ||||
-rw-r--r-- | src/nautilus-window.c | 66 | ||||
-rw-r--r-- | src/nautilus-window.h | 1 |
10 files changed, 136 insertions, 158 deletions
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c index 36e356b24..adbecdbdc 100644 --- a/src/nautilus-navigation-window.c +++ b/src/nautilus-navigation-window.c @@ -531,8 +531,6 @@ set_initial_window_geometry (NautilusWindow *window) max_height_for_screen)); } -#if GNOME2_CONVERSION_COMPLETE - static gboolean location_change_at_idle_callback (gpointer callback_data) { @@ -555,11 +553,11 @@ location_change_at_idle_callback (gpointer callback_data) /* handle bonobo events from the throbber -- since they can come in at any time right in the middle of things, defer until idle */ static void -throbber_location_change_request_callback (BonoboListener *listener, - char *event_name, - CORBA_any *arg, - CORBA_Environment *ev, - gpointer callback_data) +throbber_callback (BonoboListener *listener, + const char *event_name, + const CORBA_any *arg, + CORBA_Environment *ev, + gpointer callback_data) { NautilusWindow *window; @@ -574,8 +572,6 @@ throbber_location_change_request_callback (BonoboListener *listener, } } -#endif - /* Add a dummy menu with a "View as ..." item when we first create the * view_as_option_menu -- without this the menu draws empty and shrunk, * once we populate it it grows and forces the toolbar and all the other @@ -746,16 +742,15 @@ nautilus_window_constructed (NautilusWindow *window) window->details->ui_pending_initialize_menus_part_2 = TRUE; /* watch for throbber location changes, too */ - if (window->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber != CORBA_OBJECT_NIL) { CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { -#if GNOME2_CONVERSION_COMPLETE - window->details->throbber_location_change_request_listener_id = - bonobo_event_source_client_add_listener - (property_bag, throbber_location_change_request_callback, - "Bonobo/Property:change:location", NULL, window); -#endif + window->details->throbber_listener = + bonobo_event_source_client_add_listener_full + (property_bag, + g_cclosure_new (G_CALLBACK (throbber_callback), window, NULL), + "Bonobo/Property:change:location", NULL); bonobo_object_release_unref (property_bag, NULL); } CORBA_exception_free (&ev); @@ -851,23 +846,25 @@ nautilus_window_unrealize (GtkWidget *widget) /* Get rid of the throbber explicitly before it self-destructs * (which it will do when the control frame goes away. */ - if (window->throbber != CORBA_OBJECT_NIL) { - CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); - if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { -#if GNOME2_CONVERSION_COMPLETE - bonobo_event_source_client_remove_listener - (property_bag, - window->details->throbber_location_change_request_listener_id, - &ev); -#endif - bonobo_object_release_unref (property_bag, NULL); - } - CORBA_exception_free (&ev); + if (window->details->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber_listener != CORBA_OBJECT_NIL) { + CORBA_exception_init (&ev); + + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); + if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { + bonobo_event_source_client_remove_listener + (property_bag, window->details->throbber_listener, NULL); + bonobo_object_release_unref (property_bag, NULL); + } - bonobo_object_release_unref (window->throbber, NULL); + CORBA_Object_release (window->details->throbber_listener, &ev); + window->details->throbber_listener = CORBA_OBJECT_NIL; - window->throbber = CORBA_OBJECT_NIL; + CORBA_exception_free (&ev); + } + + bonobo_object_release_unref (window->details->throbber, NULL); + window->details->throbber = CORBA_OBJECT_NIL; } EEL_CALL_PARENT (GTK_WIDGET_CLASS, unrealize, (widget)); @@ -1720,10 +1717,9 @@ nautilus_window_allow_stop (NautilusWindow *window, gboolean allow) nautilus_bonobo_set_sensitive (window->details->shell_ui, NAUTILUS_COMMAND_STOP, allow); - if (window->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber != CORBA_OBJECT_NIL) { CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); - + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { bonobo_pbclient_set_boolean (property_bag, "throbbing", allow, &ev); bonobo_object_release_unref (property_bag, NULL); diff --git a/src/nautilus-navigation-window.h b/src/nautilus-navigation-window.h index fd49f4b7f..d487c25ed 100644 --- a/src/nautilus-navigation-window.h +++ b/src/nautilus-navigation-window.h @@ -98,7 +98,6 @@ struct NautilusWindow { /* Widgets to keep track of (for state changes, etc) */ GtkWidget *zoom_control; - Bonobo_Unknown throbber; /* Pending changes */ NautilusViewFrame *new_content_view; diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c index 36e356b24..adbecdbdc 100644 --- a/src/nautilus-object-window.c +++ b/src/nautilus-object-window.c @@ -531,8 +531,6 @@ set_initial_window_geometry (NautilusWindow *window) max_height_for_screen)); } -#if GNOME2_CONVERSION_COMPLETE - static gboolean location_change_at_idle_callback (gpointer callback_data) { @@ -555,11 +553,11 @@ location_change_at_idle_callback (gpointer callback_data) /* handle bonobo events from the throbber -- since they can come in at any time right in the middle of things, defer until idle */ static void -throbber_location_change_request_callback (BonoboListener *listener, - char *event_name, - CORBA_any *arg, - CORBA_Environment *ev, - gpointer callback_data) +throbber_callback (BonoboListener *listener, + const char *event_name, + const CORBA_any *arg, + CORBA_Environment *ev, + gpointer callback_data) { NautilusWindow *window; @@ -574,8 +572,6 @@ throbber_location_change_request_callback (BonoboListener *listener, } } -#endif - /* Add a dummy menu with a "View as ..." item when we first create the * view_as_option_menu -- without this the menu draws empty and shrunk, * once we populate it it grows and forces the toolbar and all the other @@ -746,16 +742,15 @@ nautilus_window_constructed (NautilusWindow *window) window->details->ui_pending_initialize_menus_part_2 = TRUE; /* watch for throbber location changes, too */ - if (window->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber != CORBA_OBJECT_NIL) { CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { -#if GNOME2_CONVERSION_COMPLETE - window->details->throbber_location_change_request_listener_id = - bonobo_event_source_client_add_listener - (property_bag, throbber_location_change_request_callback, - "Bonobo/Property:change:location", NULL, window); -#endif + window->details->throbber_listener = + bonobo_event_source_client_add_listener_full + (property_bag, + g_cclosure_new (G_CALLBACK (throbber_callback), window, NULL), + "Bonobo/Property:change:location", NULL); bonobo_object_release_unref (property_bag, NULL); } CORBA_exception_free (&ev); @@ -851,23 +846,25 @@ nautilus_window_unrealize (GtkWidget *widget) /* Get rid of the throbber explicitly before it self-destructs * (which it will do when the control frame goes away. */ - if (window->throbber != CORBA_OBJECT_NIL) { - CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); - if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { -#if GNOME2_CONVERSION_COMPLETE - bonobo_event_source_client_remove_listener - (property_bag, - window->details->throbber_location_change_request_listener_id, - &ev); -#endif - bonobo_object_release_unref (property_bag, NULL); - } - CORBA_exception_free (&ev); + if (window->details->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber_listener != CORBA_OBJECT_NIL) { + CORBA_exception_init (&ev); + + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); + if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { + bonobo_event_source_client_remove_listener + (property_bag, window->details->throbber_listener, NULL); + bonobo_object_release_unref (property_bag, NULL); + } - bonobo_object_release_unref (window->throbber, NULL); + CORBA_Object_release (window->details->throbber_listener, &ev); + window->details->throbber_listener = CORBA_OBJECT_NIL; - window->throbber = CORBA_OBJECT_NIL; + CORBA_exception_free (&ev); + } + + bonobo_object_release_unref (window->details->throbber, NULL); + window->details->throbber = CORBA_OBJECT_NIL; } EEL_CALL_PARENT (GTK_WIDGET_CLASS, unrealize, (widget)); @@ -1720,10 +1717,9 @@ nautilus_window_allow_stop (NautilusWindow *window, gboolean allow) nautilus_bonobo_set_sensitive (window->details->shell_ui, NAUTILUS_COMMAND_STOP, allow); - if (window->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber != CORBA_OBJECT_NIL) { CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); - + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { bonobo_pbclient_set_boolean (property_bag, "throbbing", allow, &ev); bonobo_object_release_unref (property_bag, NULL); diff --git a/src/nautilus-object-window.h b/src/nautilus-object-window.h index fd49f4b7f..d487c25ed 100644 --- a/src/nautilus-object-window.h +++ b/src/nautilus-object-window.h @@ -98,7 +98,6 @@ struct NautilusWindow { /* Widgets to keep track of (for state changes, etc) */ GtkWidget *zoom_control; - Bonobo_Unknown throbber; /* Pending changes */ NautilusViewFrame *new_content_view; diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c index 36e356b24..adbecdbdc 100644 --- a/src/nautilus-spatial-window.c +++ b/src/nautilus-spatial-window.c @@ -531,8 +531,6 @@ set_initial_window_geometry (NautilusWindow *window) max_height_for_screen)); } -#if GNOME2_CONVERSION_COMPLETE - static gboolean location_change_at_idle_callback (gpointer callback_data) { @@ -555,11 +553,11 @@ location_change_at_idle_callback (gpointer callback_data) /* handle bonobo events from the throbber -- since they can come in at any time right in the middle of things, defer until idle */ static void -throbber_location_change_request_callback (BonoboListener *listener, - char *event_name, - CORBA_any *arg, - CORBA_Environment *ev, - gpointer callback_data) +throbber_callback (BonoboListener *listener, + const char *event_name, + const CORBA_any *arg, + CORBA_Environment *ev, + gpointer callback_data) { NautilusWindow *window; @@ -574,8 +572,6 @@ throbber_location_change_request_callback (BonoboListener *listener, } } -#endif - /* Add a dummy menu with a "View as ..." item when we first create the * view_as_option_menu -- without this the menu draws empty and shrunk, * once we populate it it grows and forces the toolbar and all the other @@ -746,16 +742,15 @@ nautilus_window_constructed (NautilusWindow *window) window->details->ui_pending_initialize_menus_part_2 = TRUE; /* watch for throbber location changes, too */ - if (window->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber != CORBA_OBJECT_NIL) { CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { -#if GNOME2_CONVERSION_COMPLETE - window->details->throbber_location_change_request_listener_id = - bonobo_event_source_client_add_listener - (property_bag, throbber_location_change_request_callback, - "Bonobo/Property:change:location", NULL, window); -#endif + window->details->throbber_listener = + bonobo_event_source_client_add_listener_full + (property_bag, + g_cclosure_new (G_CALLBACK (throbber_callback), window, NULL), + "Bonobo/Property:change:location", NULL); bonobo_object_release_unref (property_bag, NULL); } CORBA_exception_free (&ev); @@ -851,23 +846,25 @@ nautilus_window_unrealize (GtkWidget *widget) /* Get rid of the throbber explicitly before it self-destructs * (which it will do when the control frame goes away. */ - if (window->throbber != CORBA_OBJECT_NIL) { - CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); - if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { -#if GNOME2_CONVERSION_COMPLETE - bonobo_event_source_client_remove_listener - (property_bag, - window->details->throbber_location_change_request_listener_id, - &ev); -#endif - bonobo_object_release_unref (property_bag, NULL); - } - CORBA_exception_free (&ev); + if (window->details->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber_listener != CORBA_OBJECT_NIL) { + CORBA_exception_init (&ev); + + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); + if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { + bonobo_event_source_client_remove_listener + (property_bag, window->details->throbber_listener, NULL); + bonobo_object_release_unref (property_bag, NULL); + } - bonobo_object_release_unref (window->throbber, NULL); + CORBA_Object_release (window->details->throbber_listener, &ev); + window->details->throbber_listener = CORBA_OBJECT_NIL; - window->throbber = CORBA_OBJECT_NIL; + CORBA_exception_free (&ev); + } + + bonobo_object_release_unref (window->details->throbber, NULL); + window->details->throbber = CORBA_OBJECT_NIL; } EEL_CALL_PARENT (GTK_WIDGET_CLASS, unrealize, (widget)); @@ -1720,10 +1717,9 @@ nautilus_window_allow_stop (NautilusWindow *window, gboolean allow) nautilus_bonobo_set_sensitive (window->details->shell_ui, NAUTILUS_COMMAND_STOP, allow); - if (window->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber != CORBA_OBJECT_NIL) { CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); - + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { bonobo_pbclient_set_boolean (property_bag, "throbbing", allow, &ev); bonobo_object_release_unref (property_bag, NULL); diff --git a/src/nautilus-spatial-window.h b/src/nautilus-spatial-window.h index fd49f4b7f..d487c25ed 100644 --- a/src/nautilus-spatial-window.h +++ b/src/nautilus-spatial-window.h @@ -98,7 +98,6 @@ struct NautilusWindow { /* Widgets to keep track of (for state changes, etc) */ GtkWidget *zoom_control; - Bonobo_Unknown throbber; /* Pending changes */ NautilusViewFrame *new_content_view; diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h index f1f41571b..43a62f26f 100644 --- a/src/nautilus-window-private.h +++ b/src/nautilus-window-private.h @@ -82,7 +82,8 @@ struct NautilusWindowDetails NautilusViewIdentifier *extra_viewer; /* Throbber. */ - Bonobo_EventSource_ListenerId throbber_location_change_request_listener_id; + Bonobo_Control throbber; + Bonobo_Listener throbber_listener; /* Deferred location change. */ char *location_to_change_to_at_idle; diff --git a/src/nautilus-window-toolbars.c b/src/nautilus-window-toolbars.c index ab94bf439..2a26da821 100644 --- a/src/nautilus-window-toolbars.c +++ b/src/nautilus-window-toolbars.c @@ -398,7 +398,7 @@ nautilus_window_initialize_toolbars (NautilusWindow *window) CORBA_Environment ev; char *exception_as_text; - CORBA_exception_init (&ev); + nautilus_window_ui_freeze (window); /* FIXME bugzilla.gnome.org 41243: * We should use inheritance instead of these special cases @@ -412,23 +412,20 @@ nautilus_window_initialize_toolbars (NautilusWindow *window) * desktop window. */ if (!NAUTILUS_IS_DESKTOP_WINDOW (window)) { - window->throbber = bonobo_get_object ("OAFIID:nautilus_throbber", "IDL:Bonobo/Control:1.0", &ev); + CORBA_exception_init (&ev); + + window->details->throbber = bonobo_get_object ("OAFIID:nautilus_throbber", "IDL:Bonobo/Control:1.0", &ev); if (BONOBO_EX (&ev)) { exception_as_text = bonobo_exception_get_text (&ev); - g_warning ("Throbber Activation exception '%s'", - exception_as_text); + g_warning ("Throbber activation exception '%s'", exception_as_text); g_free (exception_as_text); - window->throbber = CORBA_OBJECT_NIL; + window->details->throbber = CORBA_OBJECT_NIL; + } else if (window->details->throbber != CORBA_OBJECT_NIL) { + bonobo_ui_component_object_set (window->details->shell_ui, "/Toolbar/ThrobberWrapper", + window->details->throbber, NULL); } + CORBA_exception_free (&ev); } - - nautilus_window_ui_freeze (window); - - bonobo_ui_component_object_set (window->details->shell_ui, - "/Toolbar/ThrobberWrapper", - window->throbber, - &ev); - CORBA_exception_free (&ev); window->details->back_button_item = create_back_or_forward_toolbar_item (window, _("Back"), "/Toolbar/BackWrapper"); diff --git a/src/nautilus-window.c b/src/nautilus-window.c index 36e356b24..adbecdbdc 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -531,8 +531,6 @@ set_initial_window_geometry (NautilusWindow *window) max_height_for_screen)); } -#if GNOME2_CONVERSION_COMPLETE - static gboolean location_change_at_idle_callback (gpointer callback_data) { @@ -555,11 +553,11 @@ location_change_at_idle_callback (gpointer callback_data) /* handle bonobo events from the throbber -- since they can come in at any time right in the middle of things, defer until idle */ static void -throbber_location_change_request_callback (BonoboListener *listener, - char *event_name, - CORBA_any *arg, - CORBA_Environment *ev, - gpointer callback_data) +throbber_callback (BonoboListener *listener, + const char *event_name, + const CORBA_any *arg, + CORBA_Environment *ev, + gpointer callback_data) { NautilusWindow *window; @@ -574,8 +572,6 @@ throbber_location_change_request_callback (BonoboListener *listener, } } -#endif - /* Add a dummy menu with a "View as ..." item when we first create the * view_as_option_menu -- without this the menu draws empty and shrunk, * once we populate it it grows and forces the toolbar and all the other @@ -746,16 +742,15 @@ nautilus_window_constructed (NautilusWindow *window) window->details->ui_pending_initialize_menus_part_2 = TRUE; /* watch for throbber location changes, too */ - if (window->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber != CORBA_OBJECT_NIL) { CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { -#if GNOME2_CONVERSION_COMPLETE - window->details->throbber_location_change_request_listener_id = - bonobo_event_source_client_add_listener - (property_bag, throbber_location_change_request_callback, - "Bonobo/Property:change:location", NULL, window); -#endif + window->details->throbber_listener = + bonobo_event_source_client_add_listener_full + (property_bag, + g_cclosure_new (G_CALLBACK (throbber_callback), window, NULL), + "Bonobo/Property:change:location", NULL); bonobo_object_release_unref (property_bag, NULL); } CORBA_exception_free (&ev); @@ -851,23 +846,25 @@ nautilus_window_unrealize (GtkWidget *widget) /* Get rid of the throbber explicitly before it self-destructs * (which it will do when the control frame goes away. */ - if (window->throbber != CORBA_OBJECT_NIL) { - CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); - if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { -#if GNOME2_CONVERSION_COMPLETE - bonobo_event_source_client_remove_listener - (property_bag, - window->details->throbber_location_change_request_listener_id, - &ev); -#endif - bonobo_object_release_unref (property_bag, NULL); - } - CORBA_exception_free (&ev); + if (window->details->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber_listener != CORBA_OBJECT_NIL) { + CORBA_exception_init (&ev); + + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); + if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { + bonobo_event_source_client_remove_listener + (property_bag, window->details->throbber_listener, NULL); + bonobo_object_release_unref (property_bag, NULL); + } - bonobo_object_release_unref (window->throbber, NULL); + CORBA_Object_release (window->details->throbber_listener, &ev); + window->details->throbber_listener = CORBA_OBJECT_NIL; - window->throbber = CORBA_OBJECT_NIL; + CORBA_exception_free (&ev); + } + + bonobo_object_release_unref (window->details->throbber, NULL); + window->details->throbber = CORBA_OBJECT_NIL; } EEL_CALL_PARENT (GTK_WIDGET_CLASS, unrealize, (widget)); @@ -1720,10 +1717,9 @@ nautilus_window_allow_stop (NautilusWindow *window, gboolean allow) nautilus_bonobo_set_sensitive (window->details->shell_ui, NAUTILUS_COMMAND_STOP, allow); - if (window->throbber != CORBA_OBJECT_NIL) { + if (window->details->throbber != CORBA_OBJECT_NIL) { CORBA_exception_init (&ev); - property_bag = Bonobo_Control_getProperties (window->throbber, &ev); - + property_bag = Bonobo_Control_getProperties (window->details->throbber, &ev); if (!BONOBO_EX (&ev) && property_bag != CORBA_OBJECT_NIL) { bonobo_pbclient_set_boolean (property_bag, "throbbing", allow, &ev); bonobo_object_release_unref (property_bag, NULL); diff --git a/src/nautilus-window.h b/src/nautilus-window.h index fd49f4b7f..d487c25ed 100644 --- a/src/nautilus-window.h +++ b/src/nautilus-window.h @@ -98,7 +98,6 @@ struct NautilusWindow { /* Widgets to keep track of (for state changes, etc) */ GtkWidget *zoom_control; - Bonobo_Unknown throbber; /* Pending changes */ NautilusViewFrame *new_content_view; |