[evolution] Add em_folder_selector_new_activity().



commit b6cf2c3763b1d51f8824ee14e226b6adb40e7e1b
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Mar 26 18:44:03 2014 -0400

    Add em_folder_selector_new_activity().
    
    Returns a new EActivity configured to display status and error messages
    directly in the selector dialog.

 mail/em-folder-selector.c |   35 +++++++++++++++++++++++++++++++++++
 mail/em-folder-selector.h |    1 +
 2 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c
index 3c68393..fcdd66e 100644
--- a/mail/em-folder-selector.c
+++ b/mail/em-folder-selector.c
@@ -889,3 +889,38 @@ em_folder_selector_get_selected_uri (EMFolderSelector *selector)
 
        return uri;
 }
+
+/**
+ * em_folder_selector_new_activity:
+ * @selector: an #EMFolderSelector
+ *
+ * Returns a new #EActivity configured to display status and error messages
+ * directly in the @selector dialog.
+ *
+ * Returns: an #EActivity
+ **/
+EActivity *
+em_folder_selector_new_activity (EMFolderSelector *selector)
+{
+       EActivity *activity;
+       EActivityBar *activity_bar;
+       EAlertSink *alert_sink;
+       GCancellable *cancellable;
+
+       g_return_val_if_fail (EM_IS_FOLDER_SELECTOR (selector), NULL);
+
+       activity = e_activity_new ();
+
+       alert_sink = E_ALERT_SINK (selector);
+       e_activity_set_alert_sink (activity, alert_sink);
+
+       cancellable = camel_operation_new ();
+       e_activity_set_cancellable (activity, cancellable);
+       g_object_unref (cancellable);
+
+       activity_bar = E_ACTIVITY_BAR (selector->priv->activity_bar);
+       e_activity_bar_set_activity (activity_bar, activity);
+
+       return activity;
+}
+
diff --git a/mail/em-folder-selector.h b/mail/em-folder-selector.h
index 81e82cb..bb093be 100644
--- a/mail/em-folder-selector.h
+++ b/mail/em-folder-selector.h
@@ -97,6 +97,7 @@ void          em_folder_selector_set_selected (EMFolderSelector *selector,
                                                 const gchar *folder_name);
 const gchar *  em_folder_selector_get_selected_uri
                                                (EMFolderSelector *selector);
+EActivity *    em_folder_selector_new_activity (EMFolderSelector *selector);
 
 G_END_DECLS
 


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