From 764cfb5a6ba195958b1b3b814fdb584d6a5ff63b Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 28 Jun 2001 02:22:40 +0000 Subject: Added a URI schema registry to the shell, and changed the bootstrap sequence to get the schema lists from the components and register them into it. svn path=/trunk/; revision=10553 --- shell/e-activity-handler.c | 56 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) (limited to 'shell/e-activity-handler.c') diff --git a/shell/e-activity-handler.c b/shell/e-activity-handler.c index 32076f1f94..a7d42a361b 100644 --- a/shell/e-activity-handler.c +++ b/shell/e-activity-handler.c @@ -30,7 +30,10 @@ #include #include +#include + #include +#include #define PARENT_TYPE bonobo_x_object_get_type () @@ -134,7 +137,46 @@ lookup_activity (GList *list, } -/* ETaskWidget callbacks. */ +/* ETaskWidget actions. */ + +static void +task_widget_cancel_callback (GtkWidget *widget, + void *data) +{ + ActivityInfo *activity_info; + CORBA_Environment ev; + CORBA_any *null_value; + + CORBA_exception_init (&ev); + + activity_info = (ActivityInfo *) data; + + null_value = CORBA_any__alloc (); + null_value->_type = TC_null; + + Bonobo_Listener_event (activity_info->event_listener, "Cancelled", null_value, &ev); + if (ev._major != CORBA_NO_EXCEPTION) + g_warning ("EActivityHandler: Cannot report `Cancelled' event -- %s", + ev._repo_id); + + CORBA_free (null_value); + + CORBA_exception_free (&ev); +} + +static void +show_cancellation_popup (ActivityInfo *activity_info, + GtkWidget *task_widget, + GdkEventButton *button_event) +{ + GtkMenu *popup; + EPopupMenu items[] = { + { N_("Cancel"), NULL, task_widget_cancel_callback, NULL, 0 }, + { NULL } + }; + + popup = e_popup_menu_create (items, 0, 0, activity_info); +} static int task_widget_button_press_event_callback (GtkWidget *widget, @@ -147,6 +189,18 @@ task_widget_button_press_event_callback (GtkWidget *widget, activity_info = (ActivityInfo *) data; + if (button_event->button == 2) { + if (! activity_info->cancellable) { + return FALSE; + } else { + show_cancellation_popup (activity_info, widget, button_event); + return TRUE; + } + } + + if (button_event->button != 1) + return FALSE; + CORBA_exception_init (&ev); null_value = CORBA_any__alloc (); -- cgit v1.2.3