[evolution] Bug 787002 - Add shortcuts for Labels



commit 5f626e0448e0afbb744f328e2a5393b55f1393c6
Author: Milan Crha <mcrha redhat com>
Date:   Fri Sep 1 09:08:41 2017 +0200

    Bug 787002 - Add shortcuts for Labels

 data/ui/evolution-mail.ui                    |    2 +-
 src/modules/mail/e-mail-shell-view-actions.c |   14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/evolution-mail.ui b/data/ui/evolution-mail.ui
index edf2d07..c031026 100644
--- a/data/ui/evolution-mail.ui
+++ b/data/ui/evolution-mail.ui
@@ -105,7 +105,7 @@
     <menuitem action='mail-popup-account-empty-junk'/>
     <menuitem action='mail-popup-account-expunge'/>
   </popup>
-  <popup name='mail-message-popup'>
+  <popup name='mail-message-popup' accelerators='true'>
     <placeholder name='mail-message-popup-common-actions'/>
     <separator/>
     <menuitem action='mail-popup-delete'/>
diff --git a/src/modules/mail/e-mail-shell-view-actions.c b/src/modules/mail/e-mail-shell-view-actions.c
index 80c4726..351deac 100644
--- a/src/modules/mail/e-mail-shell-view-actions.c
+++ b/src/modules/mail/e-mail-shell-view-actions.c
@@ -1779,7 +1779,7 @@ static GtkActionEntry mail_entries[] = {
          /* Translators: "None" is used in the message label context menu.
           *              It removes all labels from the selected messages. */
          N_("N_one"),
-         NULL,
+         "0",
          NULL,  /* XXX Add a tooltip! */
          G_CALLBACK (action_mail_label_none_cb) },
 
@@ -2560,7 +2560,17 @@ e_mail_shell_view_update_popup_labels (EMailShellView *mail_shell_view)
 
                /* The action group takes ownership of the action. */
                action = GTK_ACTION (label_action);
-               gtk_action_group_add_action (action_group, action);
+
+               if (ii + 1 < 10) {
+                       gchar accel[5];
+
+                       accel[0] = '1' + ii;
+                       accel[1] = '\0';
+
+                       gtk_action_group_add_action_with_accel (action_group, action, accel);
+               } else {
+                       gtk_action_group_add_action (action_group, action);
+               }
                g_object_unref (label_action);
 
                gtk_ui_manager_add_ui (


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