diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-10-22 04:21:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-23 02:21:22 +0800 |
commit | c881b5bc5e61d04b18d4ab46ad70533e7340d15b (patch) | |
tree | e70a3ed0d2f93dacfe20d856de4d29578beb2e50 /e-util/e-activity.h | |
parent | f0714755e2fa8b06425907c2cf189abd3a1b7119 (diff) | |
download | gsoc2013-evolution-c881b5bc5e61d04b18d4ab46ad70533e7340d15b.tar.gz gsoc2013-evolution-c881b5bc5e61d04b18d4ab46ad70533e7340d15b.tar.zst gsoc2013-evolution-c881b5bc5e61d04b18d4ab46ad70533e7340d15b.zip |
Simplify EActivity.
With unintrusive error dialogs gone, we can cut some unnecessary bits
out of EActivity.
I'm also adding a new enum property called "state", which is one of:
E_ACTIVITY_RUNNING
E_ACTIVITY_WAITING
E_ACTIVITY_CANCELLED
E_ACTIVITY_COMPLETED
The state of an activity must be explicitly changed. In particular,
when the user cancels an activity the state should be set only after
confirming the operation has been cancelled and not when cancellation
is requested (e.g. after receiving a G_IO_ERROR_CANCELLED, not when
the GCancellable emits "cancelled"). EActivityBar and EActivityProxy
widgets have been updated to make this distinction clearer in the UI.
E_ACTIVITY_WAITING will be used when activities have to be queued and
dispatched in sequence, which I haven't written yet.
Diffstat (limited to 'e-util/e-activity.h')
-rw-r--r-- | e-util/e-activity.h | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/e-util/e-activity.h b/e-util/e-activity.h index 4573fada57..63195b770a 100644 --- a/e-util/e-activity.h +++ b/e-util/e-activity.h @@ -23,6 +23,7 @@ #define E_ACTIVITY_H #include <gtk/gtk.h> +#include <e-util/e-util-enums.h> /* Standard GObject macros */ #define E_TYPE_ACTIVITY \ @@ -57,10 +58,7 @@ struct _EActivity { struct _EActivityClass { GObjectClass parent_class; - /* Signals */ - void (*cancelled) (EActivity *activity); - void (*completed) (EActivity *activity); - void (*clicked) (EActivity *activity); + /* Methods */ gchar * (*describe) (EActivity *activity); }; @@ -68,28 +66,22 @@ GType e_activity_get_type (void); EActivity * e_activity_new (void); EActivity * e_activity_newv (const gchar *format, ...) G_GNUC_PRINTF (1, 2); -void e_activity_complete (EActivity *activity); -void e_activity_clicked (EActivity *activity); gchar * e_activity_describe (EActivity *activity); -gboolean e_activity_is_completed (EActivity *activity); GCancellable * e_activity_get_cancellable (EActivity *activity); void e_activity_set_cancellable (EActivity *activity, GCancellable *cancellable); -gboolean e_activity_get_clickable (EActivity *activity); -void e_activity_set_clickable (EActivity *activity, - gboolean clickable); const gchar * e_activity_get_icon_name (EActivity *activity); void e_activity_set_icon_name (EActivity *activity, const gchar *icon_name); gdouble e_activity_get_percent (EActivity *activity); void e_activity_set_percent (EActivity *activity, gdouble percent); -const gchar * e_activity_get_primary_text (EActivity *activity); -void e_activity_set_primary_text (EActivity *activity, - const gchar *primary_text); -const gchar * e_activity_get_secondary_text (EActivity *activity); -void e_activity_set_secondary_text (EActivity *activity, - const gchar *secondary_text); +EActivityState e_activity_get_state (EActivity *activity); +void e_activity_set_state (EActivity *activity, + EActivityState state); +const gchar * e_activity_get_text (EActivity *activity); +void e_activity_set_text (EActivity *activity, + const gchar *text); G_END_DECLS |