aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/gui/e-calendar-table.c58
-rw-r--r--calendar/gui/e-calendar-table.h3
-rw-r--r--calendar/gui/e-memo-table.c59
-rw-r--r--calendar/gui/e-memo-table.h3
-rw-r--r--calendar/modules/e-cal-shell-content.c2
-rw-r--r--calendar/modules/e-cal-shell-sidebar.c2
-rw-r--r--calendar/modules/e-cal-shell-view-memopad.c44
-rw-r--r--calendar/modules/e-cal-shell-view-private.c61
-rw-r--r--calendar/modules/e-cal-shell-view-private.h15
-rw-r--r--calendar/modules/e-cal-shell-view-taskpad.c44
-rw-r--r--calendar/modules/e-cal-shell-view.c1
-rw-r--r--calendar/modules/e-memo-shell-sidebar.c10
-rw-r--r--calendar/modules/e-memo-shell-sidebar.h3
-rw-r--r--calendar/modules/e-memo-shell-view-actions.c7
-rw-r--r--calendar/modules/e-memo-shell-view-private.c8
-rw-r--r--calendar/modules/e-memo-shell-view-private.h3
-rw-r--r--calendar/modules/e-task-shell-sidebar.c10
-rw-r--r--calendar/modules/e-task-shell-sidebar.h3
-rw-r--r--calendar/modules/e-task-shell-view-actions.c7
-rw-r--r--calendar/modules/e-task-shell-view-private.c8
-rw-r--r--calendar/modules/e-task-shell-view-private.h3
-rw-r--r--e-util/e-marshal.list1
22 files changed, 290 insertions, 65 deletions
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index eaf020bb27..4c029d46f3 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -108,27 +108,36 @@ static void
calendar_table_emit_open_component (ECalendarTable *cal_table,
ECalModelComponent *comp_data)
{
- g_signal_emit (cal_table, signals[OPEN_COMPONENT], 0, comp_data);
+ guint signal_id = signals[OPEN_COMPONENT];
+
+ g_signal_emit (cal_table, signal_id, 0, comp_data);
}
static void
calendar_table_emit_popup_event (ECalendarTable *cal_table,
GdkEvent *event)
{
- g_signal_emit (cal_table, signals[POPUP_EVENT], 0, event);
+ guint signal_id = signals[POPUP_EVENT];
+
+ g_signal_emit (cal_table, signal_id, 0, event);
}
static void
calendar_table_emit_status_message (ECalendarTable *cal_table,
- const gchar *message)
+ const gchar *message,
+ gdouble percent)
{
- g_signal_emit (cal_table, signals[STATUS_MESSAGE], 0, message);
+ guint signal_id = signals[STATUS_MESSAGE];
+
+ g_signal_emit (cal_table, signal_id, 0, message, percent);
}
static void
calendar_table_emit_user_created (ECalendarTable *cal_table)
{
- g_signal_emit (cal_table, signals[USER_CREATED], 0);
+ guint signal_id = signals[USER_CREATED];
+
+ g_signal_emit (cal_table, signal_id, 0);
}
static gint
@@ -235,6 +244,25 @@ calendar_table_double_click_cb (ECalendarTable *cal_table,
calendar_table_emit_open_component (cal_table, comp_data);
}
+static void
+calendar_table_model_cal_view_progress_cb (ECalendarTable *cal_table,
+ const gchar *message,
+ gint progress,
+ ECalSourceType type)
+{
+ gdouble percent = (gdouble) progress;
+
+ calendar_table_emit_status_message (cal_table, message, percent);
+}
+
+static void
+calendar_table_model_cal_view_done_cb (ECalendarTable *cal_table,
+ ECalendarStatus status,
+ ECalSourceType type)
+{
+ calendar_table_emit_status_message (cal_table, NULL, -1.0);
+}
+
static gboolean
calendar_table_query_tooltip_cb (ECalendarTable *cal_table,
gint x,
@@ -438,6 +466,7 @@ calendar_table_query_tooltip_cb (ECalendarTable *cal_table,
return TRUE;
}
+
static gboolean
calendar_table_popup_menu_cb (ECalendarTable *cal_table)
{
@@ -604,10 +633,21 @@ calendar_table_init (ECalendarTable *cal_table)
/* Create the model */
cal_table->model = (ECalModel *) e_cal_model_tasks_new ();
+
g_signal_connect_swapped (
cal_table->model, "row_appended",
G_CALLBACK (calendar_table_emit_user_created), cal_table);
+ g_signal_connect_swapped (
+ cal_table->model, "cal-view-progress",
+ G_CALLBACK (calendar_table_model_cal_view_progress_cb),
+ cal_table);
+
+ g_signal_connect_swapped (
+ cal_table->model, "cal-view-done",
+ G_CALLBACK (calendar_table_model_cal_view_done_cb),
+ cal_table);
+
/* Create the header columns */
extras = e_table_extras_new ();
@@ -980,7 +1020,7 @@ delete_selected_components (ECalendarTable *cal_table)
objs = e_calendar_table_get_selected (cal_table);
status_message = _("Deleting selected objects");
- calendar_table_emit_status_message (cal_table, status_message);
+ calendar_table_emit_status_message (cal_table, status_message, -1.0);
for (l = objs; l; l = l->next) {
ECalModelComponent *comp_data = (ECalModelComponent *) l->data;
@@ -992,7 +1032,7 @@ delete_selected_components (ECalendarTable *cal_table)
g_clear_error (&error);
}
- calendar_table_emit_status_message (cal_table, NULL);
+ calendar_table_emit_status_message (cal_table, NULL, -1.0);
g_slist_free (objs);
}
@@ -1274,7 +1314,7 @@ clipboard_get_calendar_data (ECalendarTable *cal_table, const gchar *text)
client = e_cal_model_get_default_client (cal_table->model);
status_message = _("Updating objects");
- calendar_table_emit_status_message (cal_table, _("Updating objects"));
+ calendar_table_emit_status_message (cal_table, status_message, -1.0);
if (kind == ICAL_VCALENDAR_COMPONENT) {
icalcomponent_kind child_kind;
@@ -1319,7 +1359,7 @@ clipboard_get_calendar_data (ECalendarTable *cal_table, const gchar *text)
g_object_unref (comp);
}
- calendar_table_emit_status_message (cal_table, NULL);
+ calendar_table_emit_status_message (cal_table, NULL, -1.0);
}
static void
diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h
index 2378f9dec9..edd9b2b53f 100644
--- a/calendar/gui/e-calendar-table.h
+++ b/calendar/gui/e-calendar-table.h
@@ -84,7 +84,8 @@ struct _ECalendarTableClass {
void (*popup_event) (ECalendarTable *cal_table,
GdkEvent *event);
void (*status_message) (ECalendarTable *cal_table,
- const gchar *message);
+ const gchar *message,
+ gdouble percent);
void (*user_created) (ECalendarTable *cal_table);
};
diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c
index 12aa2d9db2..b844030264 100644
--- a/calendar/gui/e-memo-table.c
+++ b/calendar/gui/e-memo-table.c
@@ -109,27 +109,36 @@ static void
memo_table_emit_open_component (EMemoTable *memo_table,
ECalModelComponent *comp_data)
{
- g_signal_emit (memo_table, signals[OPEN_COMPONENT], 0, comp_data);
+ guint signal_id = signals[OPEN_COMPONENT];
+
+ g_signal_emit (memo_table, signal_id, 0, comp_data);
}
static void
memo_table_emit_popup_event (EMemoTable *memo_table,
GdkEvent *event)
{
- g_signal_emit (memo_table, signals[POPUP_EVENT], 0, event);
+ guint signal_id = signals[POPUP_EVENT];
+
+ g_signal_emit (memo_table, signal_id, 0, event);
}
static void
memo_table_emit_status_message (EMemoTable *memo_table,
- const gchar *message)
+ const gchar *message,
+ gdouble percent)
{
- g_signal_emit (memo_table, signals[STATUS_MESSAGE], 0, message);
+ guint signal_id = signals[STATUS_MESSAGE];
+
+ g_signal_emit (memo_table, signal_id, 0, message, percent);
}
static void
memo_table_emit_user_created (EMemoTable *memo_table)
{
- g_signal_emit (memo_table, signals[USER_CREATED], 0);
+ guint signal_id = signals[USER_CREATED];
+
+ g_signal_emit (memo_table, signal_id, 0);
}
static gint
@@ -173,6 +182,25 @@ memo_table_double_click_cb (EMemoTable *memo_table,
memo_table_emit_open_component (memo_table, comp_data);
}
+static void
+memo_table_model_cal_view_progress_cb (EMemoTable *memo_table,
+ const gchar *message,
+ gint progress,
+ ECalSourceType type)
+{
+ gdouble percent = (gdouble) progress;
+
+ memo_table_emit_status_message (memo_table, message, percent);
+}
+
+static void
+memo_table_model_cal_view_done_cb (EMemoTable *memo_table,
+ ECalendarStatus status,
+ ECalSourceType type)
+{
+ memo_table_emit_status_message (memo_table, NULL, -1.0);
+}
+
static gboolean
memo_table_query_tooltip_cb (EMemoTable *memo_table,
gint x,
@@ -541,10 +569,21 @@ memo_table_init (EMemoTable *memo_table)
/* Create the model */
memo_table->model = (ECalModel *) e_cal_model_memos_new ();
+
g_signal_connect_swapped (
- memo_table->model, "row_appended",
+ memo_table->model, "row-appended",
G_CALLBACK (memo_table_emit_user_created), memo_table);
+ g_signal_connect_swapped (
+ memo_table->model, "cal-view-progress",
+ G_CALLBACK (memo_table_model_cal_view_progress_cb),
+ memo_table);
+
+ g_signal_connect_swapped (
+ memo_table->model, "cal-view-done",
+ G_CALLBACK (memo_table_model_cal_view_done_cb),
+ memo_table);
+
/* Create the header columns */
extras = e_table_extras_new ();
@@ -776,7 +815,7 @@ delete_selected_components (EMemoTable *memo_table)
objs = e_memo_table_get_selected (memo_table);
status_message = _("Deleting selected objects");
- memo_table_emit_status_message (memo_table, status_message);
+ memo_table_emit_status_message (memo_table, status_message, -1.0);
for (l = objs; l; l = l->next) {
ECalModelComponent *comp_data = (ECalModelComponent *) l->data;
@@ -788,7 +827,7 @@ delete_selected_components (EMemoTable *memo_table)
g_clear_error (&error);
}
- memo_table_emit_status_message (memo_table, NULL);
+ memo_table_emit_status_message (memo_table, NULL, -1.0);
g_slist_free (objs);
}
@@ -995,7 +1034,7 @@ clipboard_get_calendar_data (EMemoTable *memo_table, const gchar *text)
client = e_cal_model_get_default_client (memo_table->model);
status_message = _("Updating objects");
- memo_table_emit_status_message (memo_table, _("Updating objects"));
+ memo_table_emit_status_message (memo_table, status_message, -1.0);
if (kind == ICAL_VCALENDAR_COMPONENT) {
icalcomponent_kind child_kind;
@@ -1040,7 +1079,7 @@ clipboard_get_calendar_data (EMemoTable *memo_table, const gchar *text)
g_object_unref (comp);
}
- memo_table_emit_status_message (memo_table, NULL);
+ memo_table_emit_status_message (memo_table, NULL, -1.0);
}
static void
diff --git a/calendar/gui/e-memo-table.h b/calendar/gui/e-memo-table.h
index 12f51cb5e8..39838b4caa 100644
--- a/calendar/gui/e-memo-table.h
+++ b/calendar/gui/e-memo-table.h
@@ -90,7 +90,8 @@ struct _EMemoTableClass {
void (*popup_event) (EMemoTable *memo_table,
GdkEvent *event);
void (*status_message) (EMemoTable *memo_table,
- const gchar *message);
+ const gchar *message,
+ gdouble percent);
void (*user_created) (EMemoTable *memo_table);
};
diff --git a/calendar/modules/e-cal-shell-content.c b/calendar/modules/e-cal-shell-content.c
index 879420a307..f8bd9f6ddd 100644
--- a/calendar/modules/e-cal-shell-content.c
+++ b/calendar/modules/e-cal-shell-content.c
@@ -62,6 +62,8 @@ struct _ECalShellContentPrivate {
EMemoTableConfig *memo_table_config;
GalViewInstance *view_instance;
+
+ guint paned_binding_id;
};
enum {
diff --git a/calendar/modules/e-cal-shell-sidebar.c b/calendar/modules/e-cal-shell-sidebar.c
index 7f962574f4..7c2777bf04 100644
--- a/calendar/modules/e-cal-shell-sidebar.c
+++ b/calendar/modules/e-cal-shell-sidebar.c
@@ -421,7 +421,7 @@ cal_shell_sidebar_constructed (GObject *object)
/* Restore the selector state from the last session. */
selector = E_SOURCE_SELECTOR (priv->selector);
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector));
g_signal_connect_swapped (
model, "row-changed",
diff --git a/calendar/modules/e-cal-shell-view-memopad.c b/calendar/modules/e-cal-shell-view-memopad.c
index ff9c235062..5c2bf19052 100644
--- a/calendar/modules/e-cal-shell-view-memopad.c
+++ b/calendar/modules/e-cal-shell-view-memopad.c
@@ -68,15 +68,15 @@ action_calendar_memopad_delete_cb (GtkAction *action,
{
ECalShellContent *cal_shell_content;
EMemoTable *memo_table;
- const gchar *status_message;
cal_shell_content = cal_shell_view->priv->cal_shell_content;
memo_table = e_cal_shell_content_get_memo_table (cal_shell_content);
- status_message = _("Deleting selected memos...");
- e_cal_shell_view_set_status_message (cal_shell_view, status_message);
+ e_cal_shell_view_memopad_set_status_message (
+ cal_shell_view, _("Deleting selected memos..."), -1.0);
e_memo_table_delete_selected (memo_table);
- e_cal_shell_view_set_status_message (cal_shell_view, NULL);
+ e_cal_shell_view_memopad_set_status_message (
+ cal_shell_view, NULL, -1.0);
}
static void
@@ -470,3 +470,39 @@ e_cal_shell_view_memopad_open_memo (ECalShellView *cal_shell_view,
exit:
gtk_window_present (GTK_WINDOW (editor));
}
+
+void
+e_cal_shell_view_memopad_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->memopad_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->memopad_activity = activity;
+}
diff --git a/calendar/modules/e-cal-shell-view-private.c b/calendar/modules/e-cal-shell-view-private.c
index 72b25f0e8d..3b7bea2449 100644
--- a/calendar/modules/e-cal-shell-view-private.c
+++ b/calendar/modules/e-cal-shell-view-private.c
@@ -225,6 +225,8 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
EShellView *shell_view;
GnomeCalendar *calendar;
ECalendar *mini_calendar;
+ EMemoTable *memo_table;
+ ECalendarTable *task_table;
guint notification;
shell_view = E_SHELL_VIEW (cal_shell_view);
@@ -237,6 +239,8 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
cal_shell_content = E_CAL_SHELL_CONTENT (shell_content);
calendar = e_cal_shell_content_get_calendar (cal_shell_content);
+ memo_table = e_cal_shell_content_get_memo_table (cal_shell_content);
+ task_table = e_cal_shell_content_get_task_table (cal_shell_content);
cal_shell_sidebar = E_CAL_SHELL_SIDEBAR (shell_sidebar);
mini_calendar = e_cal_shell_sidebar_get_mini_calendar (cal_shell_sidebar);
@@ -265,6 +269,26 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
G_CALLBACK (cal_shell_view_mini_calendar_selection_changed_cb),
cal_shell_view);
+ g_signal_connect_swapped (
+ memo_table, "status-message",
+ G_CALLBACK (e_cal_shell_view_memopad_set_status_message),
+ cal_shell_view);
+
+ g_signal_connect_swapped (
+ task_table, "status-message",
+ G_CALLBACK (e_cal_shell_view_taskpad_set_status_message),
+ cal_shell_view);
+
+ g_signal_connect_swapped (
+ e_memo_table_get_table (memo_table), "selection-change",
+ G_CALLBACK (e_cal_shell_view_memopad_actions_update),
+ cal_shell_view);
+
+ g_signal_connect_swapped (
+ e_calendar_table_get_table (task_table), "selection-change",
+ G_CALLBACK (e_cal_shell_view_taskpad_actions_update),
+ cal_shell_view);
+
/* Listen for configuration changes. */
#if 0
@@ -279,7 +303,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
G_CALLBACK (e_cal_shell_view_update_search_filter),
cal_shell_view);
- e_cal_shell_view_actions_init (shell_view);
+ e_cal_shell_view_actions_init (cal_shell_view);
e_cal_shell_view_update_sidebar (cal_shell_view);
e_cal_shell_view_update_search_filter (cal_shell_view);
}
@@ -297,11 +321,25 @@ e_cal_shell_view_private_dispose (ECalShellView *cal_shell_view)
DISPOSE (priv->cal_shell_content);
DISPOSE (priv->cal_shell_sidebar);
- if (cal_shell_view->priv->activity != NULL) {
+ if (cal_shell_view->priv->calendar_activity != NULL) {
+ /* XXX Activity is not cancellable. */
+ e_activity_complete (cal_shell_view->priv->calendar_activity);
+ g_object_unref (cal_shell_view->priv->calendar_activity);
+ cal_shell_view->priv->calendar_activity = NULL;
+ }
+
+ if (cal_shell_view->priv->memopad_activity != NULL) {
/* XXX Activity is not cancellable. */
- e_activity_complete (cal_shell_view->priv->activity);
- g_object_unref (cal_shell_view->priv->activity);
- cal_shell_view->priv->activity = NULL;
+ e_activity_complete (cal_shell_view->priv->memopad_activity);
+ g_object_unref (cal_shell_view->priv->memopad_activity);
+ cal_shell_view->priv->memopad_activity = NULL;
+ }
+
+ if (cal_shell_view->priv->taskpad_activity != NULL) {
+ /* XXX Activity is not cancellable. */
+ e_activity_complete (cal_shell_view->priv->taskpad_activity);
+ g_object_unref (cal_shell_view->priv->taskpad_activity);
+ cal_shell_view->priv->taskpad_activity = NULL;
}
}
@@ -360,7 +398,8 @@ exit:
void
e_cal_shell_view_set_status_message (ECalShellView *cal_shell_view,
- const gchar *status_message)
+ const gchar *status_message,
+ gdouble percent)
{
EActivity *activity;
EShellView *shell_view;
@@ -368,10 +407,11 @@ e_cal_shell_view_set_status_message (ECalShellView *cal_shell_view,
g_return_if_fail (E_IS_CAL_SHELL_VIEW (cal_shell_view));
- activity = cal_shell_view->priv->activity;
shell_view = E_SHELL_VIEW (cal_shell_view);
shell_module = e_shell_view_get_shell_module (shell_view);
+ activity = cal_shell_view->priv->calendar_activity;
+
if (status_message == NULL || *status_message == '\0') {
if (activity != NULL) {
e_activity_complete (activity);
@@ -381,12 +421,15 @@ e_cal_shell_view_set_status_message (ECalShellView *cal_shell_view,
} 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
+ } else {
+ e_activity_set_percent (activity, percent);
e_activity_set_primary_text (activity, status_message);
+ }
- cal_shell_view->priv->activity = activity;
+ cal_shell_view->priv->calendar_activity = activity;
}
void
diff --git a/calendar/modules/e-cal-shell-view-private.h b/calendar/modules/e-cal-shell-view-private.h
index 6187e2b749..f1116f9c35 100644
--- a/calendar/modules/e-cal-shell-view-private.h
+++ b/calendar/modules/e-cal-shell-view-private.h
@@ -104,7 +104,9 @@ struct _ECalShellViewPrivate {
/* The last time explicitly selected by the user. */
time_t base_view_time;
- EActivity *activity;
+ EActivity *calendar_activity;
+ EActivity *memopad_activity;
+ EActivity *taskpad_activity;
};
void e_cal_shell_view_private_init
@@ -128,7 +130,8 @@ void e_cal_shell_view_open_event
ECalModelComponent *comp_data);
void e_cal_shell_view_set_status_message
(ECalShellView *cal_shell_view,
- const gchar *status_message);
+ const gchar *status_message,
+ gdouble percent);
void e_cal_shell_view_update_sidebar
(ECalShellView *cal_shell_view);
void e_cal_shell_view_update_search_filter
@@ -143,6 +146,10 @@ void e_cal_shell_view_memopad_actions_update
void e_cal_shell_view_memopad_open_memo
(ECalShellView *cal_shell_view,
ECalModelComponent *comp_data);
+void e_cal_shell_view_memopad_set_status_message
+ (ECalShellView *cal_shell_view,
+ const gchar *status_message,
+ gdouble percent);
/* Task Pad Utilities */
@@ -153,6 +160,10 @@ void e_cal_shell_view_taskpad_actions_update
void e_cal_shell_view_taskpad_open_task
(ECalShellView *cal_shell_view,
ECalModelComponent *comp_data);
+void e_cal_shell_view_taskpad_set_status_message
+ (ECalShellView *cal_shell_view,
+ const gchar *status_message,
+ gdouble percent);
G_END_DECLS
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;
+}
diff --git a/calendar/modules/e-cal-shell-view.c b/calendar/modules/e-cal-shell-view.c
index 9100986280..fa2142e42a 100644
--- a/calendar/modules/e-cal-shell-view.c
+++ b/calendar/modules/e-cal-shell-view.c
@@ -193,6 +193,7 @@ cal_shell_view_class_init (ECalShellViewClass *class,
shell_view_class->search_options = "/calendar-search-options";
shell_view_class->search_rules = "caltypes.xml";
shell_view_class->type_module = type_module;
+ shell_view_class->new_shell_content = e_cal_shell_content_new;
shell_view_class->new_shell_sidebar = e_cal_shell_sidebar_new;
shell_view_class->update_actions = cal_shell_view_update_actions;
diff --git a/calendar/modules/e-memo-shell-sidebar.c b/calendar/modules/e-memo-shell-sidebar.c
index 6e5475e290..9068397005 100644
--- a/calendar/modules/e-memo-shell-sidebar.c
+++ b/calendar/modules/e-memo-shell-sidebar.c
@@ -26,6 +26,7 @@
#include <libecal/e-cal.h>
#include "e-util/e-error.h"
+#include "e-util/e-util.h"
#include "calendar/common/authentication.h"
#include "calendar/gui/calendar-config.h"
#include "calendar/gui/e-calendar-selector.h"
@@ -83,7 +84,7 @@ memo_shell_sidebar_emit_status_message (EMemoShellSidebar *memo_shell_sidebar,
{
guint signal_id = signals[STATUS_MESSAGE];
- g_signal_emit (memo_shell_sidebar, signal_id, 0, status_message);
+ g_signal_emit (memo_shell_sidebar, signal_id, 0, status_message, -1.0);
}
static void
@@ -558,9 +559,10 @@ memo_shell_sidebar_class_init (EMemoShellSidebarClass *class)
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (EMemoShellSidebarClass, status_message),
NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ e_marshal_VOID__STRING_DOUBLE,
+ G_TYPE_NONE, 2,
+ G_TYPE_STRING,
+ G_TYPE_DOUBLE);
}
static void
diff --git a/calendar/modules/e-memo-shell-sidebar.h b/calendar/modules/e-memo-shell-sidebar.h
index 8e59c5b38e..50ece794b2 100644
--- a/calendar/modules/e-memo-shell-sidebar.h
+++ b/calendar/modules/e-memo-shell-sidebar.h
@@ -72,7 +72,8 @@ struct _EMemoShellSidebarClass {
void (*client_removed) (EMemoShellSidebar *memo_shell_sidebar,
ECal *client);
void (*status_message) (EMemoShellSidebar *memo_shell_sidebar,
- const gchar *status_message);
+ const gchar *status_message,
+ gdouble percent);
};
GType e_memo_shell_sidebar_get_type (void);
diff --git a/calendar/modules/e-memo-shell-view-actions.c b/calendar/modules/e-memo-shell-view-actions.c
index d6e9387e31..915f52640e 100644
--- a/calendar/modules/e-memo-shell-view-actions.c
+++ b/calendar/modules/e-memo-shell-view-actions.c
@@ -87,16 +87,15 @@ action_memo_delete_cb (GtkAction *action,
EMemoShellContent *memo_shell_content;
ECalComponentPreview *memo_preview;
EMemoTable *memo_table;
- const gchar *status_message;
memo_shell_content = memo_shell_view->priv->memo_shell_content;
memo_table = e_memo_shell_content_get_memo_table (memo_shell_content);
memo_preview = e_memo_shell_content_get_memo_preview (memo_shell_content);
- status_message = _("Deleting selected memos...");
- e_memo_shell_view_set_status_message (memo_shell_view, status_message);
+ e_memo_shell_view_set_status_message (
+ memo_shell_view, _("Deleting selected memos..."), -1.0);
e_memo_table_delete_selected (memo_table);
- e_memo_shell_view_set_status_message (memo_shell_view, NULL);
+ e_memo_shell_view_set_status_message (memo_shell_view, NULL, -1.0);
e_cal_component_preview_clear (memo_preview);
}
diff --git a/calendar/modules/e-memo-shell-view-private.c b/calendar/modules/e-memo-shell-view-private.c
index 183d48a5b0..10b20c1827 100644
--- a/calendar/modules/e-memo-shell-view-private.c
+++ b/calendar/modules/e-memo-shell-view-private.c
@@ -450,7 +450,8 @@ exit:
void
e_memo_shell_view_set_status_message (EMemoShellView *memo_shell_view,
- const gchar *status_message)
+ const gchar *status_message,
+ gdouble percent)
{
EActivity *activity;
EShellView *shell_view;
@@ -471,10 +472,13 @@ e_memo_shell_view_set_status_message (EMemoShellView *memo_shell_view,
} 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
+ } else {
+ e_activity_set_percent (activity, percent);
e_activity_set_primary_text (activity, status_message);
+ }
memo_shell_view->priv->activity = activity;
}
diff --git a/calendar/modules/e-memo-shell-view-private.h b/calendar/modules/e-memo-shell-view-private.h
index 0a68ef1f98..66d9665c48 100644
--- a/calendar/modules/e-memo-shell-view-private.h
+++ b/calendar/modules/e-memo-shell-view-private.h
@@ -122,7 +122,8 @@ void e_memo_shell_view_open_memo
ECalModelComponent *comp_data);
void e_memo_shell_view_set_status_message
(EMemoShellView *memo_shell_view,
- const gchar *status_message);
+ const gchar *status_message,
+ gdouble percent);
void e_memo_shell_view_update_sidebar
(EMemoShellView *memo_shell_view);
void e_memo_shell_view_update_search_filter
diff --git a/calendar/modules/e-task-shell-sidebar.c b/calendar/modules/e-task-shell-sidebar.c
index 913d18e37f..f58df26dfc 100644
--- a/calendar/modules/e-task-shell-sidebar.c
+++ b/calendar/modules/e-task-shell-sidebar.c
@@ -26,6 +26,7 @@
#include <libecal/e-cal.h>
#include "e-util/e-error.h"
+#include "e-util/e-util.h"
#include "calendar/common/authentication.h"
#include "calendar/gui/calendar-config.h"
#include "calendar/gui/e-calendar-selector.h"
@@ -83,7 +84,7 @@ task_shell_sidebar_emit_status_message (ETaskShellSidebar *task_shell_sidebar,
{
guint signal_id = signals[STATUS_MESSAGE];
- g_signal_emit (task_shell_sidebar, signal_id, 0, status_message);
+ g_signal_emit (task_shell_sidebar, signal_id, 0, status_message, -1.0);
}
static void
@@ -558,9 +559,10 @@ task_shell_sidebar_class_init (ETaskShellSidebarClass *class)
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (ETaskShellSidebarClass, status_message),
NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ e_marshal_VOID__STRING_DOUBLE,
+ G_TYPE_NONE, 2,
+ G_TYPE_STRING,
+ G_TYPE_DOUBLE);
}
static void
diff --git a/calendar/modules/e-task-shell-sidebar.h b/calendar/modules/e-task-shell-sidebar.h
index 8fcafcaa98..57f12d3738 100644
--- a/calendar/modules/e-task-shell-sidebar.h
+++ b/calendar/modules/e-task-shell-sidebar.h
@@ -72,7 +72,8 @@ struct _ETaskShellSidebarClass {
void (*client_removed) (ETaskShellSidebar *task_shell_sidebar,
ECal *client);
void (*status_message) (ETaskShellSidebar *task_shell_sidebar,
- const gchar *status_message);
+ const gchar *status_message,
+ gdouble percent);
};
GType e_task_shell_sidebar_get_type (void);
diff --git a/calendar/modules/e-task-shell-view-actions.c b/calendar/modules/e-task-shell-view-actions.c
index 9a5bca34d9..45c1400c40 100644
--- a/calendar/modules/e-task-shell-view-actions.c
+++ b/calendar/modules/e-task-shell-view-actions.c
@@ -134,16 +134,15 @@ action_task_delete_cb (GtkAction *action,
ETaskShellContent *task_shell_content;
ECalComponentPreview *task_preview;
ECalendarTable *task_table;
- const gchar *status_message;
task_shell_content = task_shell_view->priv->task_shell_content;
task_table = e_task_shell_content_get_task_table (task_shell_content);
task_preview = e_task_shell_content_get_task_preview (task_shell_content);
- status_message = _("Deleting selected tasks...");
- e_task_shell_view_set_status_message (task_shell_view, status_message);
+ e_task_shell_view_set_status_message (
+ task_shell_view, _("Deleting selected tasks..."), -1.0);
e_calendar_table_delete_selected (task_table);
- e_task_shell_view_set_status_message (task_shell_view, NULL);
+ e_task_shell_view_set_status_message (task_shell_view, NULL, -1.0);
e_cal_component_preview_clear (task_preview);
}
diff --git a/calendar/modules/e-task-shell-view-private.c b/calendar/modules/e-task-shell-view-private.c
index 754f6fe4c6..ef2b641ff3 100644
--- a/calendar/modules/e-task-shell-view-private.c
+++ b/calendar/modules/e-task-shell-view-private.c
@@ -521,7 +521,8 @@ exit:
void
e_task_shell_view_set_status_message (ETaskShellView *task_shell_view,
- const gchar *status_message)
+ const gchar *status_message,
+ gdouble percent)
{
EActivity *activity;
EShellView *shell_view;
@@ -542,10 +543,13 @@ e_task_shell_view_set_status_message (ETaskShellView *task_shell_view,
} 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
+ } else {
+ e_activity_set_percent (activity, percent);
e_activity_set_primary_text (activity, status_message);
+ }
task_shell_view->priv->activity = activity;
}
diff --git a/calendar/modules/e-task-shell-view-private.h b/calendar/modules/e-task-shell-view-private.h
index dfb5c98d10..ba6e076c12 100644
--- a/calendar/modules/e-task-shell-view-private.h
+++ b/calendar/modules/e-task-shell-view-private.h
@@ -131,7 +131,8 @@ void e_task_shell_view_open_task
ECalModelComponent *comp_data);
void e_task_shell_view_set_status_message
(ETaskShellView *task_shell_view,
- const gchar *status_message);
+ const gchar *status_message,
+ gdouble percent);
void e_task_shell_view_update_sidebar
(ETaskShellView *task_shell_view);
void e_task_shell_view_update_search_filter
diff --git a/e-util/e-marshal.list b/e-util/e-marshal.list
index f440c3d5d1..1ae89a8e20 100644
--- a/e-util/e-marshal.list
+++ b/e-util/e-marshal.list
@@ -56,6 +56,7 @@ NONE:POINTER,POINTER
NONE:POINTER,POINTER,INT
NONE:POINTER,STRING
NONE:STRING,BOOL,INT,INT
+NONE:STRING,DOUBLE
NONE:STRING,INT
NONE:STRING,INT,INT
NONE:STRING,POINTER,POINTER