evolution r36692 - in branches/kill-bonobo: calendar/gui calendar/modules e-util



Author: mbarnes
Date: Tue Oct 28 17:30:32 2008
New Revision: 36692
URL: http://svn.gnome.org/viewvc/evolution?rev=36692&view=rev

Log:
Wire up status messages to include percentages if available.


Modified:
   branches/kill-bonobo/calendar/gui/e-calendar-table.c
   branches/kill-bonobo/calendar/gui/e-calendar-table.h
   branches/kill-bonobo/calendar/gui/e-memo-table.c
   branches/kill-bonobo/calendar/gui/e-memo-table.h
   branches/kill-bonobo/calendar/modules/e-cal-shell-content.c
   branches/kill-bonobo/calendar/modules/e-cal-shell-sidebar.c
   branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c
   branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.c
   branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.h
   branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c
   branches/kill-bonobo/calendar/modules/e-cal-shell-view.c
   branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.c
   branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.h
   branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c
   branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.c
   branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.h
   branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.c
   branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.h
   branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c
   branches/kill-bonobo/calendar/modules/e-task-shell-view-private.c
   branches/kill-bonobo/calendar/modules/e-task-shell-view-private.h
   branches/kill-bonobo/e-util/e-marshal.list

Modified: branches/kill-bonobo/calendar/gui/e-calendar-table.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-calendar-table.c	(original)
+++ branches/kill-bonobo/calendar/gui/e-calendar-table.c	Tue Oct 28 17:30:32 2008
@@ -108,27 +108,36 @@
 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_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 @@
 
 	return TRUE;
 }
+
 static gboolean
 calendar_table_popup_menu_cb (ECalendarTable *cal_table)
 {
@@ -604,10 +633,21 @@
 	/* 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 @@
 	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 @@
 		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 @@
 	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 @@
 		g_object_unref (comp);
 	}
 
-	calendar_table_emit_status_message (cal_table, NULL);
+	calendar_table_emit_status_message (cal_table, NULL, -1.0);
 }
 
 static void

Modified: branches/kill-bonobo/calendar/gui/e-calendar-table.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-calendar-table.h	(original)
+++ branches/kill-bonobo/calendar/gui/e-calendar-table.h	Tue Oct 28 17:30:32 2008
@@ -84,7 +84,8 @@
 	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);
 };
 

Modified: branches/kill-bonobo/calendar/gui/e-memo-table.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-memo-table.c	(original)
+++ branches/kill-bonobo/calendar/gui/e-memo-table.c	Tue Oct 28 17:30:32 2008
@@ -109,27 +109,36 @@
 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_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 @@
 	/* 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 @@
 	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 @@
 		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 @@
 	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 @@
 		g_object_unref (comp);
 	}
 
-	memo_table_emit_status_message (memo_table, NULL);
+	memo_table_emit_status_message (memo_table, NULL, -1.0);
 }
 
 static void

Modified: branches/kill-bonobo/calendar/gui/e-memo-table.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-memo-table.h	(original)
+++ branches/kill-bonobo/calendar/gui/e-memo-table.h	Tue Oct 28 17:30:32 2008
@@ -90,7 +90,8 @@
 	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);
 };
 

Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-content.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-content.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-content.c	Tue Oct 28 17:30:32 2008
@@ -62,6 +62,8 @@
 	EMemoTableConfig *memo_table_config;
 
 	GalViewInstance *view_instance;
+
+	guint paned_binding_id;
 };
 
 enum {

Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-sidebar.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-sidebar.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-sidebar.c	Tue Oct 28 17:30:32 2008
@@ -421,7 +421,7 @@
 	/* 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",

Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c	Tue Oct 28 17:30:32 2008
@@ -68,15 +68,15 @@
 {
 	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 @@
 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;
+}

Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.c	Tue Oct 28 17:30:32 2008
@@ -225,6 +225,8 @@
 	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 @@
 
 	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 @@
 		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 @@
 		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 @@
 	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 @@
 
 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 @@
 
 	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 @@
 
 	} 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

Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.h
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.h	(original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.h	Tue Oct 28 17:30:32 2008
@@ -104,7 +104,9 @@
 	/* 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 @@
 					 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_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_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
 

Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c	Tue Oct 28 17:30:32 2008
@@ -91,15 +91,15 @@
 {
 	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 @@
 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;
+}

Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view.c	Tue Oct 28 17:30:32 2008
@@ -193,6 +193,7 @@
 	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;
 

Modified: branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.c	Tue Oct 28 17:30:32 2008
@@ -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 @@
 {
 	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 @@
 		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

Modified: branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.h
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.h	(original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.h	Tue Oct 28 17:30:32 2008
@@ -72,7 +72,8 @@
 	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);

Modified: branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c	Tue Oct 28 17:30:32 2008
@@ -87,16 +87,15 @@
 	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);
 }

Modified: branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.c	Tue Oct 28 17:30:32 2008
@@ -450,7 +450,8 @@
 
 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 @@
 
 	} 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;
 }

Modified: branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.h
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.h	(original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.h	Tue Oct 28 17:30:32 2008
@@ -122,7 +122,8 @@
 					 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

Modified: branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.c	Tue Oct 28 17:30:32 2008
@@ -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 @@
 {
 	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 @@
 		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

Modified: branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.h
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.h	(original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.h	Tue Oct 28 17:30:32 2008
@@ -72,7 +72,8 @@
 	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);

Modified: branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c	Tue Oct 28 17:30:32 2008
@@ -134,16 +134,15 @@
 	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);
 }

Modified: branches/kill-bonobo/calendar/modules/e-task-shell-view-private.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-task-shell-view-private.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-view-private.c	Tue Oct 28 17:30:32 2008
@@ -521,7 +521,8 @@
 
 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 @@
 
 	} 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;
 }

Modified: branches/kill-bonobo/calendar/modules/e-task-shell-view-private.h
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-task-shell-view-private.h	(original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-view-private.h	Tue Oct 28 17:30:32 2008
@@ -131,7 +131,8 @@
 					 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

Modified: branches/kill-bonobo/e-util/e-marshal.list
==============================================================================
--- branches/kill-bonobo/e-util/e-marshal.list	(original)
+++ branches/kill-bonobo/e-util/e-marshal.list	Tue Oct 28 17:30:32 2008
@@ -56,6 +56,7 @@
 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]