From 1af11b09b45a22ed8823a1ffafd4e18087619758 Mon Sep 17 00:00:00 2001 From: Michael James Gratton Date: Thu, 21 Apr 2016 16:10:51 +1000 Subject: [PATCH] Reenable displaying the "sent but not saved" message. * src/client/conversation-viewer/conversation-email.vala (ConversationEmail::not_saved_infobar): Add a template widget child for the not-saved info bar, add to ConversationMessage's infobar box and display it when the flag is set. * ui/conversation-email.ui: Add a warning info bar for displaying the message. --- .../conversation-email.vala | 12 ++- ui/conversation-email.ui | 74 +++++++++++++++++++ 2 files changed, 82 insertions(+), 4 deletions(-) diff --git a/src/client/conversation-viewer/conversation-email.vala b/src/client/conversation-viewer/conversation-email.vala index 4143717f..e93111b0 100644 --- a/src/client/conversation-viewer/conversation-email.vala +++ b/src/client/conversation-viewer/conversation-email.vala @@ -59,6 +59,9 @@ public class ConversationEmail : Gtk.Box { [GtkChild] private Gtk.InfoBar draft_infobar; + [GtkChild] + private Gtk.InfoBar not_saved_infobar; + [GtkChild] private Gtk.Box sub_messages_box; @@ -118,6 +121,8 @@ public class ConversationEmail : Gtk.Box { }); } + primary_message.infobar_box.pack_start(not_saved_infobar, false, false, 0); + // if (email.from != null && email.from.contains_normalized(current_account_information.email)) { // // XXX set a RO property? // get_style_context().add_class("sent"); @@ -273,10 +278,9 @@ public class ConversationEmail : Gtk.Box { unstar_button.hide(); } - //if (email.email_flags.is_outbox_sent()) { - // email_warning.set_inner_html( - // _("This message was sent successfully, but could not be saved to %s.").printf( - // Geary.SpecialFolderType.SENT.get_display_name())); + if (flags.is_outbox_sent()) { + not_saved_infobar.show(); + } } private void on_flag_remote_images(ConversationMessage view) { diff --git a/ui/conversation-email.ui b/ui/conversation-email.ui index e15e7122..8920951c 100644 --- a/ui/conversation-email.ui +++ b/ui/conversation-email.ui @@ -237,6 +237,80 @@ button3 + + True + False + warning + + + False + 6 + end + + + Try Again + True + True + True + + + True + True + 0 + + + + + False + False + 0 + + + + + False + vertical + 16 + + + True + False + Message not saved + 0 + + + + + + True + True + 0 + + + + + True + False + This message was sent, but has not been saved your account. + 0 + + + True + True + 1 + + + + + False + False + 0 + + + + button1 + + True False