[geary/wip/135-contact-popovers: 2/13] Update conversation message menus and actions for contact popover



commit 53d3b7f085eed8ad694c605b275b8e4e14ceecbd
Author: Michael Gratton <mike vee net>
Date:   Thu Mar 14 17:06:59 2019 +1100

    Update conversation message menus and actions for contact popover
    
    Add new menu items per the design. Rename actions to match and to be
    compliant with action name spec.

 .../conversation-viewer/conversation-message.vala  | 56 +++++++++++++++-------
 ui/conversation-message-menus.ui                   | 42 +++++++++++-----
 2 files changed, 69 insertions(+), 29 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-message.vala 
b/src/client/conversation-viewer/conversation-message.vala
index e8cd4f27..e5800228 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -30,6 +30,22 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
     private const int HIDE_PROGRESS_TIMEOUT_MSEC = 1000;
     private const int PULSE_TIMEOUT_MSEC = 250;
 
+    private const int MAX_INLINE_IMAGE_MAJOR_DIM = 1024;
+
+    private const string ACTION_CONTACT_LOAD_IMAGES = "contact-load-images";
+    private const string ACTION_CONTACT_OPEN = "contact-open";
+    private const string ACTION_CONTACT_SAVE = "contact-save";
+    private const string ACTION_CONTACT_SHOW_CONVERSATIONS =
+        "contact-show-conversations";
+    private const string ACTION_CONVERSATION_NEW = "conversation-new";
+    private const string ACTION_COPY_EMAIL = "copy-email";
+    private const string ACTION_COPY_LINK = "copy-link";
+    private const string ACTION_COPY_SELECTION = "copy-selection";
+    private const string ACTION_OPEN_INSPECTOR = "open-inspector";
+    private const string ACTION_OPEN_LINK = "open-link";
+    private const string ACTION_SAVE_IMAGE = "save-image";
+    private const string ACTION_SELECT_ALL = "select-all";
+
 
     // Widget used to display sender/recipient email addresses in
     // message header Gtk.FlowBox instances.
@@ -135,16 +151,6 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
 
     }
 
-    private const int MAX_INLINE_IMAGE_MAJOR_DIM = 1024;
-
-    private const string ACTION_COPY_EMAIL = "copy_email";
-    private const string ACTION_COPY_LINK = "copy_link";
-    private const string ACTION_COPY_SELECTION = "copy_selection";
-    private const string ACTION_OPEN_INSPECTOR = "open_inspector";
-    private const string ACTION_OPEN_LINK = "open_link";
-    private const string ACTION_SAVE_IMAGE = "save_image";
-    private const string ACTION_SEARCH_FROM = "search_from";
-    private const string ACTION_SELECT_ALL = "select_all";
 
 
     /** Box containing the preview and full header widgets.  */
@@ -226,7 +232,8 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
     private MenuModel context_menu_email;
     private MenuModel context_menu_image;
     private MenuModel context_menu_main;
-    private MenuModel context_menu_contact;
+    private MenuModel context_menu_known_contact;
+    private MenuModel context_menu_unknown_contact;
     private MenuModel? context_menu_inspector = null;
 
     // Address fields that can be search through
@@ -348,6 +355,21 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
 
         // Actions
 
+        add_action(ACTION_CONTACT_LOAD_IMAGES, true, VariantType.BOOLEAN)
+            // XXX
+            ;
+        add_action(ACTION_CONTACT_OPEN, true, VariantType.STRING)
+            // XXX
+            ;
+        add_action(ACTION_CONTACT_SAVE, true, new VariantType("(ss)"))
+            // XXX
+            ;
+            // XXX
+            ;
+        add_action(ACTION_CONTACT_SHOW_CONVERSATIONS, true, VariantType.STRING)
+        add_action(ACTION_CONVERSATION_NEW, true, new VariantType("(ss)"))
+            // XXX
+            ;
         add_action(ACTION_COPY_EMAIL, true, VariantType.STRING)
             .activate.connect(on_copy_email_address);
         add_action(ACTION_COPY_LINK, true, VariantType.STRING)
@@ -362,14 +384,9 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
             .activate.connect(on_link_activated);
         add_action(ACTION_SAVE_IMAGE, true, new VariantType("(sms)"))
             .activate.connect(on_save_image);
-        add_action(ACTION_SEARCH_FROM, true, VariantType.STRING)
-            .activate.connect((param) => {
-                search_activated("from", param.get_string());
-            });
         add_action(ACTION_SELECT_ALL, true).activate.connect(() => {
                 web_view.select_all();
             });
-
         insert_action_group("msg", message_actions);
 
         // Context menu
@@ -381,7 +398,12 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
         context_menu_email = (MenuModel) builder.get_object("context_menu_email");
         context_menu_image = (MenuModel) builder.get_object("context_menu_image");
         context_menu_main = (MenuModel) builder.get_object("context_menu_main");
-        context_menu_contact = (MenuModel) builder.get_object("context_menu_contact");
+        this.context_menu_known_contact = (MenuModel) builder.get_object(
+            "context_menu_known_contact"
+        );
+        this.context_menu_unknown_contact = (MenuModel) builder.get_object(
+            "context_menu_unknown_contact"
+        );
         if (Args.inspector) {
             context_menu_inspector =
                 (MenuModel) builder.get_object("context_menu_inspector");
diff --git a/ui/conversation-message-menus.ui b/ui/conversation-message-menus.ui
index 1385264b..27d70c6d 100644
--- a/ui/conversation-message-menus.ui
+++ b/ui/conversation-message-menus.ui
@@ -5,49 +5,67 @@
     <section id="context_menu_link">
       <item>
         <attribute name="label" translatable="yes">_Open Link</attribute>
-        <attribute name="action">msg.open_link</attribute>
+        <attribute name="action">msg.open-link</attribute>
       </item>
       <item>
         <attribute name="label" translatable="yes">Copy Link _Address</attribute>
-        <attribute name="action">msg.copy_link</attribute>
+        <attribute name="action">msg.copy-link</attribute>
       </item>
     </section>
     <section id="context_menu_email">
       <item>
-        <attribute name="label" translatable="yes">Send New _Message…</attribute>
-        <attribute name="action">msg.open_link</attribute>
+        <attribute name="label" translatable="yes">_New Conversation…</attribute>
+        <attribute name="action">msg.conversation-new</attribute>
       </item>
       <item>
         <attribute name="label" translatable="yes">Copy Email _Address</attribute>
-        <attribute name="action">msg.copy_email</attribute>
+        <attribute name="action">msg.copy-email</attribute>
       </item>
     </section>
     <section id="context_menu_image">
       <item>
         <attribute name="label" translatable="yes">Save _Image As…</attribute>
-        <attribute name="action">msg.save_image</attribute>
+        <attribute name="action">msg.save-image</attribute>
       </item>
     </section>
     <section id="context_menu_main">
       <item>
         <attribute name="label" translatable="yes">_Select All</attribute>
-        <attribute name="action">msg.select_all</attribute>
+        <attribute name="action">msg.select-all</attribute>
       </item>
       <item>
         <attribute name="label" translatable="yes">_Copy</attribute>
-        <attribute name="action">msg.copy_selection</attribute>
+        <attribute name="action">msg.copy-selection</attribute>
       </item>
     </section>
-    <section id="context_menu_contact">
+    <section id="context_menu_known_contact">
       <item>
-        <attribute name="label" translatable="yes">Search for messages from</attribute>
-        <attribute name="action">msg.search_from</attribute>
+        <attribute name="label" translatable="yes">Sho_w Conversations</attribute>
+        <attribute name="action">msg.contact-show-conversations</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">_Open in Contacts…</attribute>
+        <attribute name="action">msg.contact-save</attribute>
+      </item>
+    </section>
+    <section id="context_menu_unknown_contact">
+      <item>
+        <attribute name="label" translatable="yes">Sho_w Conversations</attribute>
+        <attribute name="action">msg.contact-show-conversations</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">Save in Con_tacts…</attribute>
+        <attribute name="action">msg.contact-save</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">Always Load Remote Images</attribute>
+        <attribute name="action">msg.contact-load-images</attribute>
       </item>
     </section>
     <section id="context_menu_inspector">
       <item>
         <attribute name="label" translatable="yes">_Inspect…</attribute>
-        <attribute name="action">msg.open_inspector</attribute>
+        <attribute name="action">msg.open-inspector</attribute>
       </item>
     </section>
   </menu>


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