[geary/wip/765516-gtk-widget-conversation-viewer: 58/187] Reenable displaying the "sent but not saved" message.



commit d8b1a89ee65e583aec0f83e6408ee8c23acdba14
Author: Michael James Gratton <mike vee net>
Date:   Thu Apr 21 16:10:51 2016 +1000

    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-viewer/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 4143717..e93111b 100644
--- a/src/client/conversation-viewer/conversation-email.vala
+++ b/src/client/conversation-viewer/conversation-email.vala
@@ -60,6 +60,9 @@ public class ConversationEmail : Gtk.Box {
     private Gtk.InfoBar draft_infobar;
 
     [GtkChild]
+    private Gtk.InfoBar not_saved_infobar;
+
+    [GtkChild]
     private Gtk.Box sub_messages_box;
 
     [GtkChild]
@@ -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 e15e712..8920951 100644
--- a/ui/conversation-email.ui
+++ b/ui/conversation-email.ui
@@ -237,6 +237,80 @@
       <action-widget response="1">button3</action-widget>
     </action-widgets>
   </object>
+  <object class="GtkInfoBar" id="not_saved_infobar">
+    <property name="app_paintable">True</property>
+    <property name="can_focus">False</property>
+    <property name="message_type">warning</property>
+    <child internal-child="action_area">
+      <object class="GtkButtonBox">
+        <property name="can_focus">False</property>
+        <property name="spacing">6</property>
+        <property name="layout_style">end</property>
+        <child>
+          <object class="GtkButton" id="button1">
+            <property name="label" translatable="yes">Try Again</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">False</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child internal-child="content_area">
+      <object class="GtkBox">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">16</property>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Message not saved</property>
+            <property name="xalign">0</property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">This message was sent, but has not been saved your 
account.</property>
+            <property name="xalign">0</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">False</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <action-widgets>
+      <action-widget response="1">button1</action-widget>
+    </action-widgets>
+  </object>
   <object class="GtkBox" id="sub_messages_box">
     <property name="visible">True</property>
     <property name="can_focus">False</property>


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