aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/modules/e-cal-shell-view-taskpad.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-10-29 01:30:32 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-10-29 01:30:32 +0800
commit5e82bdba14fba81603f3879a46b46a011db7d2e4 (patch)
tree0a4a475e33b4fbdf4a96249afa777b82903843f6 /calendar/modules/e-cal-shell-view-taskpad.c
parent17e030e2022b2343c795b7fd524ba9451ca71e9f (diff)
downloadgsoc2013-evolution-5e82bdba14fba81603f3879a46b46a011db7d2e4.tar
gsoc2013-evolution-5e82bdba14fba81603f3879a46b46a011db7d2e4.tar.gz
gsoc2013-evolution-5e82bdba14fba81603f3879a46b46a011db7d2e4.tar.bz2
gsoc2013-evolution-5e82bdba14fba81603f3879a46b46a011db7d2e4.tar.lz
gsoc2013-evolution-5e82bdba14fba81603f3879a46b46a011db7d2e4.tar.xz
gsoc2013-evolution-5e82bdba14fba81603f3879a46b46a011db7d2e4.tar.zst
gsoc2013-evolution-5e82bdba14fba81603f3879a46b46a011db7d2e4.zip
Wire up status messages to include percentages if available.
svn path=/branches/kill-bonobo/; revision=36692
Diffstat (limited to 'calendar/modules/e-cal-shell-view-taskpad.c')
-rw-r--r--calendar/modules/e-cal-shell-view-taskpad.c44
1 files changed, 40 insertions, 4 deletions
diff --git a/calendar/modules/e-cal-shell-view-taskpad.c b/calendar/modules/e-cal-shell-view-taskpad.c
index e2cc9d9a52..aa3a73cbab 100644
--- a/calendar/modules/e-cal-shell-view-taskpad.c
+++ b/calendar/modules/e-cal-shell-view-taskpad.c
@@ -91,15 +91,15 @@ action_calendar_taskpad_delete_cb (GtkAction *action,
{
ECalShellContent *cal_shell_content;
ECalendarTable *task_table;
- const gchar *status_message;
cal_shell_content = cal_shell_view->priv->cal_shell_content;
task_table = e_cal_shell_content_get_task_table (cal_shell_content);
- status_message = _("Deleting selected tasks...");
- e_cal_shell_view_set_status_message (cal_shell_view, status_message);
+ e_cal_shell_view_taskpad_set_status_message (
+ cal_shell_view, _("Deleting selected tasks..."), -1.0);
e_calendar_table_delete_selected (task_table);
- e_cal_shell_view_set_status_message (cal_shell_view, NULL);
+ e_cal_shell_view_taskpad_set_status_message (
+ cal_shell_view, NULL, -1.0);
}
static void
@@ -598,3 +598,39 @@ e_cal_shell_view_taskpad_open_task (ECalShellView *cal_shell_view,
exit:
gtk_window_present (GTK_WINDOW (editor));
}
+
+void
+e_cal_shell_view_taskpad_set_status_message (ECalShellView *cal_shell_view,
+ const gchar *status_message,
+ gdouble percent)
+{
+ EActivity *activity;
+ EShellView *shell_view;
+ EShellModule *shell_module;
+
+ g_return_if_fail (E_IS_CAL_SHELL_VIEW (cal_shell_view));
+
+ shell_view = E_SHELL_VIEW (cal_shell_view);
+ shell_module = e_shell_view_get_shell_module (shell_view);
+
+ activity = cal_shell_view->priv->taskpad_activity;
+
+ if (status_message == NULL || *status_message == '\0') {
+ if (activity != NULL) {
+ e_activity_complete (activity);
+ g_object_unref (activity);
+ activity = NULL;
+ }
+
+ } else if (activity == NULL) {
+ activity = e_activity_new (status_message);
+ e_activity_set_percent (activity, percent);
+ e_shell_module_add_activity (shell_module, activity);
+
+ } else {
+ e_activity_set_percent (activity, percent);
+ e_activity_set_primary_text (activity, status_message);
+ }
+
+ cal_shell_view->priv->taskpad_activity = activity;
+}