[git] GPA - branch, master, updated. gpa-0.9.10-19-gfea939b

by Werner Koch cvs at cvs.gnupg.org
Mon Oct 15 13:45:18 CEST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Assistant".

The branch, master has been updated
       via  fea939b6fe082fa2fd8276f7d59f9018e89af0fe (commit)
       via  f5361478e121415e37ef7ebd665f2221ade0d71d (commit)
      from  48a685eec1940f1b325da99040cc532aa66be191 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fea939b6fe082fa2fd8276f7d59f9018e89af0fe
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Oct 15 13:45:07 2018 +0200

    Add context menu to copy the fingerprint(s).
    
    * src/keymanager.c (key_manager_copy_fpr): New.
    (key_manager_action_new): Add popup item
    --
    
    This seems to be a quite useful extension.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/keymanager.c b/src/keymanager.c
index d90fcc7..a352515 100644
--- a/src/keymanager.c
+++ b/src/keymanager.c
@@ -879,6 +879,59 @@ key_manager_copy (GtkAction *action, gpointer param)
 }
 
 
+/* Copy the fingerprints of the keys into the clipboard.  */
+static void
+key_manager_copy_fpr (GtkAction *action, gpointer param)
+{
+  GpaKeyManager *self = param;
+  GList *selection, *item;
+  gpgme_protocol_t prot = GPGME_PROTOCOL_UNKNOWN;
+  gpgme_key_t key;
+  char *buffer = NULL;
+  char *p;
+
+  selection = gpa_keylist_get_selected_keys (self->keylist,
+                                             GPGME_PROTOCOL_UNKNOWN);
+  if (!selection)
+    return;
+
+  for (item = selection; item; item = g_list_next (item))
+    {
+      key = (gpgme_key_t)item->data;
+
+      if (prot == GPGME_PROTOCOL_UNKNOWN)
+        prot = key->protocol;
+      else if (prot != key->protocol)
+        {
+          gpa_window_error
+            (_("Only keys of the same procotol may be copied."), NULL);
+          g_free (buffer);
+          buffer = NULL;
+          break;
+        }
+      if (prot == GPGME_PROTOCOL_UNKNOWN)
+        ;
+      else if (!buffer)
+        buffer = g_strconcat (key->subkeys->fpr, "\n", NULL);
+      else
+        {
+          p = g_strconcat (buffer, key->subkeys->fpr, "\n", NULL);
+          g_free (buffer);
+          buffer = p;
+        }
+    }
+  if (buffer)
+    {
+      gtk_clipboard_set_text (gtk_clipboard_get
+                              (GDK_SELECTION_PRIMARY), buffer, -1);
+      gtk_clipboard_set_text (gtk_clipboard_get
+                              (GDK_SELECTION_CLIPBOARD), buffer, -1);
+    }
+
+  g_free (buffer);
+}
+
+
 /* Reload the key list.  */
 static void
 key_manager_refresh (GtkAction *action, gpointer param)
@@ -922,7 +975,8 @@ key_manager_action_new (GpaKeyManager *self,
                         GtkWidget **menu, GtkWidget **toolbar,
                         GtkWidget **popup)
 {
-  static const GtkActionEntry entries[] =
+  static const
+    GtkActionEntry entries[] =
     {
       /* Toplevel.  */
       { "File", NULL, N_("_File"), NULL },
@@ -941,6 +995,8 @@ key_manager_action_new (GpaKeyManager *self,
       /* Edit menu.  */
       { "EditCopy", GTK_STOCK_COPY, NULL, NULL,
 	N_("Copy the selection"), G_CALLBACK (key_manager_copy) },
+      { "EditCopyFpr", GTK_STOCK_COPY, N_("Copy _Fingerprint"), "<control>F",
+	N_("Copy the fingerprints"), G_CALLBACK (key_manager_copy_fpr) },
       { "EditPaste", GTK_STOCK_PASTE, NULL, NULL,
 	N_("Paste the clipboard"), G_CALLBACK (key_manager_paste) },
       { "EditSelectAll", GTK_STOCK_SELECT_ALL, NULL, "<control>A",
@@ -1065,6 +1121,7 @@ key_manager_action_new (GpaKeyManager *self,
 #endif
     "  </toolbar>"
     "  <popup name='PopupMenu'>"
+    "    <menuitem action='EditCopyFpr'/>"
     "    <menuitem action='EditCopy'/>"
     "    <menuitem action='EditPaste'/>"
     "    <menuitem action='KeysDelete'/>"
@@ -1143,6 +1200,9 @@ key_manager_action_new (GpaKeyManager *self,
   action = gtk_action_group_get_action (action_group, "EditCopy");
   add_selection_sensitive_action (self, action,
                                   key_manager_has_selection);
+  action = gtk_action_group_get_action (action_group, "EditCopyFpr");
+  add_selection_sensitive_action (self, action,
+                                  key_manager_has_selection);
   action = gtk_action_group_get_action (action_group, "KeysDelete");
   add_selection_sensitive_action (self, action,
                                   key_manager_has_selection);

commit f5361478e121415e37ef7ebd665f2221ade0d71d
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Oct 15 12:53:11 2018 +0200

    Show GPGME version in the about dialog.
    
    * src/helpmenu.c (gpa_help_about): Include GPGME version.

diff --git a/src/helpmenu.c b/src/helpmenu.c
index 7e1b1e8..f269f04 100644
--- a/src/helpmenu.c
+++ b/src/helpmenu.c
@@ -83,8 +83,9 @@ gpa_help_about (GtkAction *action, GtkWindow *window)
   for (; engine; engine = engine->next)
     if (engine->protocol == GPGME_PROTOCOL_OpenPGP)
       break;
-  comment = g_strdup_printf ("[%s]\n\n(GnuPG %s)\n\n%s",
+  comment = g_strdup_printf ("[%s]\n\n(GPGME %s)\n(GnuPG %s)\n\n%s",
                              BUILD_REVISION,
+                             gpgme_check_version (NULL),
                              engine? engine->version : "?",
                              _("GPA is the GNU Privacy Assistant."));
   logo = gpa_create_icon_pixbuf ("gpa_logo");

-----------------------------------------------------------------------

Summary of changes:
 src/helpmenu.c   |  3 ++-
 src/keymanager.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 63 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Assistant
http://git.gnupg.org




More information about the Gnupg-commits mailing list