aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-module.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-09-20 00:52:08 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-09-20 00:52:08 +0800
commit3e3c13b439668945241b32cf8c1fd3d6e625f9f5 (patch)
treee04d52d21a23f84155cceebf3fa9a56b3eea47d3 /shell/e-shell-module.c
parent0c27b4ab1b75a29a0ea2b2c6ae3a568663179bdf (diff)
downloadgsoc2013-evolution-3e3c13b439668945241b32cf8c1fd3d6e625f9f5.tar.gz
gsoc2013-evolution-3e3c13b439668945241b32cf8c1fd3d6e625f9f5.tar.zst
gsoc2013-evolution-3e3c13b439668945241b32cf8c1fd3d6e625f9f5.zip
Replace EActivityHandler with a new activity-tracking system that uses
EActivity objects instead of numeric handler IDs. Create an EActivity, configure it, and (optionally) connect to its "cancelled" and "completed" signals. Then hand it to the shell view via e_shell_view_add_activity(). When finished with the activity, call e_activity_finish() and unref it. svn path=/branches/kill-bonobo/; revision=36391
Diffstat (limited to 'shell/e-shell-module.c')
-rw-r--r--shell/e-shell-module.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/shell/e-shell-module.c b/shell/e-shell-module.c
index 373a78564d..1fdee61426 100644
--- a/shell/e-shell-module.c
+++ b/shell/e-shell-module.c
@@ -57,7 +57,13 @@ enum {
PROP_SHELL
};
+enum {
+ ACTIVITY_ADDED,
+ LAST_SIGNAL
+};
+
static gpointer parent_class;
+static guint signals[LAST_SIGNAL];
static void
shell_module_set_filename (EShellModule *shell_module,
@@ -245,6 +251,22 @@ shell_module_class_init (EShellModuleClass *class)
E_TYPE_SHELL,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
+
+ /**
+ * EShellModule::activity-added
+ * @shell_module: the #EShellModule that emitted the signal
+ * @activity: an #EActivity
+ *
+ * Broadcasts a newly added activity.
+ **/
+ signals[ACTIVITY_ADDED] = g_signal_new (
+ "activity-added",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ E_TYPE_ACTIVITY);
}
static void
@@ -405,6 +427,23 @@ e_shell_module_get_shell (EShellModule *shell_module)
return shell_module->priv->shell;
}
+/**
+ * e_shell_module_add_activity:
+ * @shell_module: an #EShellModule
+ * @activity: an #EActivity
+ *
+ * Emits an #EShellModule::activity-added signal.
+ **/
+void
+e_shell_module_add_activity (EShellModule *shell_module,
+ EActivity *activity)
+{
+ g_return_if_fail (E_IS_SHELL_MODULE (shell_module));
+ g_return_if_fail (E_IS_ACTIVITY (activity));
+
+ g_signal_emit (shell_module, signals[ACTIVITY_ADDED], 0, activity);
+}
+
gboolean
e_shell_module_is_busy (EShellModule *shell_module)
{