[evolution/wip/webkit-composer: 160/262] Add e_editor_new_activity().



commit b734c09fb8f22432f8096db449fc2bf339f1c38d
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Feb 7 17:20:55 2013 -0500

    Add e_editor_new_activity().
    
    Creates and configures a new EActivity so its progress is shown in
    the editor.  The EActivity comes pre-loaded with a CamelOperation.

 .../evolution-util/evolution-util-sections.txt     |    1 +
 e-util/e-editor.c                                  |   33 ++++++++++++++++++++
 e-util/e-editor.h                                  |    2 +
 3 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/doc/reference/evolution-util/evolution-util-sections.txt 
b/doc/reference/evolution-util/evolution-util-sections.txt
index 85313c2..2b2eddf 100644
--- a/doc/reference/evolution-util/evolution-util-sections.txt
+++ b/doc/reference/evolution-util/evolution-util-sections.txt
@@ -1581,6 +1581,7 @@ e_editor_get_widget
 e_editor_get_managed_widget
 e_editor_get_filename
 e_editor_set_filename
+e_editor_new_activity
 e_editor_pack_above
 e_editor_save
 <SUBSECTION Standard>
diff --git a/e-util/e-editor.c b/e-util/e-editor.c
index f926674..d1dc969 100644
--- a/e-util/e-editor.c
+++ b/e-util/e-editor.c
@@ -20,6 +20,8 @@
 
 #include <config.h>
 #include <glib/gi18n-lib.h>
+
+#include <camel/camel.h>
 #include <enchant/enchant.h>
 
 #include "e-editor.h"
@@ -1119,6 +1121,37 @@ e_editor_set_filename (EEditor *editor,
 }
 
 /**
+ * e_editor_new_activity:
+ * @editor: an #EEditor
+ *
+ * Creates and configures a new #EActivity so its progress is shown in
+ * the @editor.  The #EActivity comes pre-loaded with a #CamelOperation.
+ *
+ * Returns: a new #EActivity for use with @editor
+ **/
+EActivity *
+e_editor_new_activity (EEditor *editor)
+{
+       EActivity *activity;
+       EActivityBar *activity_bar;
+       GCancellable *cancellable;
+
+       g_return_val_if_fail (E_IS_EDITOR (editor), NULL);
+
+       activity = e_activity_new ();
+       e_activity_set_alert_sink (activity, E_ALERT_SINK (editor));
+
+       cancellable = camel_operation_new ();
+       e_activity_set_cancellable (activity, cancellable);
+       g_object_unref (cancellable);
+
+       activity_bar = E_ACTIVITY_BAR (editor->priv->activity_bar);
+       e_activity_bar_set_activity (activity_bar, activity);
+
+       return activity;
+}
+
+/**
  * e_editor_pack_above:
  * @editor: an #EEditor
  * @child: a #GtkWidget
diff --git a/e-util/e-editor.h b/e-util/e-editor.h
index 77c635f..00831ac 100644
--- a/e-util/e-editor.h
+++ b/e-util/e-editor.h
@@ -26,6 +26,7 @@
 #define E_EDITOR_H
 
 #include <gtk/gtk.h>
+#include <e-util/e-activity.h>
 #include <e-util/e-editor-widget.h>
 
 /* Standard GObject macros */
@@ -84,6 +85,7 @@ GtkWidget *   e_editor_get_managed_widget     (EEditor *editor,
 const gchar *  e_editor_get_filename           (EEditor *editor);
 void           e_editor_set_filename           (EEditor *editor,
                                                 const gchar *filename);
+EActivity *    e_editor_new_activity           (EEditor *editor);
 void           e_editor_pack_above             (EEditor *editor,
                                                 GtkWidget *child);
 


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