aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-28 05:41:45 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-28 09:24:02 +0800
commit08f6274a49e4eaf478dfb6d50463f69ff67c62d7 (patch)
tree6dcdeb628e13aaf3ea9536c1e2728fb44dc3762c
parenta8edf2eca6461a668b8cd45386087373b794840e (diff)
downloadgsoc2013-evolution-08f6274a49e4eaf478dfb6d50463f69ff67c62d7.tar
gsoc2013-evolution-08f6274a49e4eaf478dfb6d50463f69ff67c62d7.tar.gz
gsoc2013-evolution-08f6274a49e4eaf478dfb6d50463f69ff67c62d7.tar.bz2
gsoc2013-evolution-08f6274a49e4eaf478dfb6d50463f69ff67c62d7.tar.lz
gsoc2013-evolution-08f6274a49e4eaf478dfb6d50463f69ff67c62d7.tar.xz
gsoc2013-evolution-08f6274a49e4eaf478dfb6d50463f69ff67c62d7.tar.zst
gsoc2013-evolution-08f6274a49e4eaf478dfb6d50463f69ff67c62d7.zip
EPreviewPane: Handle "new-activity" signals from EWebView.
Configures the EActivity to submit alerts to the EPreviewPane.
-rw-r--r--e-util/e-preview-pane.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/e-util/e-preview-pane.c b/e-util/e-preview-pane.c
index ae13a8b118..929f392cdc 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);