[evolution/webkit-composer: 165/181] Add e_editor_new_activity().



commit 28f1e2d2791037acef0235ef67ded6eae8f13947
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.

 doc/reference/libeutil/libeutil-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/libeutil/libeutil-sections.txt b/doc/reference/libeutil/libeutil-sections.txt
index 4ee700d..cea774f 100644
--- a/doc/reference/libeutil/libeutil-sections.txt
+++ b/doc/reference/libeutil/libeutil-sections.txt
@@ -1482,6 +1482,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]