X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-gtkhtml-msg-view.c;h=8f8b2cef8de7ea3c29226831fae80334c11495d3;hp=2bcb91434db9b0d15ed8bedc48749f163c877d6d;hb=38454a69440197510b16c5a5444e19f234c91690;hpb=447325db0e7e6875532b9deed321d238c1b96da5 diff --git a/src/widgets/modest-gtkhtml-msg-view.c b/src/widgets/modest-gtkhtml-msg-view.c index 2bcb914..8f8b2ce 100644 --- a/src/widgets/modest-gtkhtml-msg-view.c +++ b/src/widgets/modest-gtkhtml-msg-view.c @@ -250,9 +250,9 @@ struct _ModestGtkhtmlMsgViewPrivate { #ifdef MODEST_TOOLKIT_HILDON2 GtkWidget *priority_box; GtkWidget *priority_icon; +#endif GtkWidget *calendar_box; GtkWidget *calendar_icon; -#endif GtkWidget *calendar_actions_box; GtkWidget *calendar_actions_container; @@ -1224,7 +1224,7 @@ modest_gtkhtml_msg_view_init (ModestGtkhtmlMsgView *obj) G_CALLBACK (html_adjustment_changed), obj); gtk_widget_push_composite_child (); - priv->headers_box = gtk_vbox_new (FALSE, MODEST_MARGIN_DEFAULT); + priv->headers_box = gtk_vbox_new (FALSE, 0); gtk_widget_set_composite_name (priv->headers_box, "headers"); gtk_widget_pop_composite_child (); @@ -1243,6 +1243,7 @@ modest_gtkhtml_msg_view_init (ModestGtkhtmlMsgView *obj) gtk_widget_hide_all (priv->priority_box); } +#endif priv->calendar_actions_box = NULL; priv->calendar_icon = gtk_image_new (); gtk_image_set_from_icon_name (GTK_IMAGE (priv->calendar_icon), MODEST_HEADER_ICON_CALENDAR, GTK_ICON_SIZE_MENU); @@ -1250,13 +1251,13 @@ modest_gtkhtml_msg_view_init (ModestGtkhtmlMsgView *obj) if (priv->calendar_icon) { priv->calendar_box = (GtkWidget *) modest_mail_header_view_add_custom_header (MODEST_MAIL_HEADER_VIEW (priv->mail_header_view), - _("TODO: invitation"), + _("mail_fi_invitation"), priv->calendar_icon, FALSE, FALSE); gtk_widget_hide_all (priv->calendar_box); } -#endif + if (priv->attachments_view) { #ifndef MODEST_TOOLKIT_HILDON2 gchar *att_label = g_strconcat (_("mcen_me_viewer_attachments"), ":", NULL); @@ -1275,6 +1276,7 @@ modest_gtkhtml_msg_view_init (ModestGtkhtmlMsgView *obj) priv->calendar_actions_container = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (priv->headers_box), priv->calendar_actions_container, FALSE, FALSE, 0); + gtk_widget_hide (priv->calendar_actions_container); gtk_widget_hide_all (priv->calendar_actions_container); gtk_widget_set_no_show_all (priv->calendar_actions_container, TRUE); @@ -1846,8 +1848,9 @@ set_message (ModestGtkhtmlMsgView *self, TnyMsg *msg, TnyMimePart *other_body) gtk_widget_hide_all (priv->attachments_box); #ifdef MODEST_TOOKIT_HILDON2 gtk_widget_hide_all (priv->priority_box); - gtk_widget_hide_all (priv->calendar_box); #endif + gtk_widget_hide_all (priv->calendar_box); + gtk_widget_hide (priv->calendar_actions_container); gtk_widget_hide_all (priv->calendar_actions_container); gtk_widget_set_no_show_all (priv->mail_header_view, TRUE); tny_mime_part_view_clear (TNY_MIME_PART_VIEW (priv->body_view)); @@ -1928,16 +1931,16 @@ set_message (ModestGtkhtmlMsgView *self, TnyMsg *msg, TnyMimePart *other_body) gtk_widget_show (priv->body_view); #ifdef MODEST_TOOLKIT_HILDON2 gtk_widget_set_no_show_all (priv->priority_box, TRUE); - gtk_widget_set_no_show_all (priv->calendar_box, TRUE); #endif + gtk_widget_set_no_show_all (priv->calendar_box, TRUE); gtk_widget_set_no_show_all (priv->calendar_actions_container, TRUE); gtk_widget_set_no_show_all (priv->attachments_box, TRUE); gtk_widget_show_all (priv->mail_header_view); gtk_widget_set_no_show_all (priv->attachments_box, FALSE); #ifdef MODEST_TOOLKIT_HILDON2 gtk_widget_set_no_show_all (priv->priority_box, FALSE); - gtk_widget_set_no_show_all (priv->calendar_box, FALSE); #endif + gtk_widget_set_no_show_all (priv->calendar_box, FALSE); gtk_widget_set_no_show_all (priv->calendar_actions_container, FALSE); gtk_widget_set_no_show_all (priv->mail_header_view, TRUE); @@ -2021,8 +2024,9 @@ set_header (ModestGtkhtmlMsgView *self, TnyHeader *header) gtk_widget_hide_all (priv->attachments_box); #ifdef MODEST_TOOLKIT_HILDON2 gtk_widget_hide_all (priv->priority_box); - gtk_widget_hide_all (priv->calendar_box); #endif + gtk_widget_hide_all (priv->calendar_box); + gtk_widget_hide (priv->calendar_actions_container); gtk_widget_hide_all (priv->calendar_actions_container); gtk_widget_set_no_show_all (priv->mail_header_view, TRUE); tny_mime_part_view_clear (TNY_MIME_PART_VIEW (priv->body_view)); @@ -2794,6 +2798,8 @@ set_calendar (ModestGtkhtmlMsgView *self, TnyHeader *header, TnyMsg *msg) g_return_if_fail (MODEST_IS_GTKHTML_MSG_VIEW (self)); priv = MODEST_GTKHTML_MSG_VIEW_GET_PRIVATE (self); + gtk_widget_hide (priv->calendar_actions_container); + gtk_widget_hide_all (priv->calendar_actions_container); if (priv->calendar_actions_box) { gtk_widget_destroy (priv->calendar_actions_box); priv->calendar_actions_box = NULL; @@ -2807,19 +2813,23 @@ set_calendar (ModestGtkhtmlMsgView *self, TnyHeader *header, TnyMsg *msg) gtk_box_pack_start (GTK_BOX (priv->calendar_actions_container), priv->calendar_actions_box, FALSE, FALSE, 0); g_signal_emit_by_name (G_OBJECT (self), "handle-calendar", calendar_part, priv->calendar_actions_box, &retval); if (retval) { + gtk_widget_show (priv->calendar_actions_container); gtk_widget_show_all (priv->calendar_actions_container); gtk_widget_show (priv->calendar_actions_box); + gtk_widget_show_all (priv->calendar_actions_box); } else { + gtk_widget_hide (priv->calendar_actions_container); gtk_widget_hide_all (priv->calendar_actions_container); gtk_widget_hide (priv->calendar_actions_box); + gtk_widget_hide_all (priv->calendar_actions_box); } gtk_widget_show_all (priv->calendar_box); g_object_unref (calendar_part); } else { gtk_widget_hide_all (priv->calendar_box); + gtk_widget_hide (priv->calendar_actions_container); gtk_widget_hide_all (priv->calendar_actions_container); - gtk_widget_hide (priv->calendar_actions_box); + if (priv->calendar_actions_box) + gtk_widget_hide (priv->calendar_actions_box); } - - }