[geary/wip/279-convo-list-context-labels: 2/4] Update ConversationList's context menu



commit 399330fcc32f152a275e667cf234a94d54643d0e
Author: Michael Gratton <mike vee net>
Date:   Sun Aug 4 12:47:39 2019 +1000

    Update ConversationList's context menu
    
    Show Delete menu item instead of Trash when Shift is down, use ngettext
    to show the correct plural form for both.
    
    See #279

 .../conversation-list/conversation-list-view.vala  | 24 ++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/src/client/conversation-list/conversation-list-view.vala 
b/src/client/conversation-list/conversation-list-view.vala
index 9a18ee7f..12a5da3a 100644
--- a/src/client/conversation-list/conversation-list-view.vala
+++ b/src/client/conversation-list/conversation-list-view.vala
@@ -318,8 +318,28 @@ public class ConversationListView : Gtk.TreeView, Geary.BaseInterface {
         if (event.button == 3 && event.type == Gdk.EventType.BUTTON_PRESS) {
             Geary.App.Conversation conversation = get_model().get_conversation_at_path(path);
 
-            Menu context_menu_model = new Menu();
-            context_menu_model.append(_("Delete conversation"), 
"win."+Application.Controller.ACTION_DELETE_CONVERSATION);
+            GLib.Menu context_menu_model = new GLib.Menu();
+            if (!this.main_window.is_shift_down) {
+                context_menu_model.append(
+                    /// Translators: Context menu item
+                    ngettext(
+                        "Move conversation to _Trash",
+                        "Move conversations to _Trash",
+                        this.selected.size
+                    ),
+                    "win." + Application.Controller.ACTION_ARCHIVE_CONVERSATION
+                );
+            } else {
+                context_menu_model.append(
+                    /// Translators: Context menu item
+                    ngettext(
+                        "_Delete conversation",
+                        "_Delete conversations",
+                        this.selected.size
+                    ),
+                    "win." + Application.Controller.ACTION_DELETE_CONVERSATION
+                );
+            }
 
             if (conversation.is_unread())
                 context_menu_model.append(_("Mark as _Read"), 
"win."+Application.Controller.ACTION_MARK_AS_READ);


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