[geary/wip/save-sent-713263] Add warning blob in message viewer



commit 9db9338c3ff71acefc0a2232bbe4120e2a85247d
Author: Charles Lindsay <chaz yorba org>
Date:   Mon Jan 27 17:13:47 2014 -0800

    Add warning blob in message viewer

 .../conversation-viewer/conversation-viewer.vala   |   14 ++++++++++++++
 theming/message-viewer.css                         |    9 +++++++++
 theming/message-viewer.html                        |    1 +
 3 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-viewer.vala 
b/src/client/conversation-viewer/conversation-viewer.vala
index c1ea5f9..dda315e 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -500,6 +500,19 @@ public class ConversationViewer : Gtk.Box {
         }
         email_to_element.set(email.id, div_message);
         
+        if (email.email_flags.is_outbox_sent()) {
+            WebKit.DOM.HTMLElement email_warning =
+                Util.DOM.select(div_message, ".email_warning");
+            try {
+                ((WebKit.DOM.Element) email_warning).get_class_list().add("show");
+                email_warning.set_inner_html(
+                    _("This message was sent successfully, but could not be saved to %s.").printf(
+                    Geary.SpecialFolderType.SENT.get_display_name()));
+            } catch (Error e) {
+                warning("Error showing outbox warning bar: %s", e.message);
+            }
+        }
+        
         bool remote_images = false;
         try {
             set_message_html(email.get_message(), div_message, out remote_images);
@@ -593,6 +606,7 @@ public class ConversationViewer : Gtk.Box {
         // <div id="$MESSAGE_ID" class="email">
         //     <div class="geary_spacer"></div>
         //     <div class="email_container">
+        //         <div class="email_warning"></div>
         //         <div class="button_bar">
         //             <div class="starred button"><img class="icon" /></div>
         //             <div class="unstarred button"><img class="icon" /></div>
diff --git a/theming/message-viewer.css b/theming/message-viewer.css
index 223af81..38ab886 100644
--- a/theming/message-viewer.css
+++ b/theming/message-viewer.css
@@ -125,6 +125,14 @@ hr {
     -webkit-transition: border-color 3s ease;
     -webkit-transition: box-shadow 3s ease;
 }
+
+.email .email_warning {
+    display: none;
+    padding: 1em;
+    background-color: #fcc;
+    text-align: center;
+}
+
 .email_box {
     box-sizing: border-box;
     -webkit-box-sizing: border-box;
@@ -256,6 +264,7 @@ body:not(.nohide) .email.hide .header_container .avatar {
     body:not(.nohide) .email.hide .email {
         display: none;
     }
+    .email:not(.hide) .email_warning.show,
     body:not(.nohide) .email.hide .header_container .preview {
         display: block;
     }
diff --git a/theming/message-viewer.html b/theming/message-viewer.html
index 46c2c15..7a22310 100644
--- a/theming/message-viewer.html
+++ b/theming/message-viewer.html
@@ -7,6 +7,7 @@
     <div class="compressed_note"><span><span></div>
     <div class="geary_spacer"></div>
     <div class="email_container">
+        <div class="email_warning"></div>
         <div class="header_container">
             <img src="" class="avatar" />
             <div class="button_bar">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]