diff options
author | Alexander Larsson <alexl@redhat.com> | 2002-11-04 14:59:53 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2002-11-04 14:59:53 +0000 |
commit | f094a7de87e8615517144e85f08ba8e444ee3260 (patch) | |
tree | 144e78b55c0fb70ef92c067ed0a5c97536bd14f8 | |
parent | 6dd6ce69c3085471a7a2c9e0b93ccdfe7d883970 (diff) | |
download | nautilus-f094a7de87e8615517144e85f08ba8e444ee3260.tar.gz |
Remove click-on-throbber. Patch by Jan Arne Petersen
2002-11-04 Alexander Larsson <alexl@redhat.com>
* components/throbber/nautilus-throbber.c: (get_bonobo_properties),
(nautilus_throbber_instance_init), (nautilus_throbber_expose),
(nautilus_throbber_class_init),
(nautilus_throbber_accessible_get_type):
* src/nautilus-window-private.h:
* src/nautilus-window-toolbars.c: (throbber_created_callback):
* src/nautilus-window.c: (nautilus_window_unrealize):
Remove click-on-throbber. Patch by Jan Arne Petersen <jpetersen@gnome-de.org>
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | components/throbber/nautilus-throbber.c | 221 | ||||
-rw-r--r-- | src/nautilus-navigation-window.c | 5 | ||||
-rw-r--r-- | src/nautilus-object-window.c | 5 | ||||
-rw-r--r-- | src/nautilus-spatial-window.c | 5 | ||||
-rw-r--r-- | src/nautilus-window-private.h | 1 | ||||
-rw-r--r-- | src/nautilus-window-toolbars.c | 47 | ||||
-rw-r--r-- | src/nautilus-window.c | 5 |
8 files changed, 13 insertions, 288 deletions
@@ -1,3 +1,15 @@ +2002-11-04 Alexander Larsson <alexl@redhat.com> + + * components/throbber/nautilus-throbber.c: (get_bonobo_properties), + (nautilus_throbber_instance_init), (nautilus_throbber_expose), + (nautilus_throbber_class_init), + (nautilus_throbber_accessible_get_type): + * src/nautilus-window-private.h: + * src/nautilus-window-toolbars.c: (throbber_created_callback): + * src/nautilus-window.c: (nautilus_window_unrealize): + + Remove click-on-throbber. Patch by Jan Arne Petersen <jpetersen@gnome-de.org> + === nautilus 2.1.2 === 2002-10-31 Dave Camp <dave@ximian.com> diff --git a/components/throbber/nautilus-throbber.c b/components/throbber/nautilus-throbber.c index a93ddfe6c..c0834cc30 100644 --- a/components/throbber/nautilus-throbber.c +++ b/components/throbber/nautilus-throbber.c @@ -63,9 +63,6 @@ struct NautilusThrobberDetails { gboolean ready; gboolean small_mode; - - gboolean button_in; - gboolean button_down; }; @@ -111,18 +108,6 @@ get_bonobo_properties (BonoboPropertyBag *bag, break; } - case LOCATION: - { - char *location = nautilus_theme_get_theme_data ("throbber", "url"); - if (location != NULL) { - BONOBO_ARG_SET_STRING (arg, location); - g_free (location); - } else { - BONOBO_ARG_SET_STRING (arg, ""); - } - - } - default: g_warning ("Unhandled arg %d", arg_id); break; @@ -246,8 +231,6 @@ nautilus_throbber_instance_init (NautilusThrobber *throbber) bonobo_property_bag_add (throbber->details->property_bag, "throbbing", THROBBING, BONOBO_ARG_BOOLEAN, NULL, "Throbber active", 0); - bonobo_property_bag_add (throbber->details->property_bag, "location", LOCATION, BONOBO_ARG_STRING, NULL, - "associated URL", 0); bonobo_property_bag_add (throbber->details->property_bag, "style", STYLE, BONOBO_ARG_INT, NULL, NULL, Bonobo_PROPERTY_WRITEABLE); nautilus_throbber_load_images (throbber); @@ -298,7 +281,7 @@ static int nautilus_throbber_expose (GtkWidget *widget, GdkEventExpose *event) { NautilusThrobber *throbber; - GdkPixbuf *pixbuf, *massaged_pixbuf; + GdkPixbuf *pixbuf; int x_offset, y_offset, width, height; GdkRectangle pix_area, dest; @@ -314,17 +297,6 @@ nautilus_throbber_expose (GtkWidget *widget, GdkEventExpose *event) return FALSE; } - /* Get the right tint on the image */ - if (throbber->details->button_in) { - if (throbber->details->button_down) { - massaged_pixbuf = eel_create_darkened_pixbuf (pixbuf, 0.8 * 255, 0.8 * 255); - } else { - massaged_pixbuf = eel_create_spotlight_pixbuf (pixbuf); - } - g_object_unref (pixbuf); - pixbuf = massaged_pixbuf; - } - width = gdk_pixbuf_get_width (pixbuf); height = gdk_pixbuf_get_height (pixbuf); @@ -535,97 +507,6 @@ nautilus_throbber_load_images (NautilusThrobber *throbber) g_free (image_theme); } -static gboolean -nautilus_throbber_enter_notify_event (GtkWidget *widget, GdkEventCrossing *event) -{ - NautilusThrobber *throbber; - - throbber = NAUTILUS_THROBBER (widget); - - if (!throbber->details->button_in) { - throbber->details->button_in = TRUE; - gtk_widget_queue_draw (widget); - } - - return GNOME_CALL_PARENT_WITH_DEFAULT - (GTK_WIDGET_CLASS, enter_notify_event, (widget, event), FALSE); -} - -static gboolean -nautilus_throbber_leave_notify_event (GtkWidget *widget, GdkEventCrossing *event) -{ - NautilusThrobber *throbber; - - throbber = NAUTILUS_THROBBER (widget); - - if (throbber->details->button_in) { - throbber->details->button_in = FALSE; - gtk_widget_queue_draw (widget); - } - - return GNOME_CALL_PARENT_WITH_DEFAULT - (GTK_WIDGET_CLASS, leave_notify_event, (widget, event), FALSE); -} - -/* handle button presses by posting a change on the "location" property */ - -static gboolean -nautilus_throbber_button_press_event (GtkWidget *widget, GdkEventButton *event) -{ - NautilusThrobber *throbber; - - throbber = NAUTILUS_THROBBER (widget); - - if (event->button == 1) { - throbber->details->button_down = TRUE; - throbber->details->button_in = TRUE; - gtk_widget_queue_draw (widget); - return TRUE; - } - - return GNOME_CALL_PARENT_WITH_DEFAULT - (GTK_WIDGET_CLASS, button_press_event, (widget, event), FALSE); -} - -static void -nautilus_throbber_set_location (NautilusThrobber *throbber) -{ - char *location; - BonoboArg *location_arg; - - location = nautilus_theme_get_theme_data ("throbber", "url"); - if (location != NULL) { - location_arg = bonobo_arg_new (BONOBO_ARG_STRING); - BONOBO_ARG_SET_STRING (location_arg, location); - bonobo_event_source_notify_listeners_full ( - throbber->details->property_bag->es, - "Bonobo/Property", "change", "location", - location_arg, NULL); - bonobo_arg_release (location_arg); - g_free (location); - } -} - -static gboolean -nautilus_throbber_button_release_event (GtkWidget *widget, GdkEventButton *event) -{ - NautilusThrobber *throbber; - - throbber = NAUTILUS_THROBBER (widget); - - if (event->button == 1) { - if (throbber->details->button_in) { - nautilus_throbber_set_location (throbber); - } - throbber->details->button_down = FALSE; - gtk_widget_queue_draw (widget); - return TRUE; - } - - return GNOME_CALL_PARENT_WITH_DEFAULT - (GTK_WIDGET_CLASS, button_release_event, (widget, event), FALSE); -} - void nautilus_throbber_set_small_mode (NautilusThrobber *throbber, gboolean new_mode) { @@ -684,10 +565,6 @@ nautilus_throbber_class_init (NautilusThrobberClass *class) G_OBJECT_CLASS (class)->finalize = nautilus_throbber_finalize; widget_class->expose_event = nautilus_throbber_expose; - widget_class->button_press_event = nautilus_throbber_button_press_event; - widget_class->button_release_event = nautilus_throbber_button_release_event; - widget_class->enter_notify_event = nautilus_throbber_enter_notify_event; - widget_class->leave_notify_event = nautilus_throbber_leave_notify_event; widget_class->size_request = nautilus_throbber_size_request; widget_class->map = nautilus_throbber_map; widget_class->get_accessible = nautilus_throbber_get_accessible; @@ -735,94 +612,6 @@ nautilus_throbber_accessible_image_interface_init (AtkImageIface *iface) iface->get_image_size = nautilus_throbber_accessible_image_get_size; } -/* AtkAction interface */ - -enum { - ACTION_ACTIVATE, - LAST_ACTION -}; - -static const char *nautilus_throbber_accessible_action_names[] = { - "activate", - NULL -}; - -static const char *nautilus_throbber_accessible_action_descriptions[] = { - "Activate selected items", - NULL -}; - - -static gboolean -nautilus_throbber_accessible_do_action (AtkAction *accessible, int i) -{ - GtkWidget *widget; - - g_return_val_if_fail (i < LAST_ACTION, FALSE); - - widget = GTK_ACCESSIBLE (accessible)->widget; - if (!widget) { - return FALSE; - } - - switch (i) { - case ACTION_ACTIVATE : - nautilus_throbber_set_location (NAUTILUS_THROBBER (widget)); - return TRUE; - default: - return FALSE; - } -} - -static int -nautilus_throbber_accessible_get_n_actions (AtkAction *accessible) -{ - return LAST_ACTION; -} - -static const char * -nautilus_throbber_accessible_action_get_description (AtkAction *accessible, - int i) -{ - g_return_val_if_fail (i < LAST_ACTION, NULL); - - return nautilus_throbber_accessible_action_descriptions[i]; -} - -static const char * -nautilus_throbber_accessible_action_get_name (AtkAction *accessible, int i) -{ - g_return_val_if_fail (i < LAST_ACTION, NULL); - - return nautilus_throbber_accessible_action_names [i]; -} - -static const char * -nautilus_throbber_accessible_action_get_keybinding (AtkAction *accessible, - int i) -{ - return NULL; -} - -static gboolean -nautilus_throbber_accessible_action_set_description (AtkAction *accessible, - int i, - const char *description) -{ - return FALSE; -} - -static void -nautilus_throbber_accessible_action_interface_init (AtkActionIface *iface) -{ - iface->do_action = nautilus_throbber_accessible_do_action; - iface->get_n_actions = nautilus_throbber_accessible_get_n_actions; - iface->get_description = nautilus_throbber_accessible_action_get_description; - iface->get_name = nautilus_throbber_accessible_action_get_name; - iface->get_keybinding = nautilus_throbber_accessible_action_get_keybinding; - iface->set_description = nautilus_throbber_accessible_action_set_description; -} - static GType nautilus_throbber_accessible_get_type (void) { @@ -831,12 +620,6 @@ nautilus_throbber_accessible_get_type (void) /* Action interface Name etc. ... */ if (!type) { - static GInterfaceInfo atk_action_info = { - (GInterfaceInitFunc) nautilus_throbber_accessible_action_interface_init, - (GInterfaceFinalizeFunc) NULL, - NULL - }; - static const GInterfaceInfo atk_image_info = { (GInterfaceInitFunc) nautilus_throbber_accessible_image_interface_init, (GInterfaceFinalizeFunc) NULL, @@ -848,8 +631,6 @@ nautilus_throbber_accessible_get_type (void) GTK_TYPE_IMAGE, nautilus_throbber_accessible_class_init); - g_type_add_interface_static (type, ATK_TYPE_ACTION, - &atk_action_info); g_type_add_interface_static (type, ATK_TYPE_IMAGE, &atk_image_info); } diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c index 61841798b..4eb08d389 100644 --- a/src/nautilus-navigation-window.c +++ b/src/nautilus-navigation-window.c @@ -898,11 +898,6 @@ nautilus_window_unrealize (GtkWidget *widget) window->details->throbber_property_bag = CORBA_OBJECT_NIL; } - if (window->details->throbber_listener != CORBA_OBJECT_NIL) { - CORBA_Object_release (window->details->throbber_listener, NULL); - window->details->throbber_listener = CORBA_OBJECT_NIL; - } - GTK_WIDGET_CLASS (parent_class)->unrealize (widget); } diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c index 61841798b..4eb08d389 100644 --- a/src/nautilus-object-window.c +++ b/src/nautilus-object-window.c @@ -898,11 +898,6 @@ nautilus_window_unrealize (GtkWidget *widget) window->details->throbber_property_bag = CORBA_OBJECT_NIL; } - if (window->details->throbber_listener != CORBA_OBJECT_NIL) { - CORBA_Object_release (window->details->throbber_listener, NULL); - window->details->throbber_listener = CORBA_OBJECT_NIL; - } - GTK_WIDGET_CLASS (parent_class)->unrealize (widget); } diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c index 61841798b..4eb08d389 100644 --- a/src/nautilus-spatial-window.c +++ b/src/nautilus-spatial-window.c @@ -898,11 +898,6 @@ nautilus_window_unrealize (GtkWidget *widget) window->details->throbber_property_bag = CORBA_OBJECT_NIL; } - if (window->details->throbber_listener != CORBA_OBJECT_NIL) { - CORBA_Object_release (window->details->throbber_listener, NULL); - window->details->throbber_listener = CORBA_OBJECT_NIL; - } - GTK_WIDGET_CLASS (parent_class)->unrealize (widget); } diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h index 328ea89e2..5e1803c62 100644 --- a/src/nautilus-window-private.h +++ b/src/nautilus-window-private.h @@ -87,7 +87,6 @@ struct NautilusWindowDetails gboolean throbber_active; gboolean throbber_activating; Bonobo_PropertyBag throbber_property_bag; - 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 542ea59cd..a3a87015c 100644 --- a/src/nautilus-window-toolbars.c +++ b/src/nautilus-window-toolbars.c @@ -289,47 +289,6 @@ create_back_or_forward_toolbar_item (NautilusWindow *window, return item; } -static gboolean -location_change_at_idle_callback (gpointer callback_data) -{ - NautilusWindow *window; - char *location; - - window = NAUTILUS_WINDOW (callback_data); - - location = window->details->location_to_change_to_at_idle; - window->details->location_to_change_to_at_idle = NULL; - window->details->location_change_at_idle_id = 0; - - nautilus_window_go_to (window, location); - g_free (location); - - return FALSE; -} - -/* 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_callback (BonoboListener *listener, - const char *event_name, - const CORBA_any *arg, - CORBA_Environment *ev, - gpointer callback_data) -{ - NautilusWindow *window; - - window = NAUTILUS_WINDOW (callback_data); - - g_free (window->details->location_to_change_to_at_idle); - window->details->location_to_change_to_at_idle = g_strdup ( - BONOBO_ARG_GET_STRING (arg)); - - if (window->details->location_change_at_idle_id == 0) { - window->details->location_change_at_idle_id = - gtk_idle_add (location_change_at_idle_callback, window); - } -} - static void throbber_set_throbbing (NautilusWindow *window, gboolean throbbing) @@ -382,12 +341,6 @@ throbber_created_callback (Bonobo_Unknown throbber, throbber_set_throbbing (window, window->details->throbber_active); } - window->details->throbber_listener = - bonobo_event_source_client_add_listener_full - (window->details->throbber_property_bag, - g_cclosure_new (G_CALLBACK (throbber_callback), window, NULL), - "Bonobo/Property:change:location", ev); - bonobo_object_release_unref (throbber, ev); g_object_unref (window); diff --git a/src/nautilus-window.c b/src/nautilus-window.c index 61841798b..4eb08d389 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -898,11 +898,6 @@ nautilus_window_unrealize (GtkWidget *widget) window->details->throbber_property_bag = CORBA_OBJECT_NIL; } - if (window->details->throbber_listener != CORBA_OBJECT_NIL) { - CORBA_Object_release (window->details->throbber_listener, NULL); - window->details->throbber_listener = CORBA_OBJECT_NIL; - } - GTK_WIDGET_CLASS (parent_class)->unrealize (widget); } |