aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-activity-handler.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-06-28 10:22:40 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-06-28 10:22:40 +0800
commit764cfb5a6ba195958b1b3b814fdb584d6a5ff63b (patch)
tree1c49f5dca5a940c4a4715ba055738da25d64498b /shell/e-activity-handler.c
parentad31ac2c9e472dd03e537b7bc3008cd9c54842e8 (diff)
downloadgsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar
gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar.gz
gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar.bz2
gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar.lz
gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar.xz
gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar.zst
gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.zip
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
Diffstat (limited to 'shell/e-activity-handler.c')
-rw-r--r--shell/e-activity-handler.c56
1 files changed, 55 insertions, 1 deletions
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 <gtk/gtksignal.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <libgnome/gnome-i18n.h>
+
#include <gal/util/e-util.h>
+#include <gal/widgets/e-popup-menu.h>
#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 ();