diff options
Diffstat (limited to 'executive-summary/component/e-summary-url.c')
-rw-r--r-- | executive-summary/component/e-summary-url.c | 50 |
1 files changed, 45 insertions, 5 deletions
diff --git a/executive-summary/component/e-summary-url.c b/executive-summary/component/e-summary-url.c index 2c405b8664..cdc68091cd 100644 --- a/executive-summary/component/e-summary-url.c +++ b/executive-summary/component/e-summary-url.c @@ -25,8 +25,16 @@ #include <config.h> #endif -#include <gnome.h> -#include <bonobo.h> +#include <bonobo/bonobo-property-control.h> +#include <bonobo/bonobo-event-source.h> +#include <bonobo/bonobo-widget.h> + +#include <libgnome/gnome-i18n.h> +#include <libgnome/gnome-url.h> +#include <libgnome/gnome-exec.h> +#include <libgnomeui/gnome-propertybox.h> + +#include <stdlib.h> #include <gtkhtml/gtkhtml.h> #include <gtkhtml/gtkhtml-stream.h> @@ -430,6 +438,23 @@ dialog_destroyed (GtkObject *object, g_free (dialog); } +struct _idle_data { + ESummary *esummary; + ESummaryWindow *window; +}; + +static gboolean +idle_remove_window (gpointer data) +{ + struct _idle_data *id = data; + + e_summary_remove_window (id->esummary, id->window); + e_summary_queue_rebuild (id->esummary); + g_free (id); + + return FALSE; +} + void e_summary_url_click (GtkWidget *widget, const char *url, @@ -439,6 +464,7 @@ e_summary_url_click (GtkWidget *widget, char *parsed; int address; ESummaryWindow *window; + struct _idle_data *id; Bonobo_Control control; Bonobo_Listener corba_listener; GtkWidget *prefsbox, *control_widget; @@ -473,8 +499,15 @@ e_summary_url_click (GtkWidget *widget, if (window->iid == NULL) break; - e_summary_remove_window (esummary, window); - e_summary_queue_rebuild (esummary); + id = g_new (struct _idle_data, 1); + id->window = window; + id->esummary = esummary; + + /* Close the window on an idle to work around a bug in + gnome-vfs which locks the e_summary_remove_window function + and as gtkhtml has a pointer grab on, this locks the whole + display. GAH! */ + g_idle_add (idle_remove_window, id); break; case PROTOCOL_CONFIGURE: @@ -565,8 +598,15 @@ e_summary_url_click (GtkWidget *widget, e_summary_queue_rebuild (esummary); break; - case PROTOCOL_NONE: case PROTOCOL_OTHER: + /* Pass it to the parent component */ + CORBA_exception_init (&ev); + GNOME_Evolution_Summary_HTMLView_handleURI (window->html, + url, &ev); + CORBA_exception_free (&ev); + break; + + case PROTOCOL_NONE: case PROTOCOL_HTTP: case PROTOCOL_FILE: default: |