aboutsummaryrefslogtreecommitdiffstats
path: root/shell/test
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/test
parent0c27b4ab1b75a29a0ea2b2c6ae3a568663179bdf (diff)
downloadgsoc2013-evolution-3e3c13b439668945241b32cf8c1fd3d6e625f9f5.tar
gsoc2013-evolution-3e3c13b439668945241b32cf8c1fd3d6e625f9f5.tar.gz
gsoc2013-evolution-3e3c13b439668945241b32cf8c1fd3d6e625f9f5.tar.bz2
gsoc2013-evolution-3e3c13b439668945241b32cf8c1fd3d6e625f9f5.tar.lz
gsoc2013-evolution-3e3c13b439668945241b32cf8c1fd3d6e625f9f5.tar.xz
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/test')
-rw-r--r--shell/test/e-test-shell-view.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/shell/test/e-test-shell-view.c b/shell/test/e-test-shell-view.c
index d9d627acbd..b0f38007c6 100644
--- a/shell/test/e-test-shell-view.c
+++ b/shell/test/e-test-shell-view.c
@@ -28,7 +28,7 @@
((obj), E_TYPE_TEST_SHELL_VIEW, ETestShellViewPrivate))
struct _ETestShellViewPrivate {
- gint dummy;
+ EActivity *activity;
};
GType e_test_shell_view_type = 0;
@@ -46,16 +46,37 @@ test_shell_view_changed (EShellView *shell_view)
}
static void
+test_shell_view_dispose (GObject *object)
+{
+ ETestShellViewPrivate *priv;
+
+ priv = E_TEST_SHELL_VIEW_GET_PRIVATE (object);
+
+ if (priv->activity != NULL) {
+ e_activity_complete (priv->activity);
+ g_object_unref (priv->activity);
+ priv->activity = NULL;
+ }
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
test_shell_view_constructed (GObject *object)
{
+ ETestShellViewPrivate *priv;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
EShellView *shell_view;
+ EActivity *activity;
GtkWidget *widget;
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (parent_class)->constructed (object);
+ priv = E_TEST_SHELL_VIEW_GET_PRIVATE (object);
+
shell_view = E_SHELL_VIEW (object);
shell_content = e_shell_view_get_shell_content (shell_view);
shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
@@ -67,6 +88,11 @@ test_shell_view_constructed (GObject *object)
widget = gtk_label_new ("Sidebar Widget");
gtk_container_add (GTK_CONTAINER (shell_sidebar), widget);
gtk_widget_show (widget);
+
+ activity = e_activity_new ("Test Activity");
+ e_activity_set_cancellable (activity, TRUE);
+ e_shell_view_add_activity (shell_view, activity);
+ priv->activity = activity;
}
static void
@@ -80,6 +106,7 @@ test_shell_view_class_init (ETestShellViewClass *class,
g_type_class_add_private (class, sizeof (ETestShellViewPrivate));
object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = test_shell_view_dispose;
object_class->constructed = test_shell_view_constructed;
shell_view_class = E_SHELL_VIEW_CLASS (class);