From 5097938caedad28eb4667e34fc8e661c1154e2fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Dapena=20Paz?= Date: Mon, 8 Feb 2010 18:15:59 +0100 Subject: [PATCH] New method modest_ui_actions_reply_calendar_with_subject. --- src/modest-plugin-ui-actions.h | 15 +++++++++++++++ src/modest-ui-actions.c | 14 ++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/modest-plugin-ui-actions.h b/src/modest-plugin-ui-actions.h index 021d2b6..883cee3 100644 --- a/src/modest-plugin-ui-actions.h +++ b/src/modest-plugin-ui-actions.h @@ -80,6 +80,21 @@ void modest_ui_actions_reply_calendar (ModestWindow *win, TnyList *header_pairs); /** + * modest_ui_actions_reply_calendar_with_subject: + * @win: parent #ModestWindow + * @subject: a string, or %NULL to use default reply subject + * @header_pairs: #TnyList of #TnyPair of header pairs + * + * this method opens the mail composer with a reply of a message with calendar + * allowing to add @header_pairs with the result of the calendar request. + * + * @win should be a #ModestMsgViewWindow. We don't put the exact type to avoid + * exporting to plugins #ModestMsgViewWindow API + */ +void +modest_ui_actions_reply_calendar_with_subject (ModestWindow *win, const gchar *custom_subject, TnyList *header_pairs); + +/** * modest_ui_actions_on_send_msg: * @window: parent window requesting to send the message * @msg: a #TnyMsg diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index cd632fb..971820e 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -2228,6 +2228,12 @@ reply_forward (ReplyForwardAction action, ModestWindow *win) void modest_ui_actions_reply_calendar (ModestWindow *win, TnyList *header_pairs) { + modest_ui_actions_reply_calendar_with_subject (win, NULL, header_pairs); +} + +void +modest_ui_actions_reply_calendar_with_subject (ModestWindow *win, const gchar *custom_subject, TnyList *header_pairs) +{ gchar *from; gchar *recipient; gchar *signature; @@ -2275,6 +2281,14 @@ modest_ui_actions_reply_calendar (ModestWindow *win, TnyList *header_pairs) goto cleanup; } + if (custom_subject) { + TnyHeader *new_msg_header; + + new_msg_header = tny_msg_get_header (new_msg); + tny_header_set_subject (new_msg_header, custom_subject); + g_object_unref (new_msg_header); + } + msg_win = (GtkWidget *) modest_msg_edit_window_new (new_msg, account_name, mailbox, FALSE); mgr = modest_runtime_get_window_mgr (); modest_window_mgr_register_window (mgr, MODEST_WINDOW (msg_win), (ModestWindow *) win); -- 1.7.9.5