[evolution/wip-webkit2] ITIPFormatter - Make the module work under WK2
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip-webkit2] ITIPFormatter - Make the module work under WK2
- Date: Wed, 20 Nov 2013 12:58:58 +0000 (UTC)
commit ba6d262822a60c068a461b4c577c2c29c9edcb8f
Author: Tomas Popela <tpopela redhat com>
Date: Wed Nov 20 12:50:55 2013 +0100
ITIPFormatter - Make the module work under WK2
modules/itip-formatter/e-mail-formatter-itip.c | 2 +-
modules/itip-formatter/e-mail-part-itip.c | 11 +--------
modules/itip-formatter/itip-view.c | 25 +++++++++++--------
modules/itip-formatter/itip-view.h | 4 ++-
.../module-itip-formatter-web-extension.c | 18 +++++++-------
5 files changed, 28 insertions(+), 32 deletions(-)
---
diff --git a/modules/itip-formatter/e-mail-formatter-itip.c b/modules/itip-formatter/e-mail-formatter-itip.c
index 9f274ce..d1a0213 100644
--- a/modules/itip-formatter/e-mail-formatter-itip.c
+++ b/modules/itip-formatter/e-mail-formatter-itip.c
@@ -70,7 +70,7 @@ emfe_itip_format (EMailFormatterExtension *extension,
buffer = g_string_sized_new (1024);
itip_part->view = itip_view_new (
- itip_part, itip_part->client_cache);
+ itip_part, itip_part->client_cache, "", 0);
itip_view_init_view (itip_part->view);
itip_view_write_for_printing (itip_part->view, buffer);
diff --git a/modules/itip-formatter/e-mail-part-itip.c b/modules/itip-formatter/e-mail-part-itip.c
index a977d58..9bd6e52 100644
--- a/modules/itip-formatter/e-mail-part-itip.c
+++ b/modules/itip-formatter/e-mail-part-itip.c
@@ -81,7 +81,6 @@ mail_part_itip_bind_dom_element (EMailPart *part,
guint64 page_id,
const gchar *element_id)
{
- ItipView *view;
EMailPartItip *pitip;
pitip = E_MAIL_PART_ITIP (part);
@@ -98,15 +97,7 @@ mail_part_itip_bind_dom_element (EMailPart *part,
WEBKIT_DOM_HTML_IFRAME_ELEMENT (element));
#endif
- view = itip_view_new (pitip, pitip->client_cache);
-#if 0
- g_object_set_data_full (
- G_OBJECT (element), "view", view,
- (GDestroyNotify) g_object_unref);
-#endif
- itip_view_create_dom_bindings (view, element_id);
-
- itip_view_init_view (view);
+ itip_view_new (pitip, pitip->client_cache, element_id, page_id);
}
static void
diff --git a/modules/itip-formatter/itip-view.c b/modules/itip-formatter/itip-view.c
index a5b3310..c102756 100644
--- a/modules/itip-formatter/itip-view.c
+++ b/modules/itip-formatter/itip-view.c
@@ -124,6 +124,9 @@ struct _ItipViewPrivate {
guint web_extension_button_clicked_signal_id;
guint web_extension_recur_toggled_signal_id;
+ const gchar *element_id;
+ guint64 page_id;
+
gchar *error;
};
@@ -740,9 +743,6 @@ show_checkbox (ItipView *view,
gboolean show,
gboolean update_second)
{
- g_warning ("%s", __FUNCTION__);
- g_warning ("\t%s", id);
-
g_return_if_fail (ITIP_IS_VIEW (view));
if (!view->priv->web_extension)
@@ -1745,11 +1745,7 @@ itip_view_create_dom_bindings (ItipView *view,
g_dbus_proxy_call (
view->priv->web_extension,
"SaveDocumentFromElement",
- g_variant_new (
- "(ts)",
- webkit_web_view_get_page_id (
- WEBKIT_WEB_VIEW (view)),
- element_id),
+ g_variant_new ("(ts)", view->priv->page_id, element_id),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
@@ -1818,6 +1814,10 @@ web_extension_proxy_created_cb (GDBusProxy *proxy,
(GDBusSignalCallback) recur_toggled_signal_cb,
view,
NULL);
+
+ itip_view_create_dom_bindings (view, view->priv->element_id);
+
+ itip_view_init_view (view);
}
static void
@@ -1873,13 +1873,13 @@ static void
itip_view_init (ItipView *view)
{
view->priv = ITIP_VIEW_GET_PRIVATE (view);
-
- itip_view_watch_web_extension (view);
}
ItipView *
itip_view_new (EMailPartItip *puri,
- EClientCache *client_cache)
+ EClientCache *client_cache,
+ const gchar *element_id,
+ guint64 page_id)
{
ItipView *view;
@@ -1890,7 +1890,10 @@ itip_view_new (EMailPartItip *puri,
"client-cache", client_cache,
NULL));
view->priv->itip_part = puri;
+ view->priv->element_id = element_id;
+ view->priv->page_id = page_id;
+ itip_view_watch_web_extension (view);
return view;
}
diff --git a/modules/itip-formatter/itip-view.h b/modules/itip-formatter/itip-view.h
index 07aa7ea..d078891 100644
--- a/modules/itip-formatter/itip-view.h
+++ b/modules/itip-formatter/itip-view.h
@@ -110,7 +110,9 @@ struct _ItipViewClass {
GType itip_view_get_type (void);
ItipView * itip_view_new (struct _EMailPartItip *puri,
- EClientCache *client_cache);
+ EClientCache *client_cache,
+ const gchar *element_id,
+ guint64 page_id);
void itip_view_init_view (ItipView *view);
void itip_view_write (EMailFormatter *formatter,
GString *buffer);
diff --git a/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c
b/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c
index 42a1b14..13102cf 100644
--- a/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c
+++ b/modules/itip-formatter/web-extension/module-itip-formatter-web-extension.c
@@ -211,7 +211,7 @@ handle_method_call (GDBusConnection *connection,
} else if (g_strcmp0 (method_name, "ShowButton") == 0) {
const gchar *button_id;
- button_id = g_variant_get_string (parameters, NULL);
+ g_variant_get (parameters, "(&s)", &button_id);
/* FIXME return error */
if (!document_saved)
@@ -259,7 +259,7 @@ handle_method_call (GDBusConnection *connection,
} else if (g_strcmp0 (method_name, "RemoveElement") == 0) {
const gchar *element_id;
- element_id = g_variant_get_string (parameters, NULL);
+ g_variant_get (parameters, "(&s)", &element_id);
/* FIXME return error */
if (!document_saved)
g_dbus_method_invocation_return_value (invocation, NULL);
@@ -270,7 +270,7 @@ handle_method_call (GDBusConnection *connection,
} else if (g_strcmp0 (method_name, "ElementRemoveChildNodes") == 0) {
const gchar *element_id;
- element_id = g_variant_get_string (parameters, NULL);
+ g_variant_get (parameters, "(&s)", &element_id);
/* FIXME return error */
if (!document_saved)
g_dbus_method_invocation_return_value (invocation, NULL);
@@ -294,7 +294,7 @@ handle_method_call (GDBusConnection *connection,
const gchar *element_id;
gboolean hidden;
- element_id = g_variant_get_string (parameters, NULL);
+ g_variant_get (parameters, "(&s)", &element_id);
/* FIXME return error */
if (!document_saved)
@@ -331,7 +331,7 @@ handle_method_call (GDBusConnection *connection,
const gchar *input_id;
gboolean checked;
- input_id = g_variant_get_string (parameters, NULL);
+ g_variant_get (parameters, "(&s)", &input_id);
/* FIXME return error */
if (!document_saved)
@@ -398,7 +398,7 @@ handle_method_call (GDBusConnection *connection,
} else if (g_strcmp0 (method_name, "ElementHideChildNodes") == 0) {
const gchar *element_id;
- element_id = g_variant_get_string (parameters, NULL);
+ g_variant_get (parameters, "(&s)", &element_id);
/* FIXME return error */
if (!document_saved)
@@ -426,7 +426,7 @@ handle_method_call (GDBusConnection *connection,
const gchar *select_id;
gboolean enabled;
- select_id = g_variant_get_string (parameters, NULL);
+ g_variant_get (parameters, "(&s)", &select_id);
/* FIXME return error */
if (!document_saved)
@@ -441,7 +441,7 @@ handle_method_call (GDBusConnection *connection,
const gchar *select_id;
gchar *value;
- select_id = g_variant_get_string (parameters, NULL);
+ g_variant_get (parameters, "(&s)", &select_id);
/* FIXME return error */
if (!document_saved)
@@ -527,7 +527,7 @@ handle_method_call (GDBusConnection *connection,
const gchar *area_id;
gchar *value;
- area_id = g_variant_get_string (parameters, NULL);
+ g_variant_get (parameters, "(&s)", &area_id);
/* FIXME return error */
if (!document_saved)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]