[Gpa-commits] r839 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 7 16:01:37 CET 2008


Author: werner
Date: 2008-03-07 16:01:36 +0100 (Fri, 07 Mar 2008)
New Revision: 839

Modified:
   trunk/src/ChangeLog
   trunk/src/gpastreamencryptop.c
   trunk/src/gpgmetools.c
   trunk/src/gpgmetools.h
   trunk/src/keylist.c
   trunk/src/keylist.h
   trunk/src/recipientdlg.c
   trunk/src/selectkeydlg.c
   trunk/src/selectkeydlg.h
Log:
Recipient selection does now work.  The only left real problem is that
S/MIME does only work if matching keys haven been found.  Fix will be
included with general X.509 support.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-03-06 22:16:51 UTC (rev 838)
+++ trunk/src/ChangeLog	2008-03-07 15:01:36 UTC (rev 839)
@@ -1,3 +1,19 @@
+2008-03-07  Werner Koch  <wk at g10code.com>
+
+	* selectkeydlg.c (select_key_dlg_new_with_keys): New.
+
+	* keylist.c (gpa_keylist_new_public_only): Rename to ...
+	(gpa_keylist_new_with_keys): .. this and add more parameters.
+	(gpa_keylist_class_init): Add properties PROP_PROTOCOL,
+	PROP_INITIAL_KEYS, PROP_INITIAL_PATTERN.
+	(gpa_keylist_finalize): Release initial_keys.
+	(gpa_keylist_constructor): Fill the list with provided keys.
+
+	* gpgmetools.c (gpa_gpgme_copy_keyarray) 
+	(gpa_gpgme_release_keyarray): New.
+	* gpastreamencryptop.c (release_keys, copy_keys): Remove and
+	replace all callers by the new functions.
+
 2008-03-06  Werner Koch  <wk at g10code.com>
 
 	* keylist.c: Change license to GPLv3+.  Cosmetic changes.

Modified: trunk/src/gpastreamencryptop.c
===================================================================
--- trunk/src/gpastreamencryptop.c	2008-03-06 22:16:51 UTC (rev 838)
+++ trunk/src/gpastreamencryptop.c	2008-03-07 15:01:36 UTC (rev 839)
@@ -106,46 +106,6 @@
 
 
 static void
-release_keys (gpgme_key_t *keys)
-{
-  if (keys)
-    {
-      int idx;
-      
-      for (idx=0; keys[idx]; idx++)
-        gpgme_key_unref (keys[idx]);
-      g_free (keys);
-    }
-}
-
-
-/* Return a copy of the key array.  */
-static gpgme_key_t *
-copy_keys (gpgme_key_t *keys)
-{
-  gpgme_key_t *newarray;
-  int idx;
-
-  if (!keys)
-    return NULL;
-
-  for (idx=0; keys[idx]; idx++)
-    ;
-  idx++;
-  newarray = g_new (gpgme_key_t, idx); 
-  for (idx=0; keys[idx]; idx++)
-    {
-      gpgme_key_ref (keys[idx]);
-      newarray[idx] = keys[idx];
-    }
-  newarray[idx] = NULL;
-
-  return newarray;
-}
-
-
-
-static void
 gpa_stream_encrypt_operation_get_property (GObject *object, guint prop_id,
                                            GValue *value, GParamSpec *pspec)
 {
@@ -201,7 +161,7 @@
 
   release_recipients (op->recipients);
   op->recipients = NULL;
-  release_keys(op->keys);
+  gpa_gpgme_release_keyarray (op->keys);
   op->keys = NULL;
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -443,7 +403,7 @@
     }
 
   /* Get the keys.  */
-  release_keys (op->keys);
+  gpa_gpgme_release_keyarray (op->keys);
   op->keys = NULL;
   op->keys = recipient_dlg_get_keys (op->recp_dialog, &op->selected_protocol);
 
@@ -533,7 +493,7 @@
 		     "input_stream", input_stream,
 		     "output_stream", output_stream,
                      "recipients", copy_recipients (recipients),
-                     "recipient-keys", copy_keys (recp_keys),
+                     "recipient-keys", gpa_gpgme_copy_keyarray (recp_keys),
                      "protocol", (int)protocol,
                      "server-ctx", server_ctx,
 		     NULL);
@@ -552,5 +512,5 @@
   
   if (r_protocol)
     *r_protocol = op->selected_protocol;
-  return copy_keys (op->keys);
+  return gpa_gpgme_copy_keyarray (op->keys);
 }

Modified: trunk/src/gpgmetools.c
===================================================================
--- trunk/src/gpgmetools.c	2008-03-06 22:16:51 UTC (rev 838)
+++ trunk/src/gpgmetools.c	2008-03-07 15:01:36 UTC (rev 839)
@@ -1,22 +1,22 @@
-/* gpgmetools.h - additional gpgme support functions for GPA.
+/* gpgmetools.h - Additional gpgme support functions for GPA.
    Copyright (C) 2002 Miguel Coca.
-   Copyright (C) 2005 g10 Code GmbH.
+   Copyright (C) 2005, 2008 g10 Code GmbH.
 
-   This file is part of GPA.
+   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/>.
+ */
 
 
 /* A set of auxiliary functions for common tasks related to GPGME */
@@ -978,3 +978,44 @@
 	}
     }
 }
+
+
+/* Return a copy of the key array.  */
+gpgme_key_t *
+gpa_gpgme_copy_keyarray (gpgme_key_t *keys)
+{
+  gpgme_key_t *newarray;
+  int idx;
+
+  if (!keys)
+    return NULL;
+
+  for (idx=0; keys[idx]; idx++)
+    ;
+  idx++;
+  newarray = g_new (gpgme_key_t, idx); 
+  for (idx=0; keys[idx]; idx++)
+    {
+      gpgme_key_ref (keys[idx]);
+      newarray[idx] = keys[idx];
+    }
+  newarray[idx] = NULL;
+
+  return newarray;
+}
+
+
+/* Release all keys in the array KEYS as weel as ARRY itself.  */
+void
+gpa_gpgme_release_keyarray (gpgme_key_t *keys)
+{
+  if (keys)
+    {
+      int idx;
+      
+      for (idx=0; keys[idx]; idx++)
+        gpgme_key_unref (keys[idx]);
+      g_free (keys);
+    }
+}
+

Modified: trunk/src/gpgmetools.h
===================================================================
--- trunk/src/gpgmetools.h	2008-03-06 22:16:51 UTC (rev 838)
+++ trunk/src/gpgmetools.h	2008-03-07 15:01:36 UTC (rev 839)
@@ -1,24 +1,23 @@
 /* gpgmetools.h - additional gpgme support functions for GPA.
    Copyright (C) 2002, Miguel Coca.
-   Copyright (C) 2005 g10 Code GmbH.
+   Copyright (C) 2005, 2008 g10 Code GmbH.
 
-   This file is part of GPA.
+   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/>.
+ */
 
-
 /* A set of auxiliary functions for common tasks related to GPGME.  */
 
 #ifndef GPGMETOOLS_H
@@ -175,4 +174,11 @@
 /* Return a string listing the capabilities of a key.  */
 const gchar *gpa_get_key_capabilities_text (gpgme_key_t key);
 
+/* Return a copy of the key array.  */
+gpgme_key_t *gpa_gpgme_copy_keyarray (gpgme_key_t *keys);
+
+/* Release all keys in the array KEYS as weel as ARRY itself.  */
+void gpa_gpgme_release_keyarray (gpgme_key_t *keys);
+
+
 #endif

Modified: trunk/src/keylist.c
===================================================================
--- trunk/src/keylist.c	2008-03-06 22:16:51 UTC (rev 838)
+++ trunk/src/keylist.c	2008-03-07 15:01:36 UTC (rev 839)
@@ -35,7 +35,10 @@
 {
   PROP_0,
   PROP_WINDOW,
-  PROP_PUBLIC_ONLY
+  PROP_PUBLIC_ONLY,
+  PROP_PROTOCOL,
+  PROP_INITIAL_KEYS,
+  PROP_INITIAL_PATTERN
 };
 
 /* GObject */
@@ -90,6 +93,15 @@
     case PROP_PUBLIC_ONLY:
       g_value_set_boolean (value, list->public_only);
       break;
+    case PROP_PROTOCOL:
+      g_value_set_int (value, list->protocol);
+      break;
+    case PROP_INITIAL_KEYS:
+      g_value_set_pointer (value, list->initial_keys);
+      break;
+    case PROP_INITIAL_PATTERN:
+      g_value_set_string (value, list->initial_pattern);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -112,6 +124,15 @@
     case PROP_PUBLIC_ONLY:
       list->public_only = g_value_get_boolean (value);
       break;
+    case PROP_PROTOCOL:
+      list->protocol = g_value_get_int (value);
+      break;
+    case PROP_INITIAL_KEYS:
+      list->initial_keys = (gpgme_key_t*)g_value_get_pointer (value);
+      break;
+    case PROP_INITIAL_PATTERN:
+      list->initial_pattern = g_value_get_string (value);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -126,6 +147,7 @@
   /* Dereference all keys in the list */
   g_list_foreach (list->keys, (GFunc) gpgme_key_unref, NULL);
   g_list_free (list->keys);
+  gpa_gpgme_release_keyarray (list->initial_keys);
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
@@ -175,9 +197,25 @@
   gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
   /* Load the keyring */
   add_trustdb_dialog (list);
-  gpa_keytable_list_keys (gpa_keytable_get_public_instance(),
-			  gpa_keylist_next, gpa_keylist_end, list);
+  if (list->initial_keys)
+    {
+      /* Initialize from the provided list.  */
+      int idx;
+      gpgme_key_t key;
 
+      for (idx=0; (key = list->initial_keys[idx]); idx++)
+        {
+          gpgme_key_ref (key);
+          gpa_keylist_next (key, list);
+        }
+      gpa_keylist_end (list);
+    }
+  else
+    {
+      /* Initialize from the global keytable.  */
+      gpa_keytable_list_keys (gpa_keytable_get_public_instance(),
+                              gpa_keylist_next, gpa_keylist_end, list);
+    }
   return object;
 }
 
@@ -202,6 +240,28 @@
       FALSE,
       G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY));
 
+  g_object_class_install_property 
+    (object_class, PROP_PROTOCOL,
+     g_param_spec_int 
+     ("protocol", "Protocol",
+      "The gpgme protocol used to restruct the key listing.",
+      GPGME_PROTOCOL_OpenPGP, GPGME_PROTOCOL_UNKNOWN, GPGME_PROTOCOL_UNKNOWN,
+      G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY));
+
+  g_object_class_install_property 
+    (object_class, PROP_INITIAL_KEYS,
+     g_param_spec_pointer 
+     ("initial-keys", "Initial-keys",
+      "An array of gpgme_key_t with the initial set of keys or NULL.",
+      G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY));
+
+  g_object_class_install_property 
+    (object_class, PROP_INITIAL_PATTERN,
+     g_param_spec_string 
+     ("initial-pattern", "Initial-pattern",
+      "A string with pattern to be used for a key search or NULL.",
+      NULL,
+      G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY));
 }
 
 
@@ -327,6 +387,7 @@
 }
 
 
+/* Note that this function takes ownership of KEY.  */
 static void 
 gpa_keylist_next (gpgme_key_t key, gpointer data)
 {
@@ -543,14 +604,24 @@
 }
 
 
-/* Create a new key list widget in public_only mode. */
+/* Create a new key list widget.  If PUBLIC_ONLY is set the keylist
+   will be created in public_only mode.  PROTOCOL may be used to
+   resctrict the list to keys of a certain protocol. If KEYS is not
+   NULL, those keys will be displayed instead of listing all.  If
+   PATTERN is not NULL, the serach box will be filled with that
+   pattern */
 GpaKeyList *
-gpa_keylist_new_public_only (GtkWidget *window)
+gpa_keylist_new_with_keys (GtkWidget *window, gboolean public_only,
+                           gpgme_protocol_t protocol,
+                           gpgme_key_t *keys, const char *pattern)
 {
   GpaKeyList *list;
 
   list = g_object_new (GPA_KEYLIST_TYPE,
-                       "public-only", TRUE,
+                       "public-only", public_only,
+                       "protocol", (int)protocol,
+                       "initial-keys", gpa_gpgme_copy_keyarray (keys),
+                       "initial-pattern", pattern,
                        NULL);
 
   return list;

Modified: trunk/src/keylist.h
===================================================================
--- trunk/src/keylist.h	2008-03-06 22:16:51 UTC (rev 838)
+++ trunk/src/keylist.h	2008-03-07 15:01:36 UTC (rev 839)
@@ -50,6 +50,9 @@
   /* Private: Do not use!  FIXME: We should hide all instance
      variables.  */
   gboolean public_only;
+  gpgme_protocol_t protocol;
+  gpgme_key_t *initial_keys;
+  const char *initial_pattern;
 };
 
 struct _GpaKeyListClass {
@@ -66,8 +69,12 @@
 /* Create a new key list widget.  */
 GtkWidget *gpa_keylist_new (GtkWidget * window);
 
-/* Create a new key list widget in public only mode.  */
-GpaKeyList *gpa_keylist_new_public_only (GtkWidget *window);
+/* Create a new key list widget with optional arguments.  */
+GpaKeyList *gpa_keylist_new_with_keys (GtkWidget *window,
+                                       gboolean public_only,
+                                       gpgme_protocol_t protocol,
+                                       gpgme_key_t *keys,
+                                       const char *pattern);
 
 /* Set the key list in "brief" mode.  */
 void gpa_keylist_set_brief (GpaKeyList * keylist);

Modified: trunk/src/recipientdlg.c
===================================================================
--- trunk/src/recipientdlg.c	2008-03-06 22:16:51 UTC (rev 838)
+++ trunk/src/recipientdlg.c	2008-03-07 15:01:36 UTC (rev 839)
@@ -705,12 +705,19 @@
       gtk_tree_model_get (model, &iter, RECPLIST_USERDATA, &info, -1);
       if (info)
         {
-          seldlg = select_key_dlg_new (GTK_WIDGET (dialog));
+          gpgme_key_t *keys;
+
           if (protocol == GPGME_PROTOCOL_OpenPGP)
-            select_key_dlg_set_keys (seldlg, info->pgp.keys, protocol);
+            keys = info->pgp.keys;
           else if (protocol == GPGME_PROTOCOL_CMS)
-            select_key_dlg_set_keys (seldlg, info->x509.keys, protocol);
-          
+            keys = info->x509.keys;
+          else
+            keys = NULL;
+
+          seldlg = select_key_dlg_new_with_keys (GTK_WIDGET (dialog),
+                                                 protocol,
+                                                 keys,
+                                                 info->mailbox);
           g_signal_connect (G_OBJECT (seldlg), "response",
                             G_CALLBACK (select_key_response_cb), dialog);
           gtk_widget_show_all (GTK_WIDGET (seldlg));
@@ -820,7 +827,7 @@
     {
       {_("/Select _PGP key..."), NULL, recplist_popup_pgp, 0, NULL},
       {_("/Select _S\\/MIME key..."), NULL, recplist_popup_x509, 0, NULL},
-      {_("/_Ignore this key"), NULL, recplist_popup_ignore, 0, NULL},
+      {_("/Toggle _Ignore flag"), NULL, recplist_popup_ignore, 0, NULL},
     };
   //  GtkWidget *item;
 

Modified: trunk/src/selectkeydlg.c
===================================================================
--- trunk/src/selectkeydlg.c	2008-03-06 22:16:51 UTC (rev 838)
+++ trunk/src/selectkeydlg.c	2008-03-07 15:01:36 UTC (rev 839)
@@ -32,6 +32,10 @@
   GtkDialog parent;
   
   GpaKeyList *keylist;
+
+  gpgme_protocol_t protocol;
+  gpgme_key_t *initial_keys;
+  const char *initial_pattern;
 };
 
 
@@ -51,16 +55,15 @@
   {
     PROP_0,
     PROP_WINDOW,
-    PROP_FORCE_ARMOR
+    PROP_PROTOCOL,
+    PROP_INITIAL_KEYS,
+    PROP_INITIAL_PATTERN
   };
 
 
 
+
 
-
-
-
-
 /* Signal handler for selection changes of the keylist.  */
 static void
 keylist_selection_changed_cb (GtkTreeSelection *treeselection, 
@@ -95,6 +98,15 @@
       g_value_set_object (value,
 			  gtk_window_get_transient_for (GTK_WINDOW (dialog)));
       break;
+    case PROP_PROTOCOL:
+      g_value_set_int (value, dialog->protocol);
+      break;
+    case PROP_INITIAL_KEYS:
+      g_value_set_pointer (value, dialog->initial_keys);
+      break;
+    case PROP_INITIAL_PATTERN:
+      g_value_set_string (value, dialog->initial_pattern);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -114,6 +126,15 @@
       gtk_window_set_transient_for (GTK_WINDOW (dialog),
 				    g_value_get_object (value));
       break;
+    case PROP_PROTOCOL:
+      dialog->protocol = g_value_get_int (value);
+      break;
+    case PROP_INITIAL_KEYS:
+      dialog->initial_keys = (gpgme_key_t*)g_value_get_pointer (value);
+      break;
+    case PROP_INITIAL_PATTERN:
+      dialog->initial_pattern = g_value_get_string (value);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -124,7 +145,13 @@
 static void
 select_key_dlg_finalize (GObject *object)
 {  
+  SelectKeyDlg *dialog = SELECT_KEY_DLG (object);
+
+  gpa_gpgme_release_keyarray (dialog->initial_keys);
+
   /* Fixme:  Release the store.  */
+
+
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -174,9 +201,19 @@
   gtk_box_pack_start (GTK_BOX (vbox), scroller, TRUE, TRUE, 0);
   gtk_widget_set_size_request (scroller, 400, 200);
 
-  dialog->keylist = gpa_keylist_new_public_only (GTK_WIDGET (dialog));
+  /* Create the keylist and initialize if with our initial keys.
+     Because we don't need them then anymore, release our own copy of
+     the keys.  */
+  dialog->keylist = gpa_keylist_new_with_keys (GTK_WIDGET (dialog),
+                                               TRUE,
+                                               dialog->protocol,
+                                               dialog->initial_keys,
+                                               dialog->initial_pattern);
+  gpa_gpgme_release_keyarray (dialog->initial_keys);
+  dialog->initial_keys = NULL;
   gtk_container_add (GTK_CONTAINER (scroller), GTK_WIDGET(dialog->keylist));
 
+
   g_signal_connect (G_OBJECT (gtk_tree_view_get_selection 
 			      (GTK_TREE_VIEW (dialog->keylist))),
 		    "changed",
@@ -207,6 +244,28 @@
       "Parent window", GTK_TYPE_WIDGET,
       G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
 
+  g_object_class_install_property 
+    (object_class, PROP_PROTOCOL,
+     g_param_spec_int 
+     ("protocol", "Protocol",
+      "The gpgme protocol used to restruct the key listing.",
+      GPGME_PROTOCOL_OpenPGP, GPGME_PROTOCOL_UNKNOWN, GPGME_PROTOCOL_UNKNOWN,
+      G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY));
+
+  g_object_class_install_property 
+    (object_class, PROP_INITIAL_KEYS,
+     g_param_spec_pointer 
+     ("initial-keys", "Initial-keys",
+      "An array of gpgme_key_t with the initial set of keys or NULL.",
+      G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY));
+
+  g_object_class_install_property 
+    (object_class, PROP_INITIAL_PATTERN,
+     g_param_spec_string 
+     ("initial-pattern", "Initial-pattern",
+      "A string with pattern to be used for the search boxor NULL.",
+      NULL,
+      G_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY));
 }
 
 
@@ -258,64 +317,27 @@
 }
 
 
-/* Fill the list with KEYS.  PROTOCOL may be used to retsitc the
-   search to one type of keys.  To allow all keys, use
-   GPGME_PROTOCOL_UNKNOWN.  */
-void 
-select_key_dlg_set_keys (SelectKeyDlg *dialog, gpgme_key_t *keys,
-                         gpgme_protocol_t protocol)
+/* Same as select_key_dlg_new but with the options to select the
+   protocol and to set initial keys and a search string.  */
+SelectKeyDlg *
+select_key_dlg_new_with_keys (GtkWidget *parent,
+                              gpgme_protocol_t protocol,
+                              gpgme_key_t *keys, const char *pattern)
 {
-/*   GtkListStore *store; */
-/*   GSList *recp; */
-/*   GtkTreeIter iter; */
-/*   const char *name; */
-/*   GtkWidget *widget; */
+  SelectKeyDlg *dialog;
 
-/*   g_return_if_fail (dialog); */
+  dialog = g_object_new (SELECT_KEY_DLG_TYPE,
+                         "window", parent,
+                         "protocol", (int)protocol,
+                         "initial-keys", gpa_gpgme_copy_keyarray (keys),
+                         "initial-pattern", pattern,
+                         NULL);
 
-/*   if (protocol == GPGME_PROTOCOL_OpenPGP) */
-/*     widget = dialog->radio_pgp; */
-/*   else if (protocol == GPGME_PROTOCOL_CMS) */
-/*     widget = dialog->radio_x509; */
-/*   else */
-/*     widget = NULL; */
-/*   if (widget) */
-/*     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); */
+  return dialog;
+}
 
-/*   if (widget != dialog->radio_auto) */
-/*     { */
-/*       gtk_widget_set_sensitive (GTK_WIDGET (dialog->radio_pgp), FALSE);   */
-/*       gtk_widget_set_sensitive (GTK_WIDGET (dialog->radio_x509), FALSE);   */
-/*     } */
-  
-/*   store = GTK_LIST_STORE (gtk_tree_view_get_model */
-/*                           (GTK_TREE_VIEW (dialog->clist_keys))); */
 
-/*   gtk_list_store_clear (store); */
-/*   for (recp = recipients; recp; recp = g_slist_next (recp)) */
-/*     { */
-/*       name = recp->data; */
-/*       if (name && *name) */
-/*         { */
-/*           struct userdata_s *info = g_malloc0 (sizeof *info); */
-          
-/*           gtk_list_store_append (store, &iter); */
-/*           gtk_list_store_set (store, &iter, */
-/*                               RECPLIST_MAILBOX, name, */
-/*                               RECPLIST_HAS_PGP, FALSE, */
-/*                               RECPLIST_HAS_X509, FALSE, */
-/*                               RECPLIST_KEYID,  g_strdup (""), */
-/*                               RECPLIST_USERDATA, info, */
-/*                               -1); */
-/*         }     */
-/*     } */
 
-/*   parse_recipients (store); */
-/*   dialog->disable_update_statushint--; */
-/*   update_statushint (dialog); */
-}
-
-
 /* Return the selected key.  */
 gpgme_key_t
 select_key_dlg_get_key (SelectKeyDlg *dialog)

Modified: trunk/src/selectkeydlg.h
===================================================================
--- trunk/src/selectkeydlg.h	2008-03-06 22:16:51 UTC (rev 838)
+++ trunk/src/selectkeydlg.h	2008-03-07 15:01:36 UTC (rev 839)
@@ -103,9 +103,11 @@
  ************************************/
 
 SelectKeyDlg *select_key_dlg_new (GtkWidget *parent);
-void select_key_dlg_set_keys (SelectKeyDlg *dialog,
-                              gpgme_key_t *keys,
-                              gpgme_protocol_t protocol);
+SelectKeyDlg *select_key_dlg_new_with_keys (GtkWidget *parent,
+                                            gpgme_protocol_t protocol,
+                                            gpgme_key_t *keys,
+                                            const char *pattern);
+
 gpgme_key_t select_key_dlg_get_key (SelectKeyDlg *dialog);
 
 



More information about the Gpa-commits mailing list