[evolution-data-server] CamelSubscribable: Push status messages for blocking operations.



commit b705900a19128add1bb7f11f6b0eb37b7542a8c3
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Jul 8 12:08:09 2012 -0400

    CamelSubscribable: Push status messages for blocking operations.

 camel/camel-subscribable.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-subscribable.c b/camel/camel-subscribable.c
index ba1eed0..1e82529 100644
--- a/camel/camel-subscribable.c
+++ b/camel/camel-subscribable.c
@@ -18,6 +18,9 @@
 
 #include "camel-subscribable.h"
 
+#include <config.h>
+#include <glib/gi18n-lib.h>
+
 #include "camel-debug.h"
 #include "camel-session.h"
 #include "camel-vtrash-folder.h"
@@ -355,6 +358,7 @@ camel_subscribable_subscribe_folder_sync (CamelSubscribable *subscribable,
                                           GError **error)
 {
 	CamelSubscribableInterface *interface;
+	const gchar *message;
 	gboolean success;
 
 	g_return_val_if_fail (CAMEL_IS_SUBSCRIBABLE (subscribable), FALSE);
@@ -375,11 +379,16 @@ camel_subscribable_subscribe_folder_sync (CamelSubscribable *subscribable,
 		return FALSE;
 	}
 
+	message = _("Subscribing to folder '%s'");
+	camel_operation_push_message (cancellable, message, folder_name);
+
 	success = interface->subscribe_folder_sync (
 		subscribable, folder_name, cancellable, error);
 	CAMEL_CHECK_GERROR (
 		subscribable, subscribe_folder_sync, success, error);
 
+	camel_operation_pop_message (cancellable);
+
 	camel_store_unlock (
 		CAMEL_STORE (subscribable),
 		CAMEL_STORE_FOLDER_LOCK);
@@ -475,6 +484,7 @@ camel_subscribable_unsubscribe_folder_sync (CamelSubscribable *subscribable,
                                             GError **error)
 {
 	CamelSubscribableInterface *interface;
+	const gchar *message;
 	gboolean success;
 
 	g_return_val_if_fail (CAMEL_IS_SUBSCRIBABLE (subscribable), FALSE);
@@ -496,6 +506,9 @@ camel_subscribable_unsubscribe_folder_sync (CamelSubscribable *subscribable,
 		return FALSE;
 	}
 
+	message = _("Unsubscribing from folder '%s'");
+	camel_operation_push_message (cancellable, message, folder_name);
+
 	success = interface->unsubscribe_folder_sync (
 		subscribable, folder_name, cancellable, error);
 	CAMEL_CHECK_GERROR (
@@ -505,6 +518,8 @@ camel_subscribable_unsubscribe_folder_sync (CamelSubscribable *subscribable,
 		subscribable_delete_cached_folder (
 			CAMEL_STORE (subscribable), folder_name);
 
+	camel_operation_pop_message (cancellable);
+
 	camel_store_unlock (
 		CAMEL_STORE (subscribable),
 		CAMEL_STORE_FOLDER_LOCK);



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