[Gpa-commits] r840 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 7 19:48:49 CET 2008


Author: werner
Date: 2008-03-07 19:48:48 +0100 (Fri, 07 Mar 2008)
New Revision: 840

Modified:
   trunk/src/ChangeLog
   trunk/src/clipboard.c
   trunk/src/gpa.c
   trunk/src/gpacontext.c
   trunk/src/gtktools.c
   trunk/src/gtktools.h
   trunk/src/keylist.c
   trunk/src/keyring.c
   trunk/src/keytable.c
   trunk/src/keytable.h
   trunk/src/recipientdlg.c
Log:
Now with some support for X/509.  
Either run with option --cms or --server.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-03-07 15:01:36 UTC (rev 839)
+++ trunk/src/ChangeLog	2008-03-07 18:48:48 UTC (rev 840)
@@ -1,5 +1,21 @@
 2008-03-07  Werner Koch  <wk at g10code.com>
 
+	* keytable.h (_GpaKeyTable): Add new fields FPR, DID_FIRST_HALF
+	and FIRST_HALF_ERR.
+	* keytable.c (first_half_done_cb): New.
+	(gpa_keytable_init): Connect "done" to that.
+	(reload_cache): Save the fingerprint.
+	(done_cb): Show error from both halfs.
+	* gpa.c: Include signal.h. Enable --cms with --server.
+	(main) [!G_OS_WIN32]: Ignore SIGPIPE.
+
+	* recipientdlg.c (set_column_title, add_tooltip): Remove and
+	factor code out to ..
+	* gtktools.c (gpa_add_tooltip, gpa_set_column_title): .. New.
+	* keylist.c (add_tooltip, set_column_title): Replace be new functions.
+
+	* gpa.c (main) [GLIB < 2.12]:  Do not use the new g_context stuff.
+
 	* selectkeydlg.c (select_key_dlg_new_with_keys): New.
 
 	* keylist.c (gpa_keylist_new_public_only): Rename to ...

Modified: trunk/src/clipboard.c
===================================================================
--- trunk/src/clipboard.c	2008-03-07 15:01:36 UTC (rev 839)
+++ trunk/src/clipboard.c	2008-03-07 18:48:48 UTC (rev 840)
@@ -793,20 +793,23 @@
 }
 
 
+#if 0 /* Disabled, see caller for details.  */
 static void
 toolbar_file_open (GtkWidget *widget, gpointer param)
 {
   file_open (param);
 }
+#endif /*0*/
 
 
+#if 0 /* Disabled, see caller for details.  */
 static void
 toolbar_file_save_as (GtkWidget *widget, gpointer param)
 {
   file_save_as (param);
 }
+#endif /*0*/
 
-
 static void
 toolbar_file_sign (GtkWidget *widget, gpointer param)
 {

Modified: trunk/src/gpa.c
===================================================================
--- trunk/src/gpa.c	2008-03-07 15:01:36 UTC (rev 839)
+++ trunk/src/gpa.c	2008-03-07 18:48:48 UTC (rev 840)
@@ -24,6 +24,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <signal.h>
 
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
@@ -93,11 +94,11 @@
     { "files", 'f', 0, G_OPTION_ARG_NONE, &args.start_file_manager,
       N_("Open filemanager"), NULL },
     { "server", 's', 0, G_OPTION_ARG_NONE, &args.start_only_server,
-      N_("Start only the UI server"), NULL },
+      N_("Start only the UI server (implies --cms)"), NULL },
     { "options", 'o', 0, G_OPTION_ARG_FILENAME, &args.options_filename,
       N_("Read options from file"), "FILE" },
-    { "cms", 'x', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &cms_hack,
-      "Enable CMS hack", NULL },
+    { "cms", 'x', 0, G_OPTION_ARG_NONE, &cms_hack,
+      "Enable CMS/X.509 support", NULL },
     { NULL }
   };
 
@@ -287,10 +288,12 @@
 
   /* Parse command line options.  */
   context = g_option_context_new (N_("[FILE...]"));
+#if GLIB_CHECK_VERSION (2, 12, 0)
   g_option_context_set_summary (context, N_("Graphical frontend to GnuPG"));
   g_option_context_set_description (context, N_("Please report bugs to <"
 						PACKAGE_BUGREPORT ">."));
   g_option_context_set_translation_domain (context, PACKAGE);
+#endif 
   g_option_context_add_main_entries (context, option_entries, PACKAGE);
   g_option_context_add_group (context, gtk_get_option_group (TRUE));
 
@@ -347,10 +350,25 @@
   /* Internationalisation with gtk+-2.0 wants UTF-8 instead of the
      character set determined by locale.  */
   putenv ("OUTPUT_CHARSET=utf8");
+
+  /* We don't want the SIGPIPE.  I wonder why gtk_init does not set it
+     to ignore.  Nobody wants this signal.  */
+  {
+    struct sigaction sa;
+    
+    sa.sa_handler = SIG_IGN;
+    sigemptyset (&sa.sa_mask);
+    sa.sa_flags = 0;
+    sigaction (SIGPIPE, &sa, NULL);
+  }
 #endif
 
+
   /* Handle command line options.  */
 
+  if (args.start_only_server)
+    cms_hack = 1; 
+
   /* Start the keyring editor by default.  */
   if (!args.start_keyring_editor && !args.start_file_manager)
     args.start_keyring_editor = TRUE;

Modified: trunk/src/gpacontext.c
===================================================================
--- trunk/src/gpacontext.c	2008-03-07 15:01:36 UTC (rev 839)
+++ trunk/src/gpacontext.c	2008-03-07 18:48:48 UTC (rev 840)
@@ -192,9 +192,6 @@
   context->io_cbs->event_priv = context;
   /* Set the callbacks */
   gpgme_set_io_cbs (context->ctx, context->io_cbs);
-
-  if (cms_hack)
-    gpgme_set_protocol (context->ctx, GPGME_PROTOCOL_CMS);
 }
 
 static void
@@ -394,7 +391,7 @@
 
 
 /* The event callback.  It is called by GPGME to signal an event for
-   an operation running in this context.  This fucntion merely mits
+   an operation running in this context.  This fucntion merely emits
    signals for GpaContext; the Glib signal handlers do the real
    job.  */
 static void

Modified: trunk/src/gtktools.c
===================================================================
--- trunk/src/gtktools.c	2008-03-07 15:01:36 UTC (rev 839)
+++ trunk/src/gtktools.c	2008-03-07 18:48:48 UTC (rev 840)
@@ -1,23 +1,27 @@
 /* gtktools.c  -  The GNU Privacy Assistant
  *	Copyright (C) 2000, 2001 G-N-U GmbH.
+ *      Copyright (C) 2008 g10 Code GmbH.
  *
  * This file is part of GPA
  *
- * GPA is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * GPA is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
- * GPA is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * GPA is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+ * License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+/* NOTE: Here are a lot of old GTK+ functions and wrappers.  They
+   should be replaced by modern GTK+ code and some of the wrappers are
+   not needed anymore. */
+
 #include <config.h>
 
 #include <stdlib.h>
@@ -30,6 +34,9 @@
 #include "icons.h"
 
 
+/* BEGIN of old unchecked code (wk 2008-03-07) */
+
+
 /* Show all children of the GtkWindow widget, realize it, set its
  * position so that it's in the center of the parent and show the window
  * itself.
@@ -444,3 +451,37 @@
 {
   return gpa_get_save_file_name (parent, title, directory);
 }
+
+
+/* END of old unchecked code (wk 2008-03-07) */
+
+
+
+
+/* Set a tooltip TEXT to WIDGET.  TEXT and WIDGET may both be NULL.
+   This function is useful so that GPA can be build with older GTK+
+   versions.  */ 
+void
+gpa_add_tooltip (GtkWidget *widget, const char *text)
+{
+#if GTK_CHECK_VERSION (2, 12, 0)
+  if (widget && text && *text)
+    gtk_widget_set_tooltip_text (widget, text);
+#endif
+}
+
+/* Set the title of COLUMN to TITLE and also set TOOLTIP. */
+void
+gpa_set_column_title (GtkTreeViewColumn *column,
+                      const char *title, const char *tooltip)
+{
+  GtkWidget *label;
+
+  label = gtk_label_new (title);
+  /* We need to show the label before setting the widget.  */
+  gtk_widget_show (label);
+  gtk_tree_view_column_set_widget (column, label);
+  if (tooltip)
+    gpa_add_tooltip (gtk_tree_view_column_get_widget (column), tooltip);
+}
+

Modified: trunk/src/gtktools.h
===================================================================
--- trunk/src/gtktools.h	2008-03-07 15:01:36 UTC (rev 839)
+++ trunk/src/gtktools.h	2008-03-07 18:48:48 UTC (rev 840)
@@ -59,4 +59,17 @@
 				const gchar * directory);
 gchar * gpa_get_load_file_name (GtkWidget * parent, const gchar * title,
 				const gchar * directory);
+
+
+
+/* Set a tooltip TEXT to WIDGET.  TEXT and WIDGET may both be NULL.
+   This function is useful so that GPA can be build with older GTK+
+   versions.  */ 
+void gpa_add_tooltip (GtkWidget *widget, const char *text);
+
+/* Set the title of COLUMN to TITLE and also set TOOLTIP. */
+void gpa_set_column_title (GtkTreeViewColumn *column,
+                           const char *title, const char *tooltip);
+
+
 #endif /* GTK_TOOLS_H_ */

Modified: trunk/src/keylist.c
===================================================================
--- trunk/src/keylist.c	2008-03-07 15:01:36 UTC (rev 839)
+++ trunk/src/keylist.c	2008-03-07 18:48:48 UTC (rev 840)
@@ -26,6 +26,7 @@
 #include "keylist.h"
 #include "gpapastrings.h"
 #include "gpawidgets.h"
+#include "gtktools.h"
 #include "keytable.h"
 #include "icons.h"
 
@@ -481,29 +482,7 @@
     }
 }
 
-static void
-add_tooltip (GtkWidget *widget, const char *text)
-{
-#if GTK_CHECK_VERSION (2, 12, 0)
-  if (widget && text && *text)
-    gtk_widget_set_tooltip_text (widget, text);
-#endif
-}
 
-static void
-set_column_title (GtkTreeViewColumn *column,
-                  const char *title, const char *tooltip)
-{
-  GtkWidget *label;
-
-  label = gtk_label_new (title);
-  /* We need to show the label before setting the widget.  */
-  gtk_widget_show (label);
-  gtk_tree_view_column_set_widget (column, label);
-  add_tooltip (gtk_tree_view_column_get_widget (column), tooltip);
-}
-
-
 static void 
 setup_columns (GpaKeyList *keylist, gboolean detailed)
 {
@@ -529,7 +508,7 @@
   renderer = gtk_cell_renderer_text_new ();
   column = gtk_tree_view_column_new_with_attributes 
     (NULL, renderer, "text", GPA_KEYLIST_COLUMN_KEYID, NULL);
-  set_column_title 
+  gpa_set_column_title 
     (column, _("Key ID"),
      _("The key ID is a short number to identify a certificate."));
   gtk_tree_view_append_column (GTK_TREE_VIEW (keylist), column);
@@ -541,7 +520,7 @@
       renderer = gtk_cell_renderer_text_new ();
       column = gtk_tree_view_column_new_with_attributes
         (NULL, renderer, "text", GPA_KEYLIST_COLUMN_EXPIRY, NULL);
-      set_column_title 
+      gpa_set_column_title 
         (column, _("Expiry Date"),
          _("The Expiry Date is the date until the certificate is valid."));
       gtk_tree_view_append_column (GTK_TREE_VIEW (keylist), column);
@@ -552,7 +531,7 @@
       renderer = gtk_cell_renderer_text_new ();
       column = gtk_tree_view_column_new_with_attributes 
         (NULL, renderer, "text", GPA_KEYLIST_COLUMN_OWNERTRUST, NULL);
-      set_column_title 
+      gpa_set_column_title 
         (column, _("Owner Trust"),
          _("The Owner Trust has been set by you and describes how far you"
            " trust the holder of the certificate to correctly sign (certify)"
@@ -565,7 +544,7 @@
       renderer = gtk_cell_renderer_text_new ();
       column = gtk_tree_view_column_new_with_attributes
         (NULL, renderer, "text", GPA_KEYLIST_COLUMN_VALIDITY, NULL);
-      set_column_title 
+      gpa_set_column_title 
         (column, _("Validity"), 
          _("The Validity describes the trust level the system has"
            " in this certificate.  That is how sure it is that the named"
@@ -579,7 +558,7 @@
   renderer = gtk_cell_renderer_text_new ();
   column = gtk_tree_view_column_new_with_attributes 
     (NULL, renderer, "text", GPA_KEYLIST_COLUMN_USERID, NULL);
-  set_column_title 
+  gpa_set_column_title 
     (column, _("User Name"),
      _("The User Name is the name and often also the email address "
        " of the certificate."));

Modified: trunk/src/keyring.c
===================================================================
--- trunk/src/keyring.c	2008-03-07 15:01:36 UTC (rev 839)
+++ trunk/src/keyring.c	2008-03-07 18:48:48 UTC (rev 840)
@@ -654,6 +654,7 @@
       GList *selection;
       gpgme_key_t key;
       int old_mode;
+      gpgme_protocol_t oldproto; /* Just to be save.  */
 
       selection = gpa_keylist_get_selected_keys (editor->keylist);
       key = (gpgme_key_t) selection->data;
@@ -662,8 +663,11 @@
       /* With all the signatures.  */
       gpgme_set_keylist_mode (editor->ctx->ctx, 
 			      old_mode | GPGME_KEYLIST_MODE_SIGS);
+      oldproto = gpgme_get_protocol (editor->ctx->ctx);
+      gpgme_set_protocol (editor->ctx->ctx, key->protocol);
       err = gpgme_op_keylist_start (editor->ctx->ctx, key->subkeys->fpr, 
 				    FALSE);
+      gpgme_set_protocol (editor->ctx->ctx, oldproto);
       if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
 	gpa_gpgme_warning (err);
 

Modified: trunk/src/keytable.c
===================================================================
--- trunk/src/keytable.c	2008-03-07 15:01:36 UTC (rev 839)
+++ trunk/src/keytable.c	2008-03-07 18:48:48 UTC (rev 840)
@@ -1,22 +1,21 @@
 /* keytable.c - The GNU Privacy Assistant key table.
    Copyright (C) 2002 Miguel Coca
-   Copyright (C) 2005 g10 Code GmbH.
+   Copyright (C) 2005, 2008 g10 Code GmbH.
 
    This file is part of GPA
 
-   GPA is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   GPA is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
-   GPA is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   GPA is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with GPA; if not, write to the Free Software Foundation,
-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -28,8 +27,8 @@
 #include "gtktools.h"
 
 /* Internal */
-static void done_cb (GpaContext *context, gpg_error_t err,
-		     GpaKeyTable *keytable);
+static void first_half_done_cb (GpaContext *context, gpg_error_t err,
+                                GpaKeyTable *keytable);
 static void next_key_cb (GpaContext *context, gpgme_key_t key,
 			 GpaKeyTable *keytable);
 
@@ -82,19 +81,25 @@
 static void
 gpa_keytable_init (GpaKeyTable *keytable)
 {
+  /* Fixme: Why at all are we zeroing out variables already set to
+     zero at object creation? */
   keytable->next = NULL;
   keytable->end = NULL;
   keytable->data = NULL;
+  keytable->did_first_half = 0;
+  keytable->first_half_err = 0;
   keytable->context = gpa_context_new ();
   keytable->keys = NULL;
   keytable->secret = FALSE;
   keytable->initialized = FALSE;
   keytable->new_key = FALSE;
   keytable->tmp_list = NULL;
+  /* Note, that the next_key and done signals are emitted by means of
+     gpgme events with the help of gpacontext.c:gpa_context_event_cb.  */
   g_signal_connect (G_OBJECT (keytable->context), "next_key",
 		    G_CALLBACK (next_key_cb), keytable);
   g_signal_connect (G_OBJECT (keytable->context), "done",
-		    G_CALLBACK (done_cb), keytable);
+		    G_CALLBACK (first_half_done_cb), keytable);
 }
 
 static void
@@ -114,6 +119,10 @@
 {
   gpg_error_t err;
   
+  /* We select the Open PGP protocol here and later the
+     first_half_done_cb will do another keylist_start for X,509.  */
+  keytable->fpr = fpr;
+  gpgme_set_protocol (keytable->context->ctx, GPGME_PROTOCOL_OpenPGP);
   err = gpgme_op_keylist_start (keytable->context->ctx, fpr,
 				keytable->secret);
   if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
@@ -129,12 +138,14 @@
 }
 
 static void 
-done_cb (GpaContext *context, gpg_error_t err,
-		     GpaKeyTable *keytable)
+done_cb (GpaContext *context, gpg_error_t err, GpaKeyTable *keytable)
 {
-  if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
+  if (err || keytable->first_half_err)
     {
-      gpa_gpgme_warning (err);
+      if (keytable->first_half_err)
+        gpa_gpgme_warning (keytable->first_half_err);
+      if (err)
+        gpa_gpgme_warning (err);
       return;
     }
   /* Reverse the list to have the keys come up in the same order they
@@ -165,10 +176,49 @@
     }
 }
 
+
 static void 
-next_key_cb (GpaContext *context, gpgme_key_t key,
-			 GpaKeyTable *keytable)
+first_half_done_cb (GpaContext *context, gpg_error_t err,
+                    GpaKeyTable *keytable)
 {
+  if (keytable->did_first_half || !cms_hack)
+    {
+      /* We are here for the second time and thus we continue with the
+         real done handler.  We do this also if the CMS_HACK has not
+         been enabled.  We reset the protocol to OpenPGP because some
+         old code might assume that it is in OpenPGP mode.  */
+      keytable->fpr = NULL; /* Not needed anymore.  */
+      gpgme_set_protocol (keytable->context->ctx, GPGME_PROTOCOL_OpenPGP);
+      done_cb (context, err, keytable);
+      return;
+    }
+  
+  /* Now continue with a key listing for X.509 keys put save the error
+     of the the PGP key listing.  */
+  keytable->first_half_err = err;
+  keytable->did_first_half = 1;
+
+  gpgme_set_protocol (context->ctx, GPGME_PROTOCOL_CMS);
+  err = gpgme_op_keylist_start (keytable->context->ctx, 
+                                keytable->fpr,
+				keytable->secret);
+  keytable->fpr = NULL; /* Not needed anymore.  */
+  if (err)
+    {
+      if (keytable->first_half_err)
+        gpa_gpgme_warning (keytable->first_half_err);
+      gpa_gpgme_warning (err);
+      if (keytable->end)
+	{
+	  keytable->end (keytable->data);
+	}
+    }
+}
+
+
+static void 
+next_key_cb (GpaContext *context, gpgme_key_t key, GpaKeyTable *keytable)
+{
   keytable->tmp_list = g_list_prepend (keytable->tmp_list, key);
   gpgme_key_ref (key);
   if (keytable->next)

Modified: trunk/src/keytable.h
===================================================================
--- trunk/src/keytable.h	2008-03-07 15:01:36 UTC (rev 839)
+++ trunk/src/keytable.h	2008-03-07 18:48:48 UTC (rev 840)
@@ -1,22 +1,21 @@
 /* keytable.h - The GNU Privacy Assistant key table.
    Copyright (C) 2002 Miguel Coca
-   Copyright (C) 2005 g10 Code GmbH.
+   Copyright (C) 2005, 2008 g10 Code GmbH.
 
    This file is part of GPA
 
-   GPA is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   GPA is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
-   GPA is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   GPA is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with GPA; if not, write to the Free Software Foundation,
-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Table of all the keys in the keyring.  Singleton object.  Acts as a
    key cache for key listing.  */
@@ -55,6 +54,9 @@
   GpaKeyTableNextFunc next;
   GpaKeyTableEndFunc end;
   gpointer data;
+  const char *fpr;
+  int did_first_half;
+  gpg_error_t first_half_err;
 
   GList *keys, *tmp_list;
 };

Modified: trunk/src/recipientdlg.c
===================================================================
--- trunk/src/recipientdlg.c	2008-03-07 15:01:36 UTC (rev 839)
+++ trunk/src/recipientdlg.c	2008-03-07 18:48:48 UTC (rev 840)
@@ -133,30 +133,8 @@
 
 
 
-static void
-add_tooltip (GtkWidget *widget, const char *text)
-{
-#if GTK_CHECK_VERSION (2, 12, 0)
-  if (widget && text && *text)
-    gtk_widget_set_tooltip_text (widget, text);
-#endif
-}
 
-static void
-set_column_title (GtkTreeViewColumn *column,
-                  const char *title, const char *tooltip)
-{
-  GtkWidget *label;
 
-  label = gtk_label_new (title);
-  /* We need to show the label before setting the widget.  */
-  gtk_widget_show (label);
-  gtk_tree_view_column_set_widget (column, label);
-  add_tooltip (gtk_tree_view_column_get_widget (column), tooltip);
-}
-
-
-
 /* Create the main list of this dialog.  */
 static GtkWidget *
 recplist_window_new (void)
@@ -181,32 +159,35 @@
   renderer = gtk_cell_renderer_text_new ();
   column = gtk_tree_view_column_new_with_attributes 
     (NULL, renderer, "markup", RECPLIST_MAILBOX, NULL);
-  set_column_title (column, _("Recipient"),
-                    _("Shows the recipients of the message."
-                      " A key needs to be assigned to each recipient."));
+  gpa_set_column_title (column, _("Recipient"),
+                        _("Shows the recipients of the message."
+                          " A key needs to be assigned to each recipient."));
   gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
 
   renderer = gtk_cell_renderer_toggle_new ();
   column = gtk_tree_view_column_new_with_attributes
     (NULL, renderer, "active", RECPLIST_HAS_PGP, NULL);
-  set_column_title (column, "PGP", _("Checked if at least one matching"
-                                     " OpenPGP certificate has been found.")); 
+  gpa_set_column_title (column, "PGP",
+                        _("Checked if at least one matching"
+                          " OpenPGP certificate has been found.")); 
   gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
 
   renderer = gtk_cell_renderer_toggle_new ();
   column = gtk_tree_view_column_new_with_attributes
     (NULL, renderer, "active", RECPLIST_HAS_X509, NULL);
-  set_column_title (column, "X.509", _("Checked if at least one matching"
-                                       " X.509 certificate for use with S/MIME"
-                                       " has been found.")); 
+  gpa_set_column_title (column, "X.509",
+                        _("Checked if at least one matching"
+                          " X.509 certificate for use with S/MIME"
+                          " has been found.")); 
   gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
 
   renderer = gtk_cell_renderer_text_new ();
   column = gtk_tree_view_column_new_with_attributes 
     (NULL, renderer, "text", RECPLIST_KEYID, NULL);
-  set_column_title (column, _("Key ID"),
-                    _("Shows the key ID of the selected key or an indication"
-                      " that a key needs to be selected."));
+  gpa_set_column_title (column,
+                        _("Key ID"),
+                        _("Shows the key ID of the selected key or"
+                          " an indication that a key needs to be selected."));
   gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
 
 
@@ -321,7 +302,7 @@
 
   if (missing_keys)
     hint = _("You need to select a key for each recipient.\n"
-             "To select a key you click on the respective line.");
+             "To select a key right-click on the respective line.");
   else if ((sel_protocol == GPGME_PROTOCOL_OpenPGP
             && ambiguous_pgp_keys)
            || (sel_protocol == GPGME_PROTOCOL_CMS
@@ -329,7 +310,7 @@
            || (sel_protocol == GPGME_PROTOCOL_UNKNOWN
                && (ambiguous_pgp_keys || ambiguous_x509_keys )))
     hint = _("You need to select exactly one key for each recipient.\n"
-             "To select a key you click on the respective line.");
+             "To select a key right-click on the respective line.");
   else if ((sel_protocol == GPGME_PROTOCOL_OpenPGP
             && n_keys != n_pgp_keys)
            || (sel_protocol == GPGME_PROTOCOL_CMS
@@ -435,11 +416,11 @@
   if (info->ignore_recipient)
     infostr = NULL;
   else if (any_pgp && any_x509 && info->pgp.keys[1] && info->x509.keys[1])
-    infostr = g_strdup (_("[ambiguous keys - click to select]"));
+    infostr = g_strdup (_("[Ambiguous keys. Right-click to select]"));
   else if (any_pgp && info->pgp.keys[1])
-    infostr = g_strdup (_("[ambiguous PGP key - click to select]"));
+    infostr = g_strdup (_("[Ambiguous PGP key.  Right-click to select]"));
   else if (any_x509 && info->x509.keys[1])
-    infostr = g_strdup (_("[ambiguous X.509 key - click to select]"));
+    infostr = g_strdup (_("[Ambiguous X.509 key. Right-click to select]"));
   else if (any_pgp && !info->pgp.keys[1])
     {
       /* Exactly one key found.  */
@@ -452,7 +433,7 @@
       infostr = gpa_gpgme_key_get_userid (key->uids);
     }
   else
-    infostr = g_strdup (_("[click to select]"));
+    infostr = g_strdup (_("[Right-click to select]"));
 
 
   mailbox = g_markup_printf_escaped ("<span strikethrough='%s'>%s</span>",



More information about the Gpa-commits mailing list