diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-03-10 09:06:18 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-03-10 09:06:18 +0800 |
commit | 7a92d9cc82b7775a0f5cb1fde233119d435a79b6 (patch) | |
tree | 0bf446e28f6068a36dc3164725d3c37b05db4f6c /widgets/misc/e-activity.c | |
parent | f963cc39a7d21f64f578dae50fd08c44181a3bf6 (diff) | |
download | gsoc2013-evolution-7a92d9cc82b7775a0f5cb1fde233119d435a79b6.tar gsoc2013-evolution-7a92d9cc82b7775a0f5cb1fde233119d435a79b6.tar.gz gsoc2013-evolution-7a92d9cc82b7775a0f5cb1fde233119d435a79b6.tar.bz2 gsoc2013-evolution-7a92d9cc82b7775a0f5cb1fde233119d435a79b6.tar.lz gsoc2013-evolution-7a92d9cc82b7775a0f5cb1fde233119d435a79b6.tar.xz gsoc2013-evolution-7a92d9cc82b7775a0f5cb1fde233119d435a79b6.tar.zst gsoc2013-evolution-7a92d9cc82b7775a0f5cb1fde233119d435a79b6.zip |
Add e_lookup_action() and e_lookup_action_group() to e-util, so
I don't have to keep writing the algorithm over and over again.
Add EFileActivity, which provides a GCancellable for GIO operations.
Cancelling the activity cancels the GIO operation, and vice versa.
Also provides a handy GFileProgressCallback function which updates
the activity's "percent" property.
svn path=/branches/kill-bonobo/; revision=37396
Diffstat (limited to 'widgets/misc/e-activity.c')
-rw-r--r-- | widgets/misc/e-activity.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/widgets/misc/e-activity.c b/widgets/misc/e-activity.c index 40ee0df35a..352300f023 100644 --- a/widgets/misc/e-activity.c +++ b/widgets/misc/e-activity.c @@ -33,8 +33,8 @@ struct _EActivityPrivate { gchar *secondary_text; gdouble percent; + guint allow_cancel : 1; guint blocking : 1; - guint cancellable : 1; guint cancelled : 1; guint clickable : 1; guint completed : 1; @@ -42,8 +42,8 @@ struct _EActivityPrivate { enum { PROP_0, + PROP_ALLOW_CANCEL, PROP_BLOCKING, - PROP_CANCELLABLE, PROP_CLICKABLE, PROP_ICON_NAME, PROP_PERCENT, @@ -68,14 +68,14 @@ activity_set_property (GObject *object, GParamSpec *pspec) { switch (property_id) { - case PROP_BLOCKING: - e_activity_set_blocking ( + case PROP_ALLOW_CANCEL: + e_activity_set_allow_cancel ( E_ACTIVITY (object), g_value_get_boolean (value)); return; - case PROP_CANCELLABLE: - e_activity_set_cancellable ( + case PROP_BLOCKING: + e_activity_set_blocking ( E_ACTIVITY (object), g_value_get_boolean (value)); return; @@ -121,15 +121,15 @@ activity_get_property (GObject *object, GParamSpec *pspec) { switch (property_id) { - case PROP_BLOCKING: + case PROP_ALLOW_CANCEL: g_value_set_boolean ( - value, e_activity_get_blocking ( + value, e_activity_get_allow_cancel ( E_ACTIVITY (object))); return; - case PROP_CANCELLABLE: + case PROP_BLOCKING: g_value_set_boolean ( - value, e_activity_get_cancellable ( + value, e_activity_get_blocking ( E_ACTIVITY (object))); return; @@ -256,23 +256,23 @@ activity_class_init (EActivityClass *class) g_object_class_install_property ( object_class, - PROP_BLOCKING, + PROP_ALLOW_CANCEL, g_param_spec_boolean ( - "blocking", + "allow-cancel", NULL, NULL, - TRUE, + FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property ( object_class, - PROP_CANCELLABLE, + PROP_BLOCKING, g_param_spec_boolean ( - "cancellable", + "blocking", NULL, NULL, - FALSE, + TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); @@ -405,7 +405,7 @@ void e_activity_cancel (EActivity *activity) { g_return_if_fail (E_IS_ACTIVITY (activity)); - g_return_if_fail (activity->priv->cancellable); + g_return_if_fail (activity->priv->allow_cancel); if (activity->priv->cancelled) return; @@ -468,41 +468,41 @@ e_activity_is_completed (EActivity *activity) } gboolean -e_activity_get_blocking (EActivity *activity) +e_activity_get_allow_cancel (EActivity *activity) { g_return_val_if_fail (E_IS_ACTIVITY (activity), FALSE); - return activity->priv->blocking; + return activity->priv->allow_cancel; } void -e_activity_set_blocking (EActivity *activity, - gboolean blocking) +e_activity_set_allow_cancel (EActivity *activity, + gboolean allow_cancel) { g_return_if_fail (E_IS_ACTIVITY (activity)); - activity->priv->blocking = blocking; + activity->priv->allow_cancel = allow_cancel; - g_object_notify (G_OBJECT (activity), "blocking"); + g_object_notify (G_OBJECT (activity), "allow-cancel"); } gboolean -e_activity_get_cancellable (EActivity *activity) +e_activity_get_blocking (EActivity *activity) { g_return_val_if_fail (E_IS_ACTIVITY (activity), FALSE); - return activity->priv->cancellable; + return activity->priv->blocking; } void -e_activity_set_cancellable (EActivity *activity, - gboolean cancellable) +e_activity_set_blocking (EActivity *activity, + gboolean blocking) { g_return_if_fail (E_IS_ACTIVITY (activity)); - activity->priv->cancellable = cancellable; + activity->priv->blocking = blocking; - g_object_notify (G_OBJECT (activity), "cancellable"); + g_object_notify (G_OBJECT (activity), "blocking"); } gboolean |