[evolution] EPreviewPane: Handle "new-activity" signals from EWebView.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] EPreviewPane: Handle "new-activity" signals from EWebView.
- Date: Sun, 28 Jul 2013 02:03:06 +0000 (UTC)
commit 08f6274a49e4eaf478dfb6d50463f69ff67c62d7
Author: Matthew Barnes <mbarnes redhat com>
Date: Sat Jul 27 17:41:45 2013 -0400
EPreviewPane: Handle "new-activity" signals from EWebView.
Configures the EActivity to submit alerts to the EPreviewPane.
e-util/e-preview-pane.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-preview-pane.c b/e-util/e-preview-pane.c
index ae13a8b..929f392 100644
--- a/e-util/e-preview-pane.c
+++ b/e-util/e-preview-pane.c
@@ -32,6 +32,8 @@ struct _EPreviewPanePrivate {
GtkWidget *alert_bar;
GtkWidget *web_view;
GtkWidget *search_bar;
+
+ gulong web_view_new_activity_handler_id;
};
enum {
@@ -60,13 +62,29 @@ G_DEFINE_TYPE_WITH_CODE (
e_preview_pane_alert_sink_init))
static void
+preview_pane_web_view_new_activity_cb (EWebView *web_view,
+ EActivity *activity,
+ EPreviewPane *preview_pane)
+{
+ e_activity_set_alert_sink (activity, E_ALERT_SINK (preview_pane));
+}
+
+static void
preview_pane_set_web_view (EPreviewPane *preview_pane,
EWebView *web_view)
{
+ gulong handler_id;
+
g_return_if_fail (E_IS_WEB_VIEW (web_view));
g_return_if_fail (preview_pane->priv->web_view == NULL);
preview_pane->priv->web_view = g_object_ref_sink (web_view);
+
+ handler_id = g_signal_connect (
+ web_view, "new-activity",
+ G_CALLBACK (preview_pane_web_view_new_activity_cb),
+ preview_pane);
+ preview_pane->priv->web_view_new_activity_handler_id = handler_id;
}
static void
@@ -116,6 +134,13 @@ preview_pane_dispose (GObject *object)
priv = E_PREVIEW_PANE_GET_PRIVATE (object);
+ if (priv->web_view_new_activity_handler_id > 0) {
+ g_signal_handler_disconnect (
+ priv->web_view,
+ priv->web_view_new_activity_handler_id);
+ priv->web_view_new_activity_handler_id = 0;
+ }
+
g_clear_object (&priv->alert_bar);
g_clear_object (&priv->search_bar);
g_clear_object (&priv->web_view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]