seahorse r2188 - in trunk: . common daemon gkr help/ru libseahorse pgp po src ssh



Author: nnielsen
Date: Mon Apr 21 02:31:58 2008
New Revision: 2188
URL: http://svn.gnome.org/viewvc/seahorse?rev=2188&view=rev

Log:
	* Initial part of refactoring into components.


Added:
   trunk/common/   (props changed)
   trunk/common/Makefile.am
   trunk/common/sea-cleanup.c
   trunk/common/sea-cleanup.h
   trunk/common/sea-registry.c
   trunk/common/sea-registry.h
   trunk/gkr/   (props changed)
   trunk/gkr/Makefile.am
   trunk/gkr/seahorse-gkeyring-item.c
      - copied, changed from r2186, /trunk/src/seahorse-gkeyring-item.c
   trunk/gkr/seahorse-gkeyring-item.h
      - copied unchanged from r2186, /trunk/src/seahorse-gkeyring-item.h
   trunk/gkr/seahorse-gkeyring-operation.c
      - copied, changed from r2186, /trunk/src/seahorse-gkeyring-operation.c
   trunk/gkr/seahorse-gkeyring-operation.h
      - copied unchanged from r2186, /trunk/src/seahorse-gkeyring-operation.h
   trunk/gkr/seahorse-gkeyring-source.c
      - copied, changed from r2186, /trunk/src/seahorse-gkeyring-source.c
   trunk/gkr/seahorse-gkeyring-source.h
      - copied unchanged from r2186, /trunk/src/seahorse-gkeyring-source.h
   trunk/pgp/   (props changed)
   trunk/pgp/Makefile.am
   trunk/pgp/sea-pgp-dialogs.h
      - copied, changed from r2186, /trunk/libseahorse/seahorse-libdialogs.h
   trunk/pgp/sea-pgp-keysets.c
   trunk/pgp/sea-pgp-keysets.h
   trunk/pgp/sea-pgp.c
   trunk/pgp/sea-pgp.h
   trunk/pgp/seahorse-gpg-options.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-gpg-options.c
   trunk/pgp/seahorse-gpg-options.h
      - copied unchanged from r2186, /trunk/libseahorse/seahorse-gpg-options.h
   trunk/pgp/seahorse-gpgmex-op.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-gpgmex-op.c
   trunk/pgp/seahorse-gpgmex-util.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-gpgmex-util.c
   trunk/pgp/seahorse-gpgmex.h
      - copied, changed from r2186, /trunk/libseahorse/seahorse-gpgmex.h
   trunk/pgp/seahorse-hkp-source.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-hkp-source.c
   trunk/pgp/seahorse-hkp-source.h
      - copied unchanged from r2186, /trunk/libseahorse/seahorse-hkp-source.h
   trunk/pgp/seahorse-ldap-source.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-ldap-source.c
   trunk/pgp/seahorse-ldap-source.h
      - copied unchanged from r2186, /trunk/libseahorse/seahorse-ldap-source.h
   trunk/pgp/seahorse-pgp-key-op.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-pgp-key-op.c
   trunk/pgp/seahorse-pgp-key-op.h
      - copied, changed from r2186, /trunk/libseahorse/seahorse-pgp-key-op.h
   trunk/pgp/seahorse-pgp-key.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-pgp-key.c
   trunk/pgp/seahorse-pgp-key.h
      - copied, changed from r2186, /trunk/libseahorse/seahorse-pgp-key.h
   trunk/pgp/seahorse-pgp-operation.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-pgp-operation.c
   trunk/pgp/seahorse-pgp-operation.h
      - copied, changed from r2186, /trunk/libseahorse/seahorse-pgp-operation.h
   trunk/pgp/seahorse-pgp-source.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-pgp-source.c
   trunk/pgp/seahorse-pgp-source.h
      - copied, changed from r2186, /trunk/libseahorse/seahorse-pgp-source.h
   trunk/pgp/seahorse-server-source.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-server-source.c
   trunk/pgp/seahorse-server-source.h
      - copied unchanged from r2186, /trunk/libseahorse/seahorse-server-source.h
   trunk/pgp/seahorse-signer.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-signer.c
   trunk/pgp/seahorse-signer.glade
      - copied unchanged from r2186, /trunk/libseahorse/seahorse-signer.glade
   trunk/ssh/   (props changed)
   trunk/ssh/Makefile.am
   trunk/ssh/sea-ssh.c
   trunk/ssh/sea-ssh.h
   trunk/ssh/seahorse-algo.c
      - copied unchanged from r2186, /trunk/libseahorse/seahorse-algo.c
   trunk/ssh/seahorse-algo.h
      - copied unchanged from r2186, /trunk/libseahorse/seahorse-algo.h
   trunk/ssh/seahorse-ssh-askpass.c
      - copied unchanged from r2186, /trunk/libseahorse/seahorse-ssh-askpass.c
   trunk/ssh/seahorse-ssh-key-data.c
      - copied unchanged from r2186, /trunk/libseahorse/seahorse-ssh-key-data.c
   trunk/ssh/seahorse-ssh-key-data.h
      - copied unchanged from r2186, /trunk/libseahorse/seahorse-ssh-key-data.h
   trunk/ssh/seahorse-ssh-key.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-ssh-key.c
   trunk/ssh/seahorse-ssh-key.h
      - copied, changed from r2186, /trunk/libseahorse/seahorse-ssh-key.h
   trunk/ssh/seahorse-ssh-operation.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-ssh-operation.c
   trunk/ssh/seahorse-ssh-operation.h
      - copied unchanged from r2186, /trunk/libseahorse/seahorse-ssh-operation.h
   trunk/ssh/seahorse-ssh-source.c
      - copied, changed from r2186, /trunk/libseahorse/seahorse-ssh-source.c
   trunk/ssh/seahorse-ssh-source.h
      - copied, changed from r2186, /trunk/libseahorse/seahorse-ssh-source.h
Removed:
   trunk/libseahorse/seahorse-algo.c
   trunk/libseahorse/seahorse-algo.h
   trunk/libseahorse/seahorse-gpg-options.c
   trunk/libseahorse/seahorse-gpg-options.h
   trunk/libseahorse/seahorse-gpgmex-op.c
   trunk/libseahorse/seahorse-gpgmex-util.c
   trunk/libseahorse/seahorse-gpgmex.h
   trunk/libseahorse/seahorse-hkp-source.c
   trunk/libseahorse/seahorse-hkp-source.h
   trunk/libseahorse/seahorse-ldap-source.c
   trunk/libseahorse/seahorse-ldap-source.h
   trunk/libseahorse/seahorse-pgp-key-op.c
   trunk/libseahorse/seahorse-pgp-key-op.h
   trunk/libseahorse/seahorse-pgp-key.c
   trunk/libseahorse/seahorse-pgp-key.h
   trunk/libseahorse/seahorse-pgp-operation.c
   trunk/libseahorse/seahorse-pgp-operation.h
   trunk/libseahorse/seahorse-pgp-source.c
   trunk/libseahorse/seahorse-pgp-source.h
   trunk/libseahorse/seahorse-server-source.c
   trunk/libseahorse/seahorse-server-source.h
   trunk/libseahorse/seahorse-signer.c
   trunk/libseahorse/seahorse-signer.glade
   trunk/libseahorse/seahorse-ssh-askpass.c
   trunk/libseahorse/seahorse-ssh-key-data.c
   trunk/libseahorse/seahorse-ssh-key-data.h
   trunk/libseahorse/seahorse-ssh-key.c
   trunk/libseahorse/seahorse-ssh-key.h
   trunk/libseahorse/seahorse-ssh-operation.c
   trunk/libseahorse/seahorse-ssh-operation.h
   trunk/libseahorse/seahorse-ssh-source.c
   trunk/libseahorse/seahorse-ssh-source.h
   trunk/src/seahorse-gkeyring-item.c
   trunk/src/seahorse-gkeyring-item.h
   trunk/src/seahorse-gkeyring-operation.c
   trunk/src/seahorse-gkeyring-operation.h
   trunk/src/seahorse-gkeyring-source.c
   trunk/src/seahorse-gkeyring-source.h
   trunk/src/seahorse-pgp-encrypted.desktop.in.in
   trunk/src/seahorse-pgp-keys.desktop.in.in
   trunk/src/seahorse-pgp-signature.desktop.in.in
Modified:
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/configure.in
   trunk/daemon/Makefile.am
   trunk/daemon/seahorse-hkp-server.c
   trunk/daemon/seahorse-service-crypto.c
   trunk/daemon/seahorse-service-keyset.c
   trunk/daemon/seahorse-service.c
   trunk/help/ru/   (props changed)
   trunk/libseahorse/Makefile.am
   trunk/libseahorse/seahorse-context.c
   trunk/libseahorse/seahorse-context.h
   trunk/libseahorse/seahorse-dns-sd.c
   trunk/libseahorse/seahorse-key-source.c
   trunk/libseahorse/seahorse-key-source.h
   trunk/libseahorse/seahorse-key.h
   trunk/libseahorse/seahorse-keyserver-control.c
   trunk/libseahorse/seahorse-keyset.c
   trunk/libseahorse/seahorse-keyset.h
   trunk/libseahorse/seahorse-libdialogs.h
   trunk/libseahorse/seahorse-notification.c
   trunk/libseahorse/seahorse-passphrase.c
   trunk/libseahorse/seahorse-passphrase.h
   trunk/libseahorse/seahorse-prefs.c
   trunk/libseahorse/seahorse-transfer-operation.c
   trunk/libseahorse/seahorse-unknown-source.c
   trunk/libseahorse/seahorse-util.c
   trunk/libseahorse/seahorse-util.h
   trunk/libseahorse/seahorse-validity.c
   trunk/libseahorse/seahorse-validity.h
   trunk/libseahorse/seahorse-vfs-data.c
   trunk/po/POTFILES.in
   trunk/po/POTFILES.skip
   trunk/src/Makefile.am
   trunk/src/main.c
   trunk/src/seahorse-add-subkey.c
   trunk/src/seahorse-add-uid.c
   trunk/src/seahorse-delete.c
   trunk/src/seahorse-expires.c
   trunk/src/seahorse-generate-select.c
   trunk/src/seahorse-gkeyring-item-properties.c
   trunk/src/seahorse-key-dialogs.h
   trunk/src/seahorse-key-manager-store.c
   trunk/src/seahorse-key-manager.c
   trunk/src/seahorse-key-properties.c
   trunk/src/seahorse-keyserver-results.c
   trunk/src/seahorse-keyserver-search.c
   trunk/src/seahorse-keyserver-sync.c
   trunk/src/seahorse-pgp-generate.c
   trunk/src/seahorse-photos.c
   trunk/src/seahorse-revoke.c
   trunk/src/seahorse-sign.c
   trunk/src/seahorse-ssh-generate.c
   trunk/src/seahorse-ssh-key-properties.c
   trunk/src/seahorse-ssh-upload.c
   trunk/src/seahorse-windows.h

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Mon Apr 21 02:31:58 2008
@@ -2,14 +2,25 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = libcryptui \
-          libseahorse \
-          src \
-          po \
-          data \
-          help \
-          pixmaps \
-          daemon 
+if WITH_SSH
+SSH_DIR = ssh
+else
+SSH_DIR = 
+endif
+
+SUBDIRS = \
+	libcryptui \
+	common \
+	libseahorse \
+	gkr \
+	pgp \
+	$(SSH_DIR) \
+	src \
+	po \
+	data \
+	help \
+	pixmaps \
+	daemon 
 
 EXTRA_DIST = \
     AUTHORS \

Added: trunk/common/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/common/Makefile.am	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,13 @@
+
+localedir = $(datadir)/locale
+
+INCLUDES = -I$(top_builddir) \
+	-I$(top_srcdir) \
+	$(SEAHORSE_CFLAGS)
+
+noinst_LTLIBRARIES = libsea-common.la
+
+libsea_common_la_SOURCES = \
+	sea-cleanup.c sea-cleanup.h \
+	sea-registry.c sea-registry.h
+	
\ No newline at end of file

Added: trunk/common/sea-cleanup.c
==============================================================================
--- (empty file)
+++ trunk/common/sea-cleanup.c	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,88 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* sea-cleanup.c - for data cleanup at end of program
+
+   Copyright (C) 2007 Stefan Walter
+
+   The Gnome Keyring Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The Gnome Keyring Library 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the Gnome Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+
+   Author: Stef Walter <stef memberwebs com>
+*/
+
+#include "sea-cleanup.h"
+
+typedef struct _SeaCleanup {
+	GDestroyNotify notify;
+	gpointer user_data;
+} SeaCleanup; 
+
+static GSList *registered_cleanups = NULL;
+
+void    
+sea_cleanup_register (GDestroyNotify notify, gpointer user_data)
+{
+	SeaCleanup *cleanup = g_new0 (SeaCleanup, 1);
+	
+	g_assert (notify);
+	cleanup->notify = notify;
+	cleanup->user_data = user_data;
+	
+	/* Note we're reversing the order, so calls happen that way */
+	registered_cleanups = g_slist_prepend (registered_cleanups, cleanup);
+}
+
+void
+sea_cleanup_unregister (GDestroyNotify notify, gpointer user_data)
+{
+	SeaCleanup *cleanup;
+	GSList *l;
+	
+	for (l = registered_cleanups; l; l = g_slist_next (l)) {
+		cleanup = (SeaCleanup*)l->data;
+		if (cleanup->notify == notify && cleanup->user_data == user_data) {
+			registered_cleanups = g_slist_remove (registered_cleanups, cleanup);
+			break;
+		}
+	}
+}
+
+
+void    
+sea_cleanup_perform (void)
+{
+	GSList *cleanups, *l;
+	SeaCleanup *cleanup;
+	
+	while (registered_cleanups) {
+		
+		/* 
+		 * While performing cleanups, more cleanups may be registered.
+		 * So swap out the list, and keep going until empty.
+		 */
+	 
+		cleanups = registered_cleanups;
+		registered_cleanups = NULL;
+		
+		for (l = cleanups; l; l = g_slist_next (l)) {
+			cleanup = (SeaCleanup*)l->data;
+			g_assert (cleanup->notify);
+			
+			(cleanup->notify) (cleanup->user_data);
+			g_free (cleanup);
+		}
+		
+		g_slist_free (cleanups);
+	}
+}

Added: trunk/common/sea-cleanup.h
==============================================================================
--- (empty file)
+++ trunk/common/sea-cleanup.h	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,35 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* sea-cleanup.h - for data cleanup at end of program
+
+   Copyright (C) 2007 Stefan Walter
+
+   The Gnome Keyring Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The Gnome Keyring Library 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the Gnome Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+
+   Author: Stef Walter <stef memberwebs com>
+*/
+
+#ifndef GKRCLEANUP_H_
+#define GKRCLEANUP_H_
+
+#include <glib.h>
+
+void    sea_cleanup_register        (GDestroyNotify notify, gpointer user_data);
+
+void    sea_cleanup_unregister      (GDestroyNotify notify, gpointer user_data);
+
+void    sea_cleanup_perform         (void);
+
+#endif /* GKRCLEANUP_H_ */

Added: trunk/common/sea-registry.c
==============================================================================
--- (empty file)
+++ trunk/common/sea-registry.c	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,244 @@
+
+#include "sea-cleanup.h"
+#include "sea-registry.h"
+
+typedef struct _SeaRegistryPrivate SeaRegistryPrivate;
+
+struct _SeaRegistryPrivate {
+	GHashTable *categories;
+};
+
+#define SEA_REGISTRY_GET_PRIVATE(o) \
+	(G_TYPE_INSTANCE_GET_PRIVATE((o), SEA_TYPE_REGISTRY, SeaRegistryPrivate))
+
+G_DEFINE_TYPE(SeaRegistry, sea_registry, G_TYPE_OBJECT);
+
+static SeaRegistry *registry_singleton = NULL; 
+
+#define NO_VALUE (GUINT_TO_POINTER(1))
+
+/* -----------------------------------------------------------------------------
+ * HELPERS
+ */
+
+static void
+cleanup_registry (void *unused)
+{
+	g_assert (registry_singleton);
+	g_object_unref (registry_singleton);
+	registry_singleton = NULL;
+}
+
+static void
+keys_to_list (gpointer key, gpointer value, gpointer user_data)
+{
+	GList** list = user_data;
+	*list = g_list_prepend (*list, key);
+}
+
+static void
+register_type_for_category (SeaRegistry *registry, const gchar *category, GType type)
+{
+	SeaRegistryPrivate *pv = SEA_REGISTRY_GET_PRIVATE (registry);
+	GHashTable *set;
+	
+	g_return_if_fail (SEA_IS_REGISTRY (registry));
+	g_return_if_fail (category);
+	g_return_if_fail (category[0]);
+	
+	set = g_hash_table_lookup (pv->categories, category);
+	if (!set) {
+		set = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);
+		g_hash_table_replace (pv->categories, g_strdup (category), set);
+	}
+	
+	g_hash_table_replace (set, GUINT_TO_POINTER (type), NO_VALUE);
+}
+
+static GList*
+lookup_types (SeaRegistry *registry, const gchar *category, va_list cats)
+{
+	SeaRegistryPrivate *pv = SEA_REGISTRY_GET_PRIVATE (registry);
+	GList *l, *type, *types = NULL;
+	GHashTable *set;
+	
+	g_return_val_if_fail (SEA_IS_REGISTRY (registry), NULL);
+	g_return_val_if_fail (category, NULL);
+	g_return_val_if_fail (category[0], NULL);
+	
+	/* Get the first category */
+	set = g_hash_table_lookup (pv->categories, category);
+	if (!set)
+		return NULL;
+	
+	/* Transfer all of that into the list */
+	g_hash_table_foreach (set, keys_to_list, &types);
+	
+	/* 
+	 * Go through the other categories and remove any in results
+	 * which we don't find.
+	 */
+	for (;;) {
+		category = va_arg (cats, const gchar*);
+		if (!category)
+			break;
+		g_return_val_if_fail (category[0], NULL);
+		
+		/* Lookup this category */
+		set = g_hash_table_lookup (pv->categories, category);
+		
+		/* No category, no matches */
+		if (!set) {
+			g_list_free (types);
+			return NULL;
+		}
+		
+		/* Go through each item in list and make sure it exists in this cat */
+		for (l = types; l; l = l ? g_list_next (l) : types) {
+			type = l;
+			if (!g_hash_table_lookup (set, type->data)) {
+				l = g_list_previous (l);
+				types = g_list_delete_link (types, type);
+			}
+		}
+	}
+	
+	return types;
+}
+
+/* -----------------------------------------------------------------------------
+ * OBJECT
+ */
+
+static void
+sea_registry_init (SeaRegistry *obj)
+{
+	SeaRegistryPrivate *pv = SEA_REGISTRY_GET_PRIVATE (obj);
+	pv->categories = g_hash_table_new_full (g_str_hash, g_str_equal, 
+	                                        g_free, (GDestroyNotify)g_hash_table_destroy);
+}
+
+static void
+sea_registry_dispose (GObject *obj)
+{
+	SeaRegistryPrivate *pv = SEA_REGISTRY_GET_PRIVATE (obj);
+	g_hash_table_remove_all (pv->categories);
+	G_OBJECT_CLASS (sea_registry_parent_class)->dispose (obj);
+}
+
+static void
+sea_registry_finalize (GObject *obj)
+{
+	SeaRegistryPrivate *pv = SEA_REGISTRY_GET_PRIVATE (obj);
+	g_hash_table_destroy (pv->categories);
+	G_OBJECT_CLASS (sea_registry_parent_class)->finalize (obj);
+}
+
+static void
+sea_registry_class_init (SeaRegistryClass *klass)
+{
+	GObjectClass *gobject_class;
+	gobject_class = (GObjectClass*)klass;
+
+	sea_registry_parent_class = g_type_class_peek_parent (klass);
+	gobject_class->dispose = sea_registry_dispose;
+	gobject_class->finalize = sea_registry_finalize;
+
+	g_type_class_add_private (gobject_class, sizeof (SeaRegistryPrivate));
+}
+
+/* -------------------------------------------------------------------------------
+ * PUBLIC 
+ */
+
+SeaRegistry*
+sea_registry_get (void)
+{
+	if (!registry_singleton) {
+		registry_singleton = g_object_new (SEA_TYPE_REGISTRY, NULL);
+		sea_cleanup_register (cleanup_registry, NULL);
+	}
+	
+	return registry_singleton;
+}
+
+void
+sea_registry_load_types (SeaRegistry *registry, SeaRegisterType *types)
+{
+	GType type;
+	gpointer klass;
+	
+	while (*types) {
+		type = (*types) ();
+		g_return_if_fail (type);
+		
+		klass = g_type_class_ref (type);
+		g_type_class_unref (klass);
+	}
+}
+
+void
+sea_registry_register_type (SeaRegistry *registry, GType type, 
+                            const gchar *category, ...)
+{
+	va_list cats;
+
+	if (!registry)
+		registry = sea_registry_get ();
+	
+	g_return_if_fail (SEA_IS_REGISTRY (registry));
+	g_return_if_fail (type);
+	g_return_if_fail (category);
+
+	register_type_for_category (registry, category, type);
+	
+	va_start (cats, category);
+	for (;;) {
+		category = va_arg (cats, const gchar*);
+		if (!category)
+			break;
+		register_type_for_category (registry, category, type);
+	}
+	va_end (cats);
+}
+
+GType
+sea_registry_find_type (SeaRegistry *registry, const gchar *category, ...)
+{
+	va_list cats;
+	GList *types;
+	GType type;
+	
+	if (!registry)
+		registry = sea_registry_get ();
+	
+	g_return_val_if_fail (SEA_IS_REGISTRY (registry), 0);
+
+	va_start (cats, category);
+	types = lookup_types (registry, category, cats);
+	va_end (cats);
+
+	type = 0;
+	if (types)
+		type = GPOINTER_TO_UINT (types->data);
+	g_list_free (types);
+	return type;
+}
+
+GList*
+sea_registry_find_types (SeaRegistry *registry, const gchar *category, ...)
+{
+	va_list cats;
+	GList *types;
+	
+	if (!registry)
+		registry = sea_registry_get ();
+	
+	g_return_val_if_fail (SEA_IS_REGISTRY (registry), NULL);
+
+	va_start (cats, category);
+	types = lookup_types (registry, category, cats);
+	va_end (cats);
+	
+	return types;
+}

Added: trunk/common/sea-registry.h
==============================================================================
--- (empty file)
+++ trunk/common/sea-registry.h	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,50 @@
+#ifndef SEAHORSEREGISTRY_H_
+#define SEAHORSEREGISTRY_H_
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+typedef GType (*SeaRegisterType) (void);
+
+#define SEA_TYPE_REGISTRY             (sea_registry_get_type())
+#define SEA_REGISTRY(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), SEA_TYPE_REGISTRY, SeaRegistry))
+#define SEA_REGISTRY_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), SEA_TYPE_REGISTRY, GObject))
+#define SEA_IS_REGISTRY(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), SEA_TYPE_REGISTRY))
+#define SEA_IS_REGISTRY_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), SEA_TYPE_REGISTRY))
+#define SEA_REGISTRY_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), SEA_TYPE_REGISTRY, SeaRegistryClass))
+
+typedef struct _SeaRegistry      SeaRegistry;
+typedef struct _SeaRegistryClass SeaRegistryClass;
+
+struct _SeaRegistry {
+	 GObject parent;
+};
+
+struct _SeaRegistryClass {
+	GObjectClass parent_class;
+};
+
+/* member functions */
+GType                sea_registry_get_type        (void) G_GNUC_CONST;
+
+SeaRegistry*         sea_registry_get             (void);
+
+void                 sea_registry_load_types      (SeaRegistry *registry, 
+                                                   SeaRegisterType *types);
+
+void                 sea_registry_register_type   (SeaRegistry *registry, 
+                                                   GType type, const gchar *category, 
+                                                   ...) G_GNUC_NULL_TERMINATED;
+
+GType                sea_registry_find_type       (SeaRegistry *registry, 
+                                                   const gchar *category,
+                                                   ...) G_GNUC_NULL_TERMINATED;
+
+GList*               sea_registry_find_types      (SeaRegistry *registry, 
+                                                   const gchar *category,
+                                                   ...) G_GNUC_NULL_TERMINATED;
+
+G_END_DECLS
+
+#endif /*SEAHORSEREGISTRY_H_*/

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Mon Apr 21 02:31:58 2008
@@ -494,10 +494,13 @@
 AC_OUTPUT([
 Makefile
 seahorse.spec
+common/Makefile
+gkr/Makefile
 libcryptui/cryptui.pc
 libcryptui/Makefile
 libcryptui/tests/Makefile
 libseahorse/Makefile
+pgp/Makefile
 po/Makefile.in
 help/Makefile
 data/Makefile
@@ -507,9 +510,7 @@
 pixmaps/scalable/Makefile
 src/Makefile
 src/seahorse.desktop.in
-src/seahorse-pgp-encrypted.desktop.in
-src/seahorse-pgp-keys.desktop.in
-src/seahorse-pgp-signature.desktop.in
+ssh/Makefile
 daemon/Makefile
 ])
 

Modified: trunk/daemon/Makefile.am
==============================================================================
--- trunk/daemon/Makefile.am	(original)
+++ trunk/daemon/Makefile.am	Mon Apr 21 02:31:58 2008
@@ -34,9 +34,12 @@
     $(SHARING_SRCS)
 
 seahorse_daemon_LDADD = \
-    $(top_builddir)/libseahorse/libseahorse.a \
-    $(top_builddir)/libcryptui/libcryptui.la \
-    $(SEAHORSE_LIBS)
+	$(top_builddir)/libseahorse/libseahorse.la \
+	$(top_builddir)/pgp/libsea-pgp.la \
+	$(top_builddir)/ssh/libsea-ssh.la \
+	$(top_builddir)/common/libsea-common.la \
+	$(top_builddir)/libcryptui/libcryptui.la \
+	$(SEAHORSE_LIBS)
 
 man_MANS = seahorse-daemon.1
 

Modified: trunk/daemon/seahorse-hkp-server.c
==============================================================================
--- trunk/daemon/seahorse-hkp-server.c	(original)
+++ trunk/daemon/seahorse-hkp-server.c	Mon Apr 21 02:31:58 2008
@@ -23,9 +23,10 @@
 #include <libsoup/soup.h>
 
 #include "config.h"
-#include "seahorse-gpgmex.h"
 #include "seahorse-daemon.h"
 
+#include "pgp/seahorse-gpgmex.h"
+
 /* 
  * DEBUG: Set to number other than zero, in order to run HKP 
  * server on a specific port 

Modified: trunk/daemon/seahorse-service-crypto.c
==============================================================================
--- trunk/daemon/seahorse-service-crypto.c	(original)
+++ trunk/daemon/seahorse-service-crypto.c	Mon Apr 21 02:31:58 2008
@@ -23,17 +23,22 @@
 
 #include "seahorse-service.h"
 #include "seahorse-key.h"
-#include "seahorse-pgp-key.h"
-#include "seahorse-pgp-operation.h"
 #include "seahorse-gconf.h"
 #include "seahorse-util.h"
 #include "seahorse-libdialogs.h"
 
+#include "pgp/seahorse-pgp-key.h"
+#include "pgp/seahorse-pgp-operation.h"
+
 /* flags from seahorse-service-cyrpto.xml */
 #define FLAG_QUIET 0x01
 
 G_DEFINE_TYPE (SeahorseServiceCrypto, seahorse_service_crypto, G_TYPE_OBJECT);
 
+/* Note that we can't use GTK stock here, as we hand these icons off 
+   to other processes in the case of notifications */
+#define ICON_PREFIX     DATA_DIR "/pixmaps/seahorse/48x48/"
+
 /* -----------------------------------------------------------------------------
  * PUBLIC METHODS
  */
@@ -88,6 +93,114 @@
     }
 }
 
+static gpgme_key_t* 
+keylist_to_keys (GList *keys)
+{
+	gpgme_key_t *recips;
+	int i;
+
+	recips = g_new0 (gpgme_key_t, g_list_length (keys) + 1);
+
+	for (i = 0; keys != NULL; keys = g_list_next (keys), i++) {
+		g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (keys->data), recips);
+		recips[i] = SEAHORSE_PGP_KEY (keys->data)->pubkey;
+		gpgmex_key_ref (recips[i]);
+	}
+
+	return recips;
+}
+
+static void
+notify_signatures (const gchar* data, gpgme_verify_result_t status)
+{
+	const gchar *icon = NULL;
+	gchar *title, *body;
+	gboolean sig = FALSE;
+	GSList *rawids;
+	GList *keys;
+	SeahorseKey *skey;
+
+	/* Discover the key in question */
+	rawids = g_slist_append (NULL, status->signatures->fpr);
+	keys = seahorse_context_discover_keys (SCTX_APP (), SEA_PGP, rawids);
+	g_slist_free (rawids);
+
+	g_return_if_fail (keys != NULL);
+	skey = SEAHORSE_KEY (keys->data);
+	g_list_free (keys);
+
+	/* Figure out what to display */
+	switch (gpgme_err_code (status->signatures->status)) {
+	case GPG_ERR_KEY_EXPIRED:
+		/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
+		body = _("Signed by <i><key id='%s'/> <b>expired</b></i> on %s.");
+		title = _("Invalid Signature");
+		icon = ICON_PREFIX "seahorse-sign-bad.png";
+		sig = TRUE;
+		break;
+		/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
+	case GPG_ERR_SIG_EXPIRED:
+		body  = _("Signed by <i><key id='%s'/></i> on %s <b>Expired</b>.");
+		title = _("Expired Signature");
+		icon = ICON_PREFIX "seahorse-sign-bad.png";
+		sig = TRUE;
+		break;
+		/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
+	case GPG_ERR_CERT_REVOKED:
+		body = _("Signed by <i><key id='%s'/> <b>Revoked</b></i> on %s.");
+		title = _("Revoked Signature");
+		icon = ICON_PREFIX "seahorse-sign-bad.png";
+		sig = TRUE;
+		break;
+	case GPG_ERR_NO_ERROR:
+		/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
+		body = _("Signed by <i><key id='%s'/></i> on %s.");
+		title = _("Good Signature");
+		icon = ICON_PREFIX "seahorse-sign-ok.png";
+		sig = TRUE;
+		break;
+	case GPG_ERR_NO_PUBKEY:
+		body = _("Signing key not in keyring.");
+		title = _("Unknown Signature");
+		icon = ICON_PREFIX "seahorse-sign-unknown.png";
+		break;
+	case GPG_ERR_BAD_SIGNATURE:
+		body = _("Bad or forged signature. The signed data was modified.");
+		title = _("Bad Signature");
+		icon = ICON_PREFIX "seahorse-sign-bad.png";
+		break;
+	case GPG_ERR_NO_DATA:
+		return;
+	default:
+		if (!GPG_IS_OK (status->signatures->status))
+			seahorse_util_handle_gpgme (status->signatures->status, 
+			                            _("Couldn't verify signature."));
+		return;
+	};
+
+	if (sig) {
+		gchar *date = seahorse_util_get_display_date_string (status->signatures->timestamp);
+		gchar *id = seahorse_context_keyid_to_dbus (SCTX_APP (), seahorse_key_get_keyid (skey), 0);
+		body = g_markup_printf_escaped (body, id, date);
+		g_free (date);
+		g_free (id);
+	} else {
+		body = g_strdup (body);
+	}
+
+	if (data) {
+		data = seahorse_util_uri_get_last (data);
+		title = g_strdup_printf ("%s: %s", data, title);
+	} else {
+		title = g_strdup (title);
+	}
+
+	seahorse_notification_display (title, body, !sig, icon, NULL);
+
+	g_free(title);
+	g_free(body);
+}    
+
 /* -----------------------------------------------------------------------------
  * DBUS METHODS 
  */
@@ -177,7 +290,7 @@
     }
 
     /* Make keys into the right format for GPGME */
-    recips = seahorse_util_keylist_to_keys (recipkeys);
+    recips = keylist_to_keys (recipkeys);
     g_list_free (recipkeys);
     
     /* Do the encryption */
@@ -272,7 +385,7 @@
     gboolean ret = TRUE;
     GQuark keyid;
     
-    if (!g_str_equal (ktype, g_quark_to_string (SKEY_PGP))) {
+    if (!g_str_equal (ktype, g_quark_to_string (SEA_PGP))) {
         g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID,
                      _("Invalid key type for decryption: %s"), ktype);
         return FALSE;        
@@ -307,7 +420,7 @@
     
         if (status->signatures) {
             if (!(flags & FLAG_QUIET))
-                seahorse_notify_signatures (NULL, status);
+                notify_signatures (NULL, status);
             if (status->signatures->summary & GPGME_SIGSUM_GREEN ||
                 status->signatures->summary & GPGME_SIGSUM_VALID ||
                 status->signatures->summary & GPGME_SIGSUM_KEY_MISSING) {
@@ -335,7 +448,7 @@
     gboolean ret = TRUE;
     GQuark keyid;
     
-    if (!g_str_equal (ktype, g_quark_to_string (SKEY_PGP))) {
+    if (!g_str_equal (ktype, g_quark_to_string (SEA_PGP))) {
         g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID,
                      _("Invalid key type for verifying: %s"), ktype);
         return FALSE;        
@@ -370,7 +483,7 @@
     
         if (status->signatures) {
             if (!(flags & FLAG_QUIET))
-                seahorse_notify_signatures (NULL, status);
+                notify_signatures (NULL, status);
             if (status->signatures->summary & GPGME_SIGSUM_GREEN ||
                 status->signatures->summary & GPGME_SIGSUM_VALID ||
                 status->signatures->summary & GPGME_SIGSUM_KEY_MISSING) {

Modified: trunk/daemon/seahorse-service-keyset.c
==============================================================================
--- trunk/daemon/seahorse-service-keyset.c	(original)
+++ trunk/daemon/seahorse-service-keyset.c	Mon Apr 21 02:31:58 2008
@@ -180,7 +180,7 @@
     
     /* Check to make sure the key ids are valid */
     for (k = keyids; *k; k++) {
-        keyid = seahorse_key_source_cannonical_keyid (keyset->ktype, *k);
+        keyid = seahorse_key_source_canonize_keyid (keyset->ktype, *k);
         if (!keyid) {
             g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID, 
                          _("Invalid key id: %s"), *k);

Modified: trunk/daemon/seahorse-service.c
==============================================================================
--- trunk/daemon/seahorse-service.c	(original)
+++ trunk/daemon/seahorse-service.c	Mon Apr 21 02:31:58 2008
@@ -27,10 +27,11 @@
 #include "seahorse-service.h"
 #include "seahorse-context.h"
 #include "seahorse-key-source.h"
-#include "seahorse-gpgmex.h"
 #include "seahorse-util.h"
 #include "seahorse-libdialogs.h"
 
+#include "pgp/seahorse-gpgmex.h"
+
 #define KEYSET_PATH "/org/gnome/seahorse/keys/%s"
 #define KEYSET_PATH_LOCAL "/org/gnome/seahorse/keys/%s/local"
 

Added: trunk/gkr/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/gkr/Makefile.am	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,23 @@
+
+gladedir = $(datadir)/seahorse/glade/
+localedir = $(datadir)/locale
+seahorselibexecbindir = $(libdir)/seahorse/
+
+INCLUDES = -I$(top_builddir) \
+	-I$(top_srcdir) \
+	-I$(top_srcdir)/libcryptui \
+	-I$(top_srcdir)/libseahorse \
+	$(SEAHORSE_CFLAGS) \
+	-DDATA_DIR=\""$(datadir)"\" \
+	-DSEAHORSE_GLADEDIR=\""$(gladedir)"\" \
+	-DLOCALEDIR=\"$(localedir)\" \
+	-DEXECDIR=\""$(seahorselibexecbindir)"\" \
+	-DLIBCRYPTUI_API_SUBJECT_TO_CHANGE 
+
+noinst_LTLIBRARIES = libsea-gkr.la
+
+libsea_gkr_la_SOURCES = \
+	seahorse-gkeyring-item.c seahorse-gkeyring-item.h \
+	seahorse-gkeyring-source.c seahorse-gkeyring-source.h \
+	seahorse-gkeyring-operation.c seahorse-gkeyring-operation.h
+	
\ No newline at end of file

Copied: trunk/gkr/seahorse-gkeyring-item.c (from r2186, /trunk/src/seahorse-gkeyring-item.c)
==============================================================================
--- /trunk/src/seahorse-gkeyring-item.c	(original)
+++ trunk/gkr/seahorse-gkeyring-item.c	Mon Apr 21 02:31:58 2008
@@ -30,9 +30,9 @@
 #include "seahorse-secure-memory.h"
 
 /* For gnome-keyring secret type ids */
-#include "seahorse-pgp-key.h"
+#include "pgp/seahorse-pgp-key.h"
 #ifdef WITH_SSH
-#include "seahorse-ssh-key.h"
+#include "ssh/seahorse-ssh-key.h"
 #endif 
 
 enum {
@@ -573,10 +573,10 @@
     if (git->attributes) {
         val = seahorse_gkeyring_item_get_attribute (git, "seahorse-key-type");
         if (val) {
-			if (strcmp (val, SKEY_PGP_STR) == 0)
+			if (strcmp (val, SEA_PGP_STR) == 0)
                 return SEAHORSE_GKEYRING_USE_PGP;
 #ifdef WITH_SSH
-            if (strcmp (val, SKEY_SSH_STR) == 0)
+            if (strcmp (val, SEA_SSH_STR) == 0)
                 return SEAHORSE_GKEYRING_USE_SSH;
 #endif
         }

Copied: trunk/gkr/seahorse-gkeyring-operation.c (from r2186, /trunk/src/seahorse-gkeyring-operation.c)
==============================================================================
--- /trunk/src/seahorse-gkeyring-operation.c	(original)
+++ trunk/gkr/seahorse-gkeyring-operation.c	Mon Apr 21 02:31:58 2008
@@ -27,9 +27,10 @@
 
 #include "seahorse-gkeyring-operation.h"
 #include "seahorse-util.h"
-#include "seahorse-gpgmex.h"
 #include "seahorse-passphrase.h"
 
+#include "pgp/seahorse-gpgmex.h"
+
 #include <gnome-keyring.h>
 
 #ifndef DEBUG_OPERATION_ENABLE

Copied: trunk/gkr/seahorse-gkeyring-source.c (from r2186, /trunk/src/seahorse-gkeyring-source.c)
==============================================================================
--- /trunk/src/seahorse-gkeyring-source.c	(original)
+++ trunk/gkr/seahorse-gkeyring-source.c	Mon Apr 21 02:31:58 2008
@@ -32,6 +32,8 @@
 #include "seahorse-passphrase.h"
 #include "seahorse-gkeyring-operation.h"
 
+#include "common/sea-registry.h"
+
 #include <gnome-keyring.h>
 
 /* Override the DEBUG_REFRESH_ENABLE switch here */
@@ -739,6 +741,9 @@
     g_object_class_install_property (gobject_class, PROP_LOCATION,
         g_param_spec_uint ("location", "Key Location", "Where the key is stored. See SeahorseKeyLoc", 
                            0, G_MAXUINT, SKEY_LOC_INVALID, G_PARAM_READABLE));    
+    
+    
+	sea_registry_register_type (NULL, SEAHORSE_TYPE_GKEYRING_SOURCE, "key-source", "local", SKEY_GKEYRING_STR, NULL);
 }
 
 /* -------------------------------------------------------------------------- 

Modified: trunk/libseahorse/Makefile.am
==============================================================================
--- trunk/libseahorse/Makefile.am	(original)
+++ trunk/libseahorse/Makefile.am	Mon Apr 21 02:31:58 2008
@@ -15,46 +15,20 @@
 	-DEXECDIR=\""$(seahorselibexecbindir)"\" \
 	-DLIBCRYPTUI_API_SUBJECT_TO_CHANGE 
 
-noinst_LIBRARIES = libseahorse.a
+noinst_LTLIBRARIES = libseahorse.la
 
 BUILT_SOURCES = \
 	seahorse-marshal.c seahorse-marshal.h
 
-if WITH_LDAP
-LDAP_SRCS = seahorse-ldap-source.c seahorse-ldap-source.h
-else
-LDAP_SRCS = 
-endif
-
-if WITH_HKP
-HKP_SRCS = seahorse-hkp-source.c seahorse-hkp-source.h
-else
-HKP_SRCS =
-endif
-
 if WITH_KEYSERVER
-KEYSERVER_SRCS = seahorse-server-source.c seahorse-server-source.h 
-KEYSERVER_SRCS += seahorse-keyserver-control.c seahorse-keyserver-control.h
+KEYSERVER_SRCS = seahorse-keyserver-control.c seahorse-keyserver-control.h
 else
 KEYSERVER_SRCS = 
 endif
 
-if WITH_SSH
-SSH_SRCS = seahorse-ssh-key-data.c seahorse-ssh-key-data.h
-SSH_SRCS += seahorse-ssh-key.c seahorse-ssh-key.h 
-SSH_SRCS += seahorse-ssh-source.c seahorse-ssh-source.h
-SSH_SRCS += seahorse-ssh-operation.c seahorse-ssh-operation.h
-else
-SSH_SRCS = 
-endif
-
-libseahorse_a_SOURCES = \
+libseahorse_la_SOURCES = \
 	seahorse-key.c seahorse-key.h \
 	seahorse-key-source.c seahorse-key-source.h \
-	seahorse-pgp-key.c seahorse-pgp-key.h \
-	seahorse-pgp-key-op.c seahorse-pgp-key-op.h \
-	seahorse-pgp-source.c seahorse-pgp-source.h \
-	seahorse-pgp-operation.c seahorse-pgp-operation.h \
     seahorse-unknown-key.c seahorse-unknown-key.h \
     seahorse-unknown-source.c seahorse-unknown-source.h \
 	seahorse-context.c seahorse-context.h \
@@ -65,12 +39,9 @@
 	seahorse-validity.c seahorse-validity.h \
 	seahorse-check-button-control.c seahorse-check-button-control.h \
 	seahorse-combo-keys.c seahorse-combo-keys.h \
-	seahorse-gpg-options.c seahorse-gpg-options.h \
 	seahorse-passphrase.c seahorse-passphrase.h \
-	seahorse-signer.c \
 	seahorse-libdialogs.h \
 	seahorse-vfs-data.c seahorse-vfs-data.h \
-	seahorse-gpgmex.h seahorse-gpgmex-op.c seahorse-gpgmex-util.c \
 	seahorse-prefs.c seahorse-prefs.h \
 	seahorse-prefs-keyrings.c \
 	seahorse-operation.c seahorse-operation.h \
@@ -82,24 +53,18 @@
 	seahorse-notification.c \
 	seahorse-secure-memory.c seahorse-secure-memory.h \
 	seahorse-secure-entry.c seahorse-secure-entry.h \
-	seahorse-algo.c seahorse-algo.h \
 	seahorse-unix-signal.c seahorse-unix-signal.h \
 	$(BUILT_SOURCES) \
-	$(KEYSERVER_SRCS) \
-	$(LDAP_SRCS) \
-	$(HKP_SRCS) \
-	$(SSH_SRCS)
+	$(KEYSERVER_SRCS)
+	
+libseahorse_la_LIBADD = \
+	$(top_builddir)/common/libsea-common.la \
+	$(top_builddir)/libcryptui/libcryptui.la
 
-seahorselibexecbin_PROGRAMS = xloadimage seahorse-ssh-askpass
+seahorselibexecbin_PROGRAMS = xloadimage
 
 xloadimage_SOURCES = ../src/seahorse-xloadimage.c
 
-seahorse_ssh_askpass_SOURCES = seahorse-ssh-askpass.c
-seahorse_ssh_askpass_LDADD = \
-	libseahorse.a \
-	$(top_builddir)/libcryptui/libcryptui.la \
-	$(SEAHORSE_LIBS)
-
 seahorse-marshal.h: seahorse-marshal.list $(GLIB_GENMARSHAL)
 	$(GLIB_GENMARSHAL) $< --header --prefix=seahorse_marshal > $@
 
@@ -108,7 +73,6 @@
 	$(GLIB_GENMARSHAL) $< --body --prefix=seahorse_marshal >> $@
 
 glade_DATA = \
-	seahorse-signer.glade \
 	seahorse-prefs.glade \
 	seahorse-add-keyring.glade \
 	seahorse-add-keyserver.glade \

Modified: trunk/libseahorse/seahorse-context.c
==============================================================================
--- trunk/libseahorse/seahorse-context.c	(original)
+++ trunk/libseahorse/seahorse-context.c	Mon Apr 21 02:31:58 2008
@@ -25,24 +25,19 @@
 #include <libintl.h>
 #include <gnome.h>
 
-#include "seahorse-pgp-key.h"
-#include "seahorse-pgp-source.h"
 #include "seahorse-context.h"
 #include "seahorse-marshal.h"
 #include "seahorse-libdialogs.h"
 #include "seahorse-gconf.h"
 #include "seahorse-util.h"
-#include "seahorse-server-source.h"
-#include "seahorse-pgp-source.h"
 #include "seahorse-dns-sd.h"
 #include "seahorse-transfer-operation.h"
 #include "seahorse-unknown-source.h"
 #include "seahorse-unknown-key.h"
 
-#ifdef WITH_SSH
-#include "seahorse-ssh-key.h"
-#include "seahorse-ssh-source.h"
-#endif
+#include "common/sea-registry.h"
+
+#include "pgp/seahorse-server-source.h"
 
 /* The application main context */
 SeahorseContext* app_context = NULL;
@@ -205,49 +200,44 @@
 SeahorseContext*
 seahorse_context_new (guint flags, guint ktype)
 {
-    SeahorseContext *sctx = g_object_new (SEAHORSE_TYPE_CONTEXT, NULL);
+	SeahorseContext *sctx = g_object_new (SEAHORSE_TYPE_CONTEXT, NULL);
     
-    if (flags & SEAHORSE_CONTEXT_DAEMON)
-        sctx->is_daemon = TRUE;
+    	if (flags & SEAHORSE_CONTEXT_DAEMON)
+	    sctx->is_daemon = TRUE;
     
-    if (flags & SEAHORSE_CONTEXT_APP) {
-
-        if (ktype >= 0) {
-            /* Add the default key sources */
-            if (ktype == 0 || ktype == SKEY_PGP) {
-                SeahorsePGPSource *pgpsrc = seahorse_pgp_source_new ();
-                seahorse_context_take_key_source (sctx, SEAHORSE_KEY_SOURCE (pgpsrc));     
-            }
-#ifdef WITH_SSH        
-            if (ktype == 0 || ktype == SKEY_SSH) {
-                SeahorseSSHSource *sshsrc = seahorse_ssh_source_new ();
-                seahorse_context_take_key_source (sctx, SEAHORSE_KEY_SOURCE (sshsrc));     
-            }
-#endif
-        }
+	if (flags & SEAHORSE_CONTEXT_APP) {
+		
+		GList *l, *types;
+		
+		types = sea_registry_find_types (NULL, "key-source", "local", NULL);
+		for (l = types; l; l = g_list_next (l)) {
+			SeahorseKeySource *src = g_object_new (GPOINTER_TO_UINT (l->data), NULL);
+			seahorse_context_take_key_source (sctx, src);
+		}
+		g_list_free (types);
 
-        /* DNS-SD discovery */    
-        sctx->pv->discovery = seahorse_service_discovery_new ();
+		/* DNS-SD discovery */    
+		sctx->pv->discovery = seahorse_service_discovery_new ();
         
-        /* Automatically added remote key sources */
-        sctx->pv->auto_sources = g_hash_table_new_full (g_str_hash, g_str_equal,
+		/* Automatically added remote key sources */
+		sctx->pv->auto_sources = g_hash_table_new_full (g_str_hash, g_str_equal,
                                                         g_free, NULL);
 
-        /* Listen for new gconf remote key sources automatically */
-        sctx->pv->notify_id = seahorse_gconf_notify (KEYSERVER_KEY, 
+		/* Listen for new gconf remote key sources automatically */
+		sctx->pv->notify_id = seahorse_gconf_notify (KEYSERVER_KEY, 
                                     (GConfClientNotifyFunc)refresh_keyservers, sctx);
         
-        if (app_context)
-            g_object_unref (app_context);
+		if (app_context)
+			g_object_unref (app_context);
         
-        g_object_ref (sctx);
-        gtk_object_sink (GTK_OBJECT (sctx));
-        app_context = sctx;
+		g_object_ref (sctx);
+		gtk_object_sink (GTK_OBJECT (sctx));
+		app_context = sctx;
         
-        refresh_keyservers (NULL, 0, NULL, sctx);
-    }
+		refresh_keyservers (NULL, 0, NULL, sctx);
+	}
     
-    return sctx;
+	return sctx;
 }
 
 /**
@@ -1017,7 +1007,7 @@
     /* Check all the keyids */
     for (l = rawids; l; l = g_slist_next (l)) {
         
-        keyid = seahorse_key_source_cannonical_keyid (ktype, (gchar*)l->data);
+        keyid = seahorse_key_source_canonize_keyid (ktype, (gchar*)l->data);
         if (!keyid) {
             /* TODO: Try and match this partial keyid */
             g_warning ("invalid keyid: %s", (gchar*)l->data);

Modified: trunk/libseahorse/seahorse-context.h
==============================================================================
--- trunk/libseahorse/seahorse-context.h	(original)
+++ trunk/libseahorse/seahorse-context.h	Mon Apr 21 02:31:58 2008
@@ -41,7 +41,6 @@
 #define __SEAHORSE_CONTEXT_H__
 
 #include <gtk/gtk.h>
-#include <gpgme.h>
 
 #include "seahorse-key.h"
 #include "seahorse-key-source.h"

Modified: trunk/libseahorse/seahorse-dns-sd.c
==============================================================================
--- trunk/libseahorse/seahorse-dns-sd.c	(original)
+++ trunk/libseahorse/seahorse-dns-sd.c	Mon Apr 21 02:31:58 2008
@@ -32,7 +32,8 @@
 #include "seahorse-util.h"
 #include "seahorse-dns-sd.h"
 #include "seahorse-context.h"
-#include "seahorse-server-source.h"
+
+#include "pgp/seahorse-server-source.h"
 
 /* Override the DEBUG_DNSSD_ENABLE switch here */
 /* #define DEBUG_DNSSD_ENABLE 1 */

Modified: trunk/libseahorse/seahorse-key-source.c
==============================================================================
--- trunk/libseahorse/seahorse-key-source.c	(original)
+++ trunk/libseahorse/seahorse-key-source.c	Mon Apr 21 02:31:58 2008
@@ -25,12 +25,9 @@
 #include "seahorse-key-source.h"
 #include "seahorse-marshal.h"
 #include "seahorse-context.h"
-#include "seahorse-pgp-key.h"
 #include "seahorse-util.h"
 
-#ifdef WITH_SSH
-#include "seahorse-ssh-key.h"
-#endif
+#include "common/sea-registry.h"
 
 G_DEFINE_TYPE (SeahorseKeySource, seahorse_key_source, G_TYPE_OBJECT);
 
@@ -374,20 +371,19 @@
  */
 
 GQuark
-seahorse_key_source_cannonical_keyid (GQuark ktype, const gchar *keyid)
+seahorse_key_source_canonize_keyid (GQuark ktype, const gchar *keyid)
 {
-    g_return_val_if_fail (keyid != NULL, 0);
-    
-    if (ktype == SKEY_PGP)
-        return seahorse_pgp_key_get_cannonical_id (keyid);
-    
-#ifdef WITH_SSH
-    else if (ktype == SKEY_SSH)
-        return seahorse_ssh_key_get_cannonical_id (keyid);
-#endif
-        
-    else 
-        g_return_val_if_reached (0);
+	SeahorseKeySourceClass *klass;
+	GType type;
+
+	g_return_val_if_fail (keyid != NULL, 0);
     
-    return 0;
+	type = sea_registry_find_type (NULL, "key-source", g_quark_to_string (ktype), "local", NULL);
+	g_return_val_if_fail (type, 0);
+	
+	klass = SEAHORSE_KEY_SOURCE_CLASS (g_type_class_peek (type));
+	g_return_val_if_fail (klass, 0);
+	
+	g_return_val_if_fail (klass->canonize_keyid, 0);
+	return (klass->canonize_keyid) (keyid);
 }

Modified: trunk/libseahorse/seahorse-key-source.h
==============================================================================
--- trunk/libseahorse/seahorse-key-source.h	(original)
+++ trunk/libseahorse/seahorse-key-source.h	Mon Apr 21 02:31:58 2008
@@ -29,7 +29,7 @@
  *   created it.
  * 
  * Properties base classes must implement:
- *  ktype: (GQuark) The ktype (ie: SKEY_PGP) of keys originating from this 
+ *  ktype: (GQuark) The ktype (ie: SEA_PGP) of keys originating from this 
  *         key source.
  *  key-desc: (gchar*) Description for the type of keys originating here.
  *  location: (SeahorseKeyLoc) The location of keys that come from this 
@@ -43,11 +43,12 @@
 #define __SEAHORSE_KEY_SOURCE_H__
 
 #include <gnome.h>
-#include <gpgme.h>
 
 #include "seahorse-key.h"
 #include "seahorse-operation.h"
 
+#include "pgp/seahorse-gpgmex.h"
+
 #define SEAHORSE_TYPE_KEY_SOURCE            (seahorse_key_source_get_type ())
 #define SEAHORSE_KEY_SOURCE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_KEY_SOURCE, SeahorseKeySource))
 #define SEAHORSE_KEY_SOURCE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_KEY_SOURCE, SeahorseKeySourceClass))
@@ -67,7 +68,16 @@
 
 typedef struct _SeahorseKeySourceClass {
     GtkObjectClass parent_class;
+    
+    /* class props ----------------------------------------------------- */
+    const GQuark key_type;
+    const gchar *display_name;
+    const gchar **mime_types;
 
+    /* class methods --------------------------------------------------- */
+    
+    GQuark (*canonize_keyid) (const gchar *keyid);
+    
     /* virtual methods ------------------------------------------------- */
 
     /**
@@ -212,7 +222,11 @@
 
 SeahorseKeyLoc      seahorse_key_source_get_location     (SeahorseKeySource *sksrc);
 
-GQuark              seahorse_key_source_cannonical_keyid (GQuark ktype, 
+GQuark              seahorse_key_source_canonize_keyid   (GQuark ktype, 
                                                           const gchar *keyid);
 
+GQuark              seahorse_key_source_mime_to_ktype    (const gchar *mimetype);
+
+const gchar*        seahorse_key_source_type_get_description (GType type);
+
 #endif /* __SEAHORSE_KEY_SOURCE_H__ */

Modified: trunk/libseahorse/seahorse-key.h
==============================================================================
--- trunk/libseahorse/seahorse-key.h	(original)
+++ trunk/libseahorse/seahorse-key.h	Mon Apr 21 02:31:58 2008
@@ -38,7 +38,7 @@
  *      (ie: the DBUS format)
  *   raw-id: (gchar*) The raw backend specific key identifier
  *   key-desc: (gchar*) A description of the key type.
- *   ktype: (GQuark) The type of key (ie: SKEY_PGP). 
+ *   ktype: (GQuark) The type of key (ie: SEA_PGP). 
  *   etype: (SeahorseKeyEType) The encryption type (ie: SKEY_PUBLIC)
  *   flags: (guint) Flags on the capabilities of the key (ie: SeahorseKeyFlags)
  *   location: (SeahorseKeyLoc) The location this key is stored. (ie: SKEY_LOC_REMOTE)

Modified: trunk/libseahorse/seahorse-keyserver-control.c
==============================================================================
--- trunk/libseahorse/seahorse-keyserver-control.c	(original)
+++ trunk/libseahorse/seahorse-keyserver-control.c	Mon Apr 21 02:31:58 2008
@@ -24,7 +24,8 @@
 #include "seahorse-keyserver-control.h"
 #include "seahorse-key.h"
 #include "seahorse-gconf.h"
-#include "seahorse-server-source.h"
+
+#include "pgp/seahorse-server-source.h"
 
 #define UPDATING    "updating"
 

Modified: trunk/libseahorse/seahorse-keyset.c
==============================================================================
--- trunk/libseahorse/seahorse-keyset.c	(original)
+++ trunk/libseahorse/seahorse-keyset.c	Mon Apr 21 02:31:58 2008
@@ -22,7 +22,6 @@
 #include "seahorse-keyset.h"
 #include "seahorse-marshal.h"
 #include "seahorse-gconf.h"
-#include "seahorse-pgp-key.h"
 
 enum {
     PROP_0,
@@ -378,49 +377,3 @@
 
     g_hash_table_insert (skset->pv->keys, skey, closure);    
 }
-
-/* -----------------------------------------------------------------------------
- * COMMON KEYSETS 
- */
-
-static void
-pgp_signers_gconf_notify (GConfClient *client, guint id, GConfEntry *entry, 
-                          SeahorseKeyset *skset)
-{
-    /* Default key changed, refresh */
-    seahorse_keyset_refresh (skset);
-}
-
-static gboolean 
-pgp_signers_match (SeahorseKey *key, gpointer data)
-{
-    SeahorseKey *defkey = seahorse_context_get_default_key (SCTX_APP ());
-    
-    /* Default key overrides all, and becomes the only signer available*/
-    if (defkey && seahorse_key_get_keyid (key) != seahorse_key_get_keyid (defkey))
-        return FALSE;
-    
-    return TRUE;
-}
-
-SeahorseKeyset*     
-seahorse_keyset_pgp_signers_new ()
-{
-    SeahorseKeyPredicate *pred = g_new0(SeahorseKeyPredicate, 1);
-    SeahorseKeyset *skset;
-    
-    pred->location = SKEY_LOC_LOCAL;
-    pred->ktype = SKEY_PGP;
-    pred->etype = SKEY_PRIVATE;
-    pred->flags = SKEY_FLAG_CAN_SIGN;
-    pred->nflags = SKEY_FLAG_EXPIRED | SKEY_FLAG_REVOKED | SKEY_FLAG_DISABLED;
-    pred->custom = pgp_signers_match;
-    
-    skset = seahorse_keyset_new_full (pred);
-    g_object_set_data_full (G_OBJECT (skset), "pgp-signers-predicate", pred, g_free);
-    
-    seahorse_gconf_notify_lazy (SEAHORSE_DEFAULT_KEY, 
-                                (GConfClientNotifyFunc)pgp_signers_gconf_notify, 
-                                skset, skset);
-    return skset;
-}

Modified: trunk/libseahorse/seahorse-keyset.h
==============================================================================
--- trunk/libseahorse/seahorse-keyset.h	(original)
+++ trunk/libseahorse/seahorse-keyset.h	Mon Apr 21 02:31:58 2008
@@ -113,11 +113,4 @@
                                                         SeahorseKey *skey,
                                                         gpointer closure);
 
-/* -----------------------------------------------------------------------------
- * SOME COMMON KEYSETS 
- */
- 
-SeahorseKeyset*     seahorse_keyset_pgp_signers_new     ();
-
-
 #endif /* __SEAHORSE_KEY_SET_H__ */

Modified: trunk/libseahorse/seahorse-libdialogs.h
==============================================================================
--- trunk/libseahorse/seahorse-libdialogs.h	(original)
+++ trunk/libseahorse/seahorse-libdialogs.h	Mon Apr 21 02:31:58 2008
@@ -31,16 +31,6 @@
 
 #include "seahorse-context.h"
 #include "seahorse-widget.h"
-#include "seahorse-pgp-key.h"
-
-SeahorsePGPKey* seahorse_signer_get                 (GtkWindow *parent);
-
-void            seahorse_notify_signatures          (const gchar* data, 
-                                                     gpgme_verify_result_t status);
-
-void            seahorse_notify_signatures_local    (const gchar* data, 
-                                                     gpgme_verify_result_t status,
-                                                     GtkWidget *attachto);
 
 void            seahorse_notify_import              (guint keynum, gchar **keys);
                                                      

Modified: trunk/libseahorse/seahorse-notification.c
==============================================================================
--- trunk/libseahorse/seahorse-notification.c	(original)
+++ trunk/libseahorse/seahorse-notification.c	Mon Apr 21 02:31:58 2008
@@ -564,9 +564,7 @@
     else {
         body = g_strdup_printf(ngettext("Imported a key for", "Imported keys for", keynum));
         
-        keyptr = keys;
-        
-        for (keyptr; *keyptr; keyptr++) {
+        for (keyptr = keys; *keyptr; keyptr++) {
             t = g_strdup_printf ("%s\n<key id='%s' field=\"display-name\"/>", body, *keyptr);
             g_free (body);
             body = t;
@@ -590,98 +588,3 @@
                                    FALSE, ICON_PREFIX "seahorse-key.png", attachto);
     g_free (body);
 }
-
-void
-seahorse_notify_signatures (const gchar* data, gpgme_verify_result_t status)
-{
-    const gchar *icon = NULL;
-    gchar *title, *body;
-    gboolean sig = FALSE;
-    GSList *rawids;
-    GList *keys;
-    SeahorseKey *skey;
-    
-    /* Discover the key in question */
-    rawids = g_slist_append (NULL, status->signatures->fpr);
-    keys = seahorse_context_discover_keys (SCTX_APP (), SKEY_PGP, rawids);
-    g_slist_free (rawids);
-    
-    g_return_if_fail (keys != NULL);
-    skey = SEAHORSE_KEY (keys->data);
-    g_list_free (keys);
-
-    /* Figure out what to display */
-    switch (gpgme_err_code (status->signatures->status))  {
-    case GPG_ERR_KEY_EXPIRED:
-	/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
-        body = _("Signed by <i><key id='%s'/> <b>expired</b></i> on %s.");
-        title = _("Invalid Signature");
-        icon = ICON_PREFIX "seahorse-sign-bad.png";
-        sig = TRUE;
-        break;
-	/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
-    case GPG_ERR_SIG_EXPIRED:
-        body = _("Signed by <i><key id='%s'/></i> on %s <b>Expired</b>.");
-        title = _("Expired Signature");
-        icon = ICON_PREFIX "seahorse-sign-bad.png";
-        sig = TRUE;
-        break;
-	/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
-    case GPG_ERR_CERT_REVOKED:
-        body = _("Signed by <i><key id='%s'/> <b>Revoked</b></i> on %s.");
-        title = _("Revoked Signature");
-        icon = ICON_PREFIX "seahorse-sign-bad.png";
-        sig = TRUE;
-        break;
-    case GPG_ERR_NO_ERROR:
-	/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
-        body = _("Signed by <i><key id='%s'/></i> on %s.");
-        title = _("Good Signature");
-        icon = ICON_PREFIX "seahorse-sign-ok.png";
-        sig = TRUE;
-        break;
-    case GPG_ERR_NO_PUBKEY:
-        body = _("Signing key not in keyring.");
-        title = _("Unknown Signature");
-        icon = ICON_PREFIX "seahorse-sign-unknown.png";
-        break;
-    case GPG_ERR_BAD_SIGNATURE:
-        body = _("Bad or forged signature. The signed data was modified.");
-        title = _("Bad Signature");
-        icon = ICON_PREFIX "seahorse-sign-bad.png";
-        break;
-    case GPG_ERR_NO_DATA:
-        return;
-    default:
-        if (!GPG_IS_OK (status->signatures->status)) 
-            seahorse_util_handle_gpgme (status->signatures->status, 
-                                        _("Couldn't verify signature."));
-        return;
-    };
-
-    if (sig) {
-        gchar *date = seahorse_util_get_display_date_string (status->signatures->timestamp);
-        gchar *id = seahorse_context_keyid_to_dbus (SCTX_APP (), seahorse_key_get_keyid (skey), 0);
-        body = g_markup_printf_escaped (body, id, date);
-        g_free (date);
-        g_free (id);
-    } else {
-        body = g_strdup (body);
-    }
-    
-    if (data) {
-        data = seahorse_util_uri_get_last (data);
-        title = g_strdup_printf ("%s: %s", data, title); 
-    } else {
-        title = g_strdup (title);
-    }
-
-    /* Always try and display in the daemon */
-    if (seahorse_context_is_daemon (SCTX_APP ()))
-        seahorse_notification_display (title, body, !sig, icon, NULL);
-    else
-        cryptui_display_notification (title, body, icon, !sig);
-
-    g_free (title);
-    g_free (body);
-}    

Modified: trunk/libseahorse/seahorse-passphrase.c
==============================================================================
--- trunk/libseahorse/seahorse-passphrase.c	(original)
+++ trunk/libseahorse/seahorse-passphrase.c	Mon Apr 21 02:31:58 2008
@@ -40,16 +40,13 @@
 #include <gnome.h>
 #include <glade/glade-xml.h>
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-libdialogs.h"
 #include "seahorse-widget.h"
 #include "seahorse-util.h"
 #include "seahorse-passphrase.h"
 #include "seahorse-secure-entry.h"
-#include "seahorse-gpg-options.h"
 
-#include "seahorse-ssh-key.h"
-#include "seahorse-pgp-key.h"
+#include "pgp/seahorse-gpgmex.h"
 
 #define HIG_SMALL      6        /* gnome hig small space in pixels */
 #define HIG_LARGE     12        /* gnome hig large space in pixels */
@@ -301,58 +298,3 @@
     GtkToggleButton *button = GTK_TOGGLE_BUTTON (g_object_get_data (G_OBJECT (dialog), "check-option"));
     return GTK_IS_TOGGLE_BUTTON (button) ? gtk_toggle_button_get_active (button) : FALSE;
 }
-
-
-gpgme_error_t
-seahorse_passphrase_get (gconstpointer dummy, const gchar *passphrase_hint, 
-                         const char* passphrase_info, int flags, int fd)
-{
-    GtkDialog *dialog;
-    gpgme_error_t err;
-    gchar **split_uid = NULL;
-    gchar *label = NULL;
-    gchar *errmsg = NULL;
-    const gchar *pass;
-    
-    if (passphrase_info && strlen(passphrase_info) < 16)
-        flags |= SEAHORSE_PASS_NEW;
-    
-    if (passphrase_hint)
-        split_uid = g_strsplit (passphrase_hint, " ", 2);
-
-    if (flags & SEAHORSE_PASS_BAD) 
-        errmsg = g_strdup_printf (_("Wrong passphrase."));
-    
-    if (split_uid && split_uid[0] && split_uid[1]) {
-        if (flags & SEAHORSE_PASS_NEW) 
-            label = g_strdup_printf (_("Enter new passphrase for '%s'"), split_uid[1]);
-        else 
-            label = g_strdup_printf (_("Enter passphrase for '%s'"), split_uid[1]);
-    } else {
-        if (flags & SEAHORSE_PASS_NEW) 
-            label = g_strdup (_("Enter new passphrase"));
-        else 
-            label = g_strdup (_("Enter passphrase"));
-    }
-
-    g_strfreev (split_uid);
-
-    dialog = seahorse_passphrase_prompt_show (NULL, errmsg ? errmsg : label, 
-                                              NULL, NULL, FALSE);
-    g_free (label);
-    g_free (errmsg);
-    
-    switch (gtk_dialog_run (dialog)) {
-    case GTK_RESPONSE_ACCEPT:
-        pass = seahorse_passphrase_prompt_get (dialog);
-        seahorse_util_printf_fd (fd, "%s\n", pass);
-        err = GPG_OK;
-        break;
-    default:
-        err = GPG_E (GPG_ERR_CANCELED);
-        break;
-    };
-    
-    gtk_widget_destroy (GTK_WIDGET (dialog));
-    return err;
-}

Modified: trunk/libseahorse/seahorse-passphrase.h
==============================================================================
--- trunk/libseahorse/seahorse-passphrase.h	(original)
+++ trunk/libseahorse/seahorse-passphrase.h	Mon Apr 21 02:31:58 2008
@@ -22,8 +22,6 @@
 #ifndef __SEAHORSE_PASSPHRASE__
 #define __SEAHORSE_PASSPHRASE__
 
-#include <gpgme.h>
-
 #define SEAHORSE_PASS_BAD    0x00000001
 #define SEAHORSE_PASS_NEW    0x01000000
 

Modified: trunk/libseahorse/seahorse-prefs.c
==============================================================================
--- trunk/libseahorse/seahorse-prefs.c	(original)
+++ trunk/libseahorse/seahorse-prefs.c	Mon Apr 21 02:31:58 2008
@@ -18,21 +18,23 @@
  * 59 Temple Place, Suite 330,
  * Boston, MA 02111-1307, USA.
  */
-#include <config.h>
+#include "config.h"
 #include <gnome.h>
 
-#include "config.h"
 #include "seahorse-prefs.h"
 #include "seahorse-util.h"
 #include "seahorse-check-button-control.h"
 #include "seahorse-combo-keys.h"
 #include "seahorse-keyserver-control.h"
-#include "seahorse-server-source.h"
 #include "seahorse-gconf.h"
-#include "seahorse-pgp-key.h"
 #include "seahorse-gtkstock.h"
 #include "seahorse-secure-entry.h"
 
+#include "common/sea-registry.h"
+
+#include "pgp/sea-pgp.h"
+#include "pgp/seahorse-server-source.h"
+
 /* From seahorse-prefs-cache.c */
 void seahorse_prefs_cache (SeahorseWidget *widget);
 

Modified: trunk/libseahorse/seahorse-transfer-operation.c
==============================================================================
--- trunk/libseahorse/seahorse-transfer-operation.c	(original)
+++ trunk/libseahorse/seahorse-transfer-operation.c	Mon Apr 21 02:31:58 2008
@@ -23,9 +23,10 @@
 #include <gnome.h>
 
 #include "seahorse-transfer-operation.h"
-#include "seahorse-pgp-source.h"
 #include "seahorse-util.h"
-#include "seahorse-gpgmex.h"
+
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-source.h"
 
 #ifndef DEBUG_OPERATION_ENABLE
 #if _DEBUG

Modified: trunk/libseahorse/seahorse-unknown-source.c
==============================================================================
--- trunk/libseahorse/seahorse-unknown-source.c	(original)
+++ trunk/libseahorse/seahorse-unknown-source.c	Mon Apr 21 02:31:58 2008
@@ -168,6 +168,8 @@
     g_object_class_install_property (gobject_class, PROP_LOCATION,
         g_param_spec_uint ("location", "Key Location", "Where the key is stored. See SeahorseKeyLoc", 
                            0, G_MAXUINT, SKEY_LOC_INVALID, G_PARAM_READABLE));    
+    
+    sea_registry_register_type (SEAHORSE_TYPE_UNKNOWN_SOURCE, "key-source", NULL);
 }
 
 /* -----------------------------------------------------------------------------

Modified: trunk/libseahorse/seahorse-util.c
==============================================================================
--- trunk/libseahorse/seahorse-util.c	(original)
+++ trunk/libseahorse/seahorse-util.c	Mon Apr 21 02:31:58 2008
@@ -37,16 +37,14 @@
 #include <avahi-glib/glib-malloc.h>
 #endif 
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-util.h"
 #include "seahorse-key.h"
-#include "seahorse-pgp-key.h"
 #include "seahorse-gconf.h"
 #include "seahorse-vfs-data.h"
 
-#ifdef WITH_SSH
-#include "seahorse-ssh-key.h"
-#endif
+#include "pgp/sea-pgp.h"
+#include "ssh/sea-ssh.h"
+#include "pgp/seahorse-gpgmex.h"
 
 static const gchar *bad_filename_chars = "/\\<>|";
 
@@ -762,13 +760,13 @@
     }
 
     if (g_ascii_strcasecmp (mime, "application/pgp-keys") == 0)
-        return SKEY_PGP;
+        return SEA_PGP;
     
 #ifdef WITH_SSH 
     /* TODO: For now all PEM keys are treated as SSH keys */
     else if (g_ascii_strcasecmp (mime, "application/x-ssh-key") == 0 ||
              g_ascii_strcasecmp (mime, "application/x-pem-key") == 0)
-        return SKEY_SSH;
+        return SEA_SSH;
 #endif 
     
     g_warning ("unsupported type of key data: %s", mime);
@@ -1104,25 +1102,6 @@
     return len;
 }
 
-/* TODO: This function no longer makes sense once we 
-   have multiple key and encryption types */
-gpgme_key_t* 
-seahorse_util_keylist_to_keys (GList *keys)
-{
-    gpgme_key_t *recips;
-    int i;
-    
-    recips = g_new0 (gpgme_key_t, g_list_length (keys) + 1);
-    
-    for (i = 0; keys != NULL; keys = g_list_next (keys), i++) {
-        g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (keys->data), recips);
-        recips[i] = SEAHORSE_PGP_KEY (keys->data)->pubkey;
-        gpgmex_key_ref (recips[i]);
-    }
-    
-    return recips;
-}
-
 void
 seahorse_util_free_keys (gpgme_key_t* keys)
 {

Modified: trunk/libseahorse/seahorse-util.h
==============================================================================
--- trunk/libseahorse/seahorse-util.h	(original)
+++ trunk/libseahorse/seahorse-util.h	Mon Apr 21 02:31:58 2008
@@ -29,7 +29,6 @@
 
 #include <gtk/gtk.h>
 #include <time.h>
-#include <gpgme.h>
 
 #include "config.h"
 #include "seahorse-context.h"
@@ -148,8 +147,6 @@
 
 guint       seahorse_util_strvec_length       (const gchar      **vec);
 
-gpgme_key_t* seahorse_util_keylist_to_keys    (GList *keys);
-
 GList*       seahorse_util_keylist_sort       (GList *keys);
 
 GList*       seahorse_util_keylist_splice     (GList *keys);

Modified: trunk/libseahorse/seahorse-validity.c
==============================================================================
--- trunk/libseahorse/seahorse-validity.c	(original)
+++ trunk/libseahorse/seahorse-validity.c	Mon Apr 21 02:31:58 2008
@@ -46,22 +46,3 @@
 	}
 }
 
-SeahorseValidity    
-seahorse_validity_from_gpgme (gpgme_validity_t validity)
-{
-    switch (validity) {
-    case GPGME_VALIDITY_NEVER:
-        return SEAHORSE_VALIDITY_NEVER;
-    case GPGME_VALIDITY_MARGINAL:
-        return SEAHORSE_VALIDITY_MARGINAL;
-    case GPGME_VALIDITY_FULL:
-        return SEAHORSE_VALIDITY_FULL;
-    case GPGME_VALIDITY_ULTIMATE:
-        return SEAHORSE_VALIDITY_ULTIMATE;
-    case GPGME_VALIDITY_UNDEFINED:
-    case GPGME_VALIDITY_UNKNOWN:
-    default:
-        return SEAHORSE_VALIDITY_UNKNOWN;
-    }
-}
-

Modified: trunk/libseahorse/seahorse-validity.h
==============================================================================
--- trunk/libseahorse/seahorse-validity.h	(original)
+++ trunk/libseahorse/seahorse-validity.h	Mon Apr 21 02:31:58 2008
@@ -28,7 +28,6 @@
 
 #include <gtk/gtk.h>
 #include "cryptui.h"
-#include <gpgme.h>
 
 typedef enum {
     SEAHORSE_VALIDITY_REVOKED =     CRYPTUI_VALIDITY_REVOKED,
@@ -40,8 +39,6 @@
     SEAHORSE_VALIDITY_ULTIMATE =    CRYPTUI_VALIDITY_ULTIMATE
 } SeahorseValidity;
 
-SeahorseValidity    seahorse_validity_from_gpgme    (gpgme_validity_t validity);
-
 const gchar*        seahorse_validity_get_string    (SeahorseValidity validity);
 
 #endif /* __SEAHORSE_VALIDITY_H__ */

Modified: trunk/libseahorse/seahorse-vfs-data.c
==============================================================================
--- trunk/libseahorse/seahorse-vfs-data.c	(original)
+++ trunk/libseahorse/seahorse-vfs-data.c	Mon Apr 21 02:31:58 2008
@@ -26,11 +26,12 @@
 #include <gnome.h>
 #include <libgnomevfs/gnome-vfs.h>
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-context.h"
 #include "seahorse-vfs-data.h"
 #include "seahorse-util.h"
 
+#include "pgp/seahorse-gpgmex.h"
+
 #define PROGRESS_BLOCK  16 * 1024
 
 /* The current/last VFS operation */

Added: trunk/pgp/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/pgp/Makefile.am	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,60 @@
+
+gladedir = $(datadir)/seahorse/glade/
+localedir = $(datadir)/locale
+seahorselibexecbindir = $(libdir)/seahorse/
+
+INCLUDES = -I$(top_builddir) \
+	-I$(top_srcdir) \
+	-I$(top_srcdir)/libcryptui \
+	-I$(top_srcdir)/libseahorse \
+	$(SEAHORSE_CFLAGS) \
+	-DDATA_DIR=\""$(datadir)"\" \
+	-DSEAHORSE_GLADEDIR=\""$(gladedir)"\" \
+	-DLOCALEDIR=\"$(localedir)\" \
+	-DEXECDIR=\""$(seahorselibexecbindir)"\" \
+	-DLIBCRYPTUI_API_SUBJECT_TO_CHANGE 
+
+noinst_LTLIBRARIES = libsea-pgp.la
+
+if WITH_LDAP
+LDAP_SRCS = seahorse-ldap-source.c seahorse-ldap-source.h
+else
+LDAP_SRCS = 
+endif
+
+if WITH_HKP
+HKP_SRCS = seahorse-hkp-source.c seahorse-hkp-source.h
+else
+HKP_SRCS =
+endif
+
+if WITH_KEYSERVER
+KEYSERVER_SRCS = seahorse-server-source.c seahorse-server-source.h 
+else
+KEYSERVER_SRCS = 
+endif
+
+libsea_pgp_la_SOURCES = \
+	seahorse-gpgmex.h seahorse-gpgmex-op.c seahorse-gpgmex-util.c \
+	seahorse-gpg-options.c seahorse-gpg-options.h \
+	sea-pgp.c sea-pgp.h \
+	sea-pgp-keysets.c sea-pgp-keysets.h \
+	seahorse-pgp-key.c seahorse-pgp-key.h \
+	seahorse-pgp-key-op.c seahorse-pgp-key-op.h \
+	seahorse-pgp-source.c seahorse-pgp-source.h \
+	seahorse-pgp-operation.c seahorse-pgp-operation.h \
+	seahorse-signer.c sea-pgp-dialogs.h \
+	$(KEYSERVER_SRCS) \
+	$(LDAP_SRCS) \
+	$(HKP_SRCS)
+
+libsea_pgp_la_LIBADD = \
+	$(top_builddir)/libseahorse/libseahorse.la \
+	$(top_builddir)/common/libsea-common.la \
+	$(top_builddir)/libcryptui/libcryptui.la
+
+glade_DATA = \
+	seahorse-signer.glade
+
+EXTRA_DIST = $(glade_DATA)
+	
\ No newline at end of file

Copied: trunk/pgp/sea-pgp-dialogs.h (from r2186, /trunk/libseahorse/seahorse-libdialogs.h)
==============================================================================
--- /trunk/libseahorse/seahorse-libdialogs.h	(original)
+++ trunk/pgp/sea-pgp-dialogs.h	Mon Apr 21 02:31:58 2008
@@ -24,35 +24,13 @@
  * Various UI elements and dialogs used in libseahorse.
  */
  
-#ifndef __SEAHORSE_LIBDIALOGS_H__
-#define __SEAHORSE_LIBDIALOGS_H__
+#ifndef __SEA_PGP_DIALOGS_H__
+#define __SEA_PGP_DIALOGS_H__
 
-#include <glib.h>
+#include <gtk/gtk.h>
 
-#include "seahorse-context.h"
-#include "seahorse-widget.h"
-#include "seahorse-pgp-key.h"
+#include "pgp/seahorse-pgp-key.h"
 
 SeahorsePGPKey* seahorse_signer_get                 (GtkWindow *parent);
 
-void            seahorse_notify_signatures          (const gchar* data, 
-                                                     gpgme_verify_result_t status);
-
-void            seahorse_notify_signatures_local    (const gchar* data, 
-                                                     gpgme_verify_result_t status,
-                                                     GtkWidget *attachto);
-
-void            seahorse_notify_import              (guint keynum, gchar **keys);
-                                                     
-void            seahorse_notify_import_local        (guint keys,
-                                                     GtkWidget *attachto);
-
-void            seahorse_notification_display       (const gchar *summary, 
-                                                     const gchar* body, 
-                                                     gboolean urgent, 
-                                                     const gchar *icon,
-                                                     GtkWidget *attachto);
-  
-gboolean        seahorse_notification_have          (void);
-
-#endif /* __SEAHORSE_LIBDIALOGS_H__ */
+#endif /* __SEA_PGP_DIALOGS_H__ */

Added: trunk/pgp/sea-pgp-keysets.c
==============================================================================
--- (empty file)
+++ trunk/pgp/sea-pgp-keysets.c	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,53 @@
+
+#include "config.h"
+
+#include "seahorse-gconf.h"
+
+#include "sea-pgp.h"
+#include "sea-pgp-keysets.h"
+
+/* -----------------------------------------------------------------------------
+ * COMMON KEYSETS 
+ */
+
+static void
+pgp_signers_gconf_notify (GConfClient *client, guint id, GConfEntry *entry, 
+                          SeahorseKeyset *skset)
+{
+    /* Default key changed, refresh */
+    seahorse_keyset_refresh (skset);
+}
+
+static gboolean 
+pgp_signers_match (SeahorseKey *key, gpointer data)
+{
+    SeahorseKey *defkey = seahorse_context_get_default_key (SCTX_APP ());
+    
+    /* Default key overrides all, and becomes the only signer available*/
+    if (defkey && seahorse_key_get_keyid (key) != seahorse_key_get_keyid (defkey))
+        return FALSE;
+    
+    return TRUE;
+}
+
+SeahorseKeyset*     
+seahorse_keyset_pgp_signers_new ()
+{
+    SeahorseKeyPredicate *pred = g_new0(SeahorseKeyPredicate, 1);
+    SeahorseKeyset *skset;
+    
+    pred->location = SKEY_LOC_LOCAL;
+    pred->ktype = SEA_PGP;
+    pred->etype = SKEY_PRIVATE;
+    pred->flags = SKEY_FLAG_CAN_SIGN;
+    pred->nflags = SKEY_FLAG_EXPIRED | SKEY_FLAG_REVOKED | SKEY_FLAG_DISABLED;
+    pred->custom = pgp_signers_match;
+    
+    skset = seahorse_keyset_new_full (pred);
+    g_object_set_data_full (G_OBJECT (skset), "pgp-signers-predicate", pred, g_free);
+    
+    seahorse_gconf_notify_lazy (SEAHORSE_DEFAULT_KEY, 
+                                (GConfClientNotifyFunc)pgp_signers_gconf_notify, 
+                                skset, skset);
+    return skset;
+}

Added: trunk/pgp/sea-pgp-keysets.h
==============================================================================
--- (empty file)
+++ trunk/pgp/sea-pgp-keysets.h	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,12 @@
+#ifndef SEAPGPKEYSETS_H_
+#define SEAPGPKEYSETS_H_
+
+#include "seahorse-keyset.h"
+
+/* -----------------------------------------------------------------------------
+ * SOME COMMON KEYSETS 
+ */
+ 
+SeahorseKeyset*     seahorse_keyset_pgp_signers_new     ();
+
+#endif /*SEAPGPKEYSETS_H_*/

Added: trunk/pgp/sea-pgp.c
==============================================================================
--- (empty file)
+++ trunk/pgp/sea-pgp.c	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,24 @@
+
+#include "config.h"
+
+#include "sea-pgp.h"
+
+#include "seahorse-pgp-source.h"
+
+#ifdef WITH_LDAP
+#include "seahorse-ldap-source.h"
+#endif
+#ifdef WITH_HKP
+#include "seahorse-hkp-source.h"
+#endif
+	
+const SeaRegisterType SEA_PGP_REGISTRY[] = {
+	seahorse_pgp_source_get_type,
+#ifdef WITH_LDAP
+	seahorse_ldap_source_get_type,
+#endif
+#ifdef WITH_HKP
+	seahorse_hkp_source_get_type,
+#endif
+	NULL
+};

Added: trunk/pgp/sea-pgp.h
==============================================================================
--- (empty file)
+++ trunk/pgp/sea-pgp.h	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,11 @@
+#ifndef SEAHORSEPGP_H_
+#define SEAHORSEPGP_H_
+
+#include "common/sea-registry.h"
+
+#define SEA_PGP_STR                     "openpgp"
+#define SEA_PGP                         (g_quark_from_static_string (SEA_PGP_STR))
+
+extern const SeaRegisterType SEA_PGP_REGISTRY[];
+
+#endif /*SEAHORSEPGP_H_*/

Copied: trunk/pgp/seahorse-gpg-options.c (from r2186, /trunk/libseahorse/seahorse-gpg-options.c)
==============================================================================
--- /trunk/libseahorse/seahorse-gpg-options.c	(original)
+++ trunk/pgp/seahorse-gpg-options.c	Mon Apr 21 02:31:58 2008
@@ -26,10 +26,11 @@
 #include <string.h>
 #include <errno.h>
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-util.h"
 #include "seahorse-context.h"
-#include "seahorse-gpg-options.h"
+
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-gpg-options.h"
 
 #define  GPG_CONF_HEADER    "# FILE CREATED BY SEAHORSE\n\n"
 #define  GPG_VERSION_PREFIX1   "1."

Copied: trunk/pgp/seahorse-gpgmex-op.c (from r2186, /trunk/libseahorse/seahorse-gpgmex-op.c)
==============================================================================
--- /trunk/libseahorse/seahorse-gpgmex-op.c	(original)
+++ trunk/pgp/seahorse-gpgmex-op.c	Mon Apr 21 02:31:58 2008
@@ -23,7 +23,7 @@
 #include <gpgme.h>
 #include <string.h>
 
-#include "seahorse-gpgmex.h"
+#include "pgp/seahorse-gpgmex.h"
 
 static gpgme_error_t
 execute_gpg_command (gpgme_ctx_t ctx, const gchar *args, gchar **std_out, 

Copied: trunk/pgp/seahorse-gpgmex-util.c (from r2186, /trunk/libseahorse/seahorse-gpgmex-util.c)
==============================================================================
--- /trunk/libseahorse/seahorse-gpgmex-util.c	(original)
+++ trunk/pgp/seahorse-gpgmex-util.c	Mon Apr 21 02:31:58 2008
@@ -25,9 +25,10 @@
 #include <errno.h>
 
 #include "config.h"
-#include "seahorse-gpgmex.h"
 #include <glib.h>
 
+#include "pgp/seahorse-gpgmex.h"
+
 /* -----------------------------------------------------------------------------
  * DATA
  */
@@ -82,6 +83,30 @@
     return data;
 }
 
+int 
+gpgmex_data_write_all (gpgme_data_t data, const void* buffer, size_t len)
+{
+	guchar *text = (guchar*)buffer;
+	gint written;
+    
+	if (len < 0)
+		len = strlen ((gchar*)text);
+    
+	while (len > 0) {
+		written = gpgme_data_write (data, (void*)text, len);
+		if (written < 0) {
+			if (errno == EAGAIN || errno == EINTR)
+				continue;
+			return -1;
+		}
+        
+		len -= written;
+		text += written;
+	}
+    
+	return written;
+}
+
 void
 gpgmex_data_release (gpgme_data_t data)
 {
@@ -385,6 +410,55 @@
     return !(key->keylist_mode & SEAHORSE_KEYLIST_MODE);
 }
 
+void 
+gpgmex_combine_keys (gpgme_key_t k, gpgme_key_t key)
+{
+	gpgme_user_id_t uid;
+	gpgme_user_id_t u;
+	gpgme_subkey_t subkey;
+	gpgme_subkey_t s;
+	gboolean found;
+
+	g_assert (k != NULL);
+	g_assert (key != NULL);
+
+	/* Go through user ids */
+	for (uid = key->uids; uid != NULL; uid = uid->next) {
+		g_assert (uid->uid);
+		found = FALSE;
+
+		for (u = k->uids; u != NULL; u = u->next) {
+			g_assert (u->uid);
+
+			if (strcmp (u->uid, uid->uid) == 0) {
+				found = TRUE;
+				break;
+			}
+		}
+
+		if (!found)
+			gpgmex_key_copy_uid (k, uid);
+	}
+
+	/* Go through subkeys */
+	for (subkey = key->subkeys; subkey != NULL; subkey = subkey->next) {
+		g_assert (subkey->fpr);
+		found = FALSE;
+
+		for (s = k->subkeys; s != NULL; s = s->next) {
+			g_assert (s->fpr);
+
+			if (strcmp (s->fpr, subkey->fpr) == 0) {
+				found = TRUE;
+				break;
+			}
+		}
+
+		if (!found)
+			gpgmex_key_copy_subkey (k, subkey);
+	}
+}
+
 gpgmex_photo_id_t 
 gpgmex_photo_id_alloc (guint uid)
 {
@@ -460,3 +534,21 @@
 }
 #endif /*HAVE_STRSEP*/
 
+SeahorseValidity    
+gpgmex_validity_to_seahorse (gpgme_validity_t validity)
+{
+    switch (validity) {
+    case GPGME_VALIDITY_NEVER:
+        return SEAHORSE_VALIDITY_NEVER;
+    case GPGME_VALIDITY_MARGINAL:
+        return SEAHORSE_VALIDITY_MARGINAL;
+    case GPGME_VALIDITY_FULL:
+        return SEAHORSE_VALIDITY_FULL;
+    case GPGME_VALIDITY_ULTIMATE:
+        return SEAHORSE_VALIDITY_ULTIMATE;
+    case GPGME_VALIDITY_UNDEFINED:
+    case GPGME_VALIDITY_UNKNOWN:
+    default:
+        return SEAHORSE_VALIDITY_UNKNOWN;
+    }
+}

Copied: trunk/pgp/seahorse-gpgmex.h (from r2186, /trunk/libseahorse/seahorse-gpgmex.h)
==============================================================================
--- /trunk/libseahorse/seahorse-gpgmex.h	(original)
+++ trunk/pgp/seahorse-gpgmex.h	Mon Apr 21 02:31:58 2008
@@ -30,6 +30,8 @@
 #include <gpgme.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
+#include "seahorse-validity.h"
+
 /* -----------------------------------------------------------------------------
  * ERROR HANDLING 
  */
@@ -51,6 +53,8 @@
 
 void                gpgmex_data_release      (gpgme_data_t data);
 
+int                 gpgmex_data_write_all    (gpgme_data_t data, const void* buffer, size_t len);
+
 gpgme_data_t        gpgmex_data_new_from_mem (const char *buffer, size_t size,
                                               gboolean copy);
 
@@ -107,6 +111,8 @@
 
 void        gpgmex_key_unref         (gpgme_key_t key);
 
+void        gpgmex_combine_keys      (gpgme_key_t k, gpgme_key_t key);
+
 gpgmex_photo_id_t 
             gpgmex_photo_id_alloc    (guint uid);
             
@@ -126,5 +132,7 @@
 gpgme_error_t gpgmex_op_num_uids       (gpgme_ctx_t ctx, 
                                         const char *pattern,
                                         guint *number);
- 
+
+SeahorseValidity    gpgmex_validity_to_seahorse    (gpgme_validity_t validity);
+
 #endif /* __SEAHORSE_GPGMEX_H__ */

Copied: trunk/pgp/seahorse-hkp-source.c (from r2186, /trunk/libseahorse/seahorse-hkp-source.c)
==============================================================================
--- /trunk/libseahorse/seahorse-hkp-source.c	(original)
+++ trunk/pgp/seahorse-hkp-source.c	Mon Apr 21 02:31:58 2008
@@ -24,14 +24,15 @@
 #include <gnome.h>
 #include <libsoup/soup.h>
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-operation.h"
 #include "seahorse-hkp-source.h"
 #include "seahorse-util.h"
-#include "seahorse-pgp-key.h"
 #include "seahorse-gconf.h"
 #include "seahorse-vfs-data.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key.h"
+
 #ifdef WITH_HKP
 
 /* Override the DEBUG_HKP_ENABLE switch here */
@@ -493,6 +494,30 @@
     return keys; 
 }
 
+static void
+add_key (SeahorseHKPSource *ssrc, gpgme_key_t key)
+{
+    SeahorseKey *prev;
+    SeahorsePGPKey *pkey;
+    GQuark keyid;
+       
+    keyid = seahorse_pgp_key_get_cannonical_id (seahorse_pgp_key_get_id (key, 0));
+    prev = seahorse_context_get_key (SCTX_APP (), SEAHORSE_KEY_SOURCE (ssrc), keyid);
+    
+    if (prev != NULL) {
+        g_return_if_fail (SEAHORSE_IS_PGP_KEY (prev));
+        gpgmex_combine_keys (SEAHORSE_PGP_KEY (prev)->pubkey, key);
+        seahorse_key_changed (prev, SKEY_CHANGE_UIDS);
+        return;
+    }
+
+    /* A public key */
+    pkey = seahorse_pgp_key_new (SEAHORSE_KEY_SOURCE (ssrc), key, NULL);
+
+    /* Add to context */ 
+    seahorse_context_add_key (SCTX_APP (), SEAHORSE_KEY (pkey));
+}
+
 static void 
 refresh_callback (SoupSession *session, SoupMessage *msg, SeahorseHKPOperation *hop) 
 {
@@ -509,7 +534,7 @@
     keys = parse_hkp_index (msg->response_body->data);
     
     for (k = keys; k; k = g_list_next (k)) {
-        seahorse_server_source_add_key (SEAHORSE_SERVER_SOURCE (hop->hsrc), (gpgme_key_t)(k->data));
+        add_key (hop->hsrc, (gpgme_key_t)(k->data));
         gpgmex_key_unref ((gpgme_key_t)(k->data));
     }
     
@@ -650,9 +675,13 @@
         data = (gpgme_data_t)seahorse_operation_get_result (SEAHORSE_OPERATION (hop));
         g_return_if_fail (data != NULL);
             
-        ret = seahorse_vfs_data_write_all (data, start, end - start, &err) &&
-              seahorse_vfs_data_write_all (data, "\n", -1, &err);
-        
+	ret = gpgmex_data_write_all (data, start, end - start) > 0 &&
+	      gpgmex_data_write_all (data, "\n", -1) > 0;
+
+	if (!ret)
+		g_set_error (&err, G_FILE_ERROR, g_file_error_from_errno (errno), 
+		             "%s", strerror (errno));
+
         if (!ret) {
             seahorse_operation_mark_done (SEAHORSE_OPERATION (hop), FALSE, err);
             return;
@@ -666,10 +695,17 @@
                                                hop->requests, hop->total);
 }
 
+ 
 /* -----------------------------------------------------------------------------
  *  SEAHORSE HKP SOURCE
  */
 
+enum {
+    PROP_0,
+    PROP_KEY_TYPE,
+    PROP_KEY_DESC
+};
+
 G_DEFINE_TYPE (SeahorseHKPSource, seahorse_hkp_source, SEAHORSE_TYPE_SERVER_SOURCE);
 
 static void 
@@ -677,7 +713,21 @@
 {
 
 }
- 
+
+static void 
+seahorse_hkp_source_get_property (GObject *object, guint prop_id, GValue *value,
+                                  GParamSpec *pspec)
+{
+    switch (prop_id) {
+    case PROP_KEY_TYPE:
+        g_value_set_uint (value, SEA_PGP);
+        break;
+    case PROP_KEY_DESC:
+        g_value_set_string (value, _("PGP Key"));
+        break;
+    };        
+}
+
 static SeahorseOperation*
 seahorse_hkp_source_search (SeahorseKeySource *src, const gchar *match)
 {
@@ -889,15 +939,29 @@
 static void
 seahorse_hkp_source_class_init (SeahorseHKPSourceClass *klass)
 {
-    SeahorseKeySourceClass *key_class;
+	GObjectClass *gobject_class;
+	SeahorseKeySourceClass *key_class;
    
-    key_class = SEAHORSE_KEY_SOURCE_CLASS (klass);
-    key_class->load = seahorse_hkp_source_load;
-    key_class->search = seahorse_hkp_source_search;
-    key_class->import = seahorse_hkp_source_import;
-    key_class->export_raw = seahorse_hkp_source_export_raw;
+	gobject_class = G_OBJECT_CLASS (klass);
+	gobject_class->get_property = seahorse_hkp_source_get_property;
 
-    seahorse_hkp_source_parent_class = g_type_class_peek_parent (klass);
+	key_class = SEAHORSE_KEY_SOURCE_CLASS (klass);
+	key_class->load = seahorse_hkp_source_load;
+	key_class->search = seahorse_hkp_source_search;
+	key_class->import = seahorse_hkp_source_import;
+	key_class->export_raw = seahorse_hkp_source_export_raw;
+
+	seahorse_hkp_source_parent_class = g_type_class_peek_parent (klass);
+
+	g_object_class_install_property (gobject_class, PROP_KEY_TYPE,
+	        g_param_spec_uint ("key-type", "Key Type", "Key type that originates from this key source.", 
+	                           0, G_MAXUINT, SKEY_UNKNOWN, G_PARAM_READABLE));
+
+	g_object_class_install_property (gobject_class, PROP_KEY_DESC,
+	        g_param_spec_string ("key-desc", "Key Desc", "Description for keys that originate here.",
+	                             NULL, G_PARAM_READABLE));
+	    
+	sea_registry_register_type (NULL, SEAHORSE_TYPE_HKP_SOURCE, "key-source", "remote", SEA_PGP_STR, NULL);
 }
 
 

Copied: trunk/pgp/seahorse-ldap-source.c (from r2186, /trunk/libseahorse/seahorse-ldap-source.c)
==============================================================================
--- /trunk/libseahorse/seahorse-ldap-source.c	(original)
+++ trunk/pgp/seahorse-ldap-source.c	Mon Apr 21 02:31:58 2008
@@ -30,12 +30,12 @@
 #endif
 
 #include "config.h"
-#include "seahorse-gpgmex.h"
 #include "seahorse-operation.h"
 #include "seahorse-ldap-source.h"
 #include "seahorse-util.h"
-#include "seahorse-pgp-key.h"
-#include "seahorse-vfs-data.h"
+
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key.h"
 
 #ifdef WITH_LDAP
 
@@ -736,6 +736,31 @@
     NULL
 };
 
+static void
+add_key (SeahorseLDAPSource *ssrc, gpgme_key_t key)
+{
+    SeahorseKey *prev;
+    SeahorsePGPKey *pkey;
+    GQuark keyid;
+       
+    keyid = seahorse_pgp_key_get_cannonical_id (seahorse_pgp_key_get_id (key, 0));
+    prev = seahorse_context_get_key (SCTX_APP (), SEAHORSE_KEY_SOURCE (ssrc), keyid);
+    
+    /* TODO: This function needs reworking after we get more key types */
+    if (prev != NULL) {
+        g_return_if_fail (SEAHORSE_IS_PGP_KEY (prev));
+        gpgmex_combine_keys (SEAHORSE_PGP_KEY (prev)->pubkey, key);
+        seahorse_key_changed (prev, SKEY_CHANGE_UIDS);
+        return;
+    }
+
+    /* A public key */
+    pkey = seahorse_pgp_key_new (SEAHORSE_KEY_SOURCE (ssrc), key, NULL);
+
+    /* Add to context */ 
+    seahorse_context_add_key (SCTX_APP (), SEAHORSE_KEY (pkey));
+}
+
 /* Add a key to the key source from an LDAP entry */
 static void
 parse_key_from_ldap_entry (SeahorseLDAPOperation *lop, LDAPMessage *res)
@@ -767,7 +792,7 @@
                                expires, length, algo);
         gpgmex_key_add_uid (key, uid, flags);
         
-        seahorse_server_source_add_key (SEAHORSE_SERVER_SOURCE (lop->lsrc), key);
+        add_key (lop->lsrc, key);
         gpgmex_key_unref (key);
     }
     
@@ -955,10 +980,14 @@
         data = (gpgme_data_t)seahorse_operation_get_result (SEAHORSE_OPERATION (lop));
         g_return_val_if_fail (data != NULL, FALSE);
         
-        ret = seahorse_vfs_data_write_all (data, key, -1, &err) &&
-              seahorse_vfs_data_write_all (data, "\n", -1, &err);
+        	ret = gpgmex_data_write_all (data, key, -1) > 0 &&
+        	      gpgmex_data_write_all (data, "\n", -1) > 0;
         
-        g_free (key);
+        	if(!ret)
+        		g_set_error (&err, G_FILE_ERROR, g_file_error_from_errno (errno), 
+        		             "%s", strerror (errno));
+        	
+        	g_free (key);
         
         if (!ret) {
             seahorse_operation_mark_done (SEAHORSE_OPERATION (lop), FALSE, err);
@@ -1210,6 +1239,12 @@
  *  SEAHORSE LDAP SOURCE
  */
  
+enum {
+    PROP_0,
+    PROP_KEY_TYPE,
+    PROP_KEY_DESC
+};
+
 G_DEFINE_TYPE (SeahorseLDAPSource, seahorse_ldap_source, SEAHORSE_TYPE_SERVER_SOURCE);
 
 
@@ -1219,6 +1254,20 @@
 
 }
 
+static void 
+seahorse_ldap_source_get_property (GObject *object, guint prop_id, GValue *value,
+                                   GParamSpec *pspec)
+{
+    switch (prop_id) {
+    case PROP_KEY_TYPE:
+        g_value_set_uint (value, SEA_PGP);
+        break;
+    case PROP_KEY_DESC:
+        g_value_set_string (value, _("PGP Key"));
+        break;
+    };        
+}
+
 static SeahorseOperation*
 seahorse_ldap_source_load (SeahorseKeySource *src, GQuark keyid)
 {
@@ -1325,15 +1374,29 @@
 static void
 seahorse_ldap_source_class_init (SeahorseLDAPSourceClass *klass)
 {
-    SeahorseKeySourceClass *key_class;
+	GObjectClass *gobject_class;
+	SeahorseKeySourceClass *key_class;
    
-    key_class = SEAHORSE_KEY_SOURCE_CLASS (klass);
-    key_class->load = seahorse_ldap_source_load;
-    key_class->search = seahorse_ldap_source_search;
-    key_class->import = seahorse_ldap_source_import;
-    key_class->export_raw = seahorse_ldap_source_export_raw;
-
-    seahorse_ldap_source_parent_class = g_type_class_peek_parent (klass);
+	gobject_class = G_OBJECT_CLASS (klass);
+	gobject_class->get_property = seahorse_ldap_source_get_property;
+   
+	key_class = SEAHORSE_KEY_SOURCE_CLASS (klass);
+	key_class->load = seahorse_ldap_source_load;
+	key_class->search = seahorse_ldap_source_search;
+	key_class->import = seahorse_ldap_source_import;
+	key_class->export_raw = seahorse_ldap_source_export_raw;
+
+	seahorse_ldap_source_parent_class = g_type_class_peek_parent (klass);
+    
+	g_object_class_install_property (gobject_class, PROP_KEY_TYPE,
+	        g_param_spec_uint ("key-type", "Key Type", "Key type that originates from this key source.", 
+	                           0, G_MAXUINT, SKEY_UNKNOWN, G_PARAM_READABLE));
+
+	g_object_class_install_property (gobject_class, PROP_KEY_DESC,
+	        g_param_spec_string ("key-desc", "Key Desc", "Description for keys that originate here.",
+	                             NULL, G_PARAM_READABLE));
+	    
+	sea_registry_register_type (NULL, SEAHORSE_TYPE_LDAP_SOURCE, "key-source", "remote", SEA_PGP_STR, NULL);
 }
 
 

Copied: trunk/pgp/seahorse-pgp-key-op.c (from r2186, /trunk/libseahorse/seahorse-pgp-key-op.c)
==============================================================================
--- /trunk/libseahorse/seahorse-pgp-key-op.c	(original)
+++ trunk/pgp/seahorse-pgp-key-op.c	Mon Apr 21 02:31:58 2008
@@ -25,11 +25,12 @@
 #include <gnome.h>
 #include <glib/gstdio.h>
 
-#include "seahorse-gpgmex.h"
-#include "seahorse-pgp-key-op.h"
 #include "seahorse-util.h"
 #include "seahorse-libdialogs.h"
-#include "seahorse-pgp-operation.h"
+
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key-op.h"
+#include "pgp/seahorse-pgp-operation.h"
 
 #define PROMPT "keyedit.prompt"
 #define QUIT "quit"

Copied: trunk/pgp/seahorse-pgp-key-op.h (from r2186, /trunk/libseahorse/seahorse-pgp-key-op.h)
==============================================================================
--- /trunk/libseahorse/seahorse-pgp-key-op.h	(original)
+++ trunk/pgp/seahorse-pgp-key-op.h	Mon Apr 21 02:31:58 2008
@@ -26,11 +26,12 @@
 #include <gpgme.h>
 #include <time.h>
 
-#include "seahorse-pgp-source.h"
-#include "seahorse-pgp-key.h"
-#include "seahorse-gpgmex.h"
 #include "seahorse-operation.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key.h"
+#include "pgp/seahorse-pgp-source.h"
+
 /* Key type options. */
 typedef enum {
 	/* DSA key with ElGamal subkey. The DSA key will have length of 1024,

Copied: trunk/pgp/seahorse-pgp-key.c (from r2186, /trunk/libseahorse/seahorse-pgp-key.c)
==============================================================================
--- /trunk/libseahorse/seahorse-pgp-key.c	(original)
+++ trunk/pgp/seahorse-pgp-key.c	Mon Apr 21 02:31:58 2008
@@ -21,12 +21,13 @@
 #include <config.h>
 #include <gnome.h>
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-context.h"
 #include "seahorse-key-source.h"
-#include "seahorse-pgp-key.h"
 #include "seahorse-gtkstock.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key.h"
+
 enum {
     PROP_0,
     PROP_PUBKEY,
@@ -113,14 +114,14 @@
         return SEAHORSE_VALIDITY_REVOKED;
     if (pkey->pubkey->disabled)
         return SEAHORSE_VALIDITY_DISABLED;
-    return seahorse_validity_from_gpgme (pkey->pubkey->uids->validity);
+    return gpgmex_validity_to_seahorse (pkey->pubkey->uids->validity);
 }
 
 static SeahorseValidity 
 calc_trust (SeahorsePGPKey *pkey)
 {
     g_return_val_if_fail (pkey->pubkey, SEAHORSE_VALIDITY_UNKNOWN);
-    return seahorse_validity_from_gpgme (pkey->pubkey->owner_trust);
+    return gpgmex_validity_to_seahorse (pkey->pubkey->owner_trust);
 }
 
 static void
@@ -129,7 +130,7 @@
     SeahorseKey *skey = SEAHORSE_KEY (pkey);
     
     skey->keyid = 0;
-    skey->ktype = SKEY_PGP;
+    skey->ktype = SEA_PGP;
     
     if (!pkey->pubkey) {
         
@@ -202,7 +203,7 @@
     }
     
     if (!skey->keyid)
-        skey->keyid = g_quark_from_string (SKEY_PGP_STR ":UNKNOWN UNKNOWN ");
+        skey->keyid = g_quark_from_string (SEA_PGP_STR ":UNKNOWN UNKNOWN ");
     
     seahorse_key_changed (skey, SKEY_CHANGE_ALL);
 }
@@ -324,7 +325,7 @@
         return SEAHORSE_VALIDITY_DISABLED;
     
     uid = seahorse_pgp_key_get_nth_userid (pkey, index);
-    return uid ? seahorse_validity_from_gpgme (uid->validity) : SEAHORSE_VALIDITY_UNKNOWN;
+    return uid ? gpgmex_validity_to_seahorse (uid->validity) : SEAHORSE_VALIDITY_UNKNOWN;
 }
 
 static void
@@ -878,7 +879,7 @@
     if (len > 16)
         id += len - 16;
     
-    t = g_strdup_printf ("%s:%s", SKEY_PGP_STR, id);
+    t = g_strdup_printf ("%s:%s", SEA_PGP_STR, id);
     keyid = g_quark_from_string (t);
     g_free (t);
     

Copied: trunk/pgp/seahorse-pgp-key.h (from r2186, /trunk/libseahorse/seahorse-pgp-key.h)
==============================================================================
--- /trunk/libseahorse/seahorse-pgp-key.h	(original)
+++ trunk/pgp/seahorse-pgp-key.h	Mon Apr 21 02:31:58 2008
@@ -44,11 +44,10 @@
 #include <gpgme.h>
 
 #include "seahorse-key.h"
-#include "seahorse-pgp-source.h"
-#include "seahorse-gpgmex.h"
 
-#define SKEY_PGP_STR                     "openpgp"
-#define SKEY_PGP                         (g_quark_from_static_string (SKEY_PGP_STR))
+#include "pgp/sea-pgp.h"
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-source.h"
 
 enum {
     SKEY_PGPSIG_TRUSTED = 0x0001,

Copied: trunk/pgp/seahorse-pgp-operation.c (from r2186, /trunk/libseahorse/seahorse-pgp-operation.c)
==============================================================================
--- /trunk/libseahorse/seahorse-pgp-operation.c	(original)
+++ trunk/pgp/seahorse-pgp-operation.c	Mon Apr 21 02:31:58 2008
@@ -20,11 +20,12 @@
  */
 
 #include "config.h"
-#include "seahorse-pgp-operation.h"
-#include "seahorse-pgp-source.h"
-#include "seahorse-gpgmex.h"
 #include "seahorse-util.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-operation.h"
+#include "pgp/seahorse-pgp-source.h"
+
 #define DEBUG_OPERATION_ENABLE 0
 
 #ifndef DEBUG_OPERATION_ENABLE

Copied: trunk/pgp/seahorse-pgp-operation.h (from r2186, /trunk/libseahorse/seahorse-pgp-operation.h)
==============================================================================
--- /trunk/libseahorse/seahorse-pgp-operation.h	(original)
+++ trunk/pgp/seahorse-pgp-operation.h	Mon Apr 21 02:31:58 2008
@@ -55,7 +55,8 @@
  */
 
 #include "seahorse-operation.h"
-#include "seahorse-gpgmex.h"
+
+#include "pgp/seahorse-gpgmex.h"
 
 #define SEAHORSE_TYPE_PGP_OPERATION            (seahorse_pgp_operation_get_type ())
 #define SEAHORSE_PGP_OPERATION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_PGP_OPERATION, SeahorsePGPOperation))

Copied: trunk/pgp/seahorse-pgp-source.c (from r2186, /trunk/libseahorse/seahorse-pgp-source.c)
==============================================================================
--- /trunk/libseahorse/seahorse-pgp-source.c	(original)
+++ trunk/pgp/seahorse-pgp-source.c	Mon Apr 21 02:31:58 2008
@@ -25,16 +25,17 @@
 #include <gnome.h>
 #include <libgnomevfs/gnome-vfs.h>
 
-#include "seahorse-gpgmex.h"
-#include "seahorse-pgp-source.h"
 #include "seahorse-operation.h"
 #include "seahorse-util.h"
-#include "seahorse-pgp-key.h"
-#include "seahorse-pgp-key-op.h"
 #include "seahorse-libdialogs.h"
-#include "seahorse-gpg-options.h"
 #include "seahorse-passphrase.h"
-#include "seahorse-pgp-operation.h"
+
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-gpg-options.h"
+#include "pgp/seahorse-pgp-key.h"
+#include "pgp/seahorse-pgp-key-op.h"
+#include "pgp/seahorse-pgp-operation.h"
+#include "pgp/seahorse-pgp-source.h"
 
 /* TODO: Verify properly that all keys we deal with are PGP keys */
 
@@ -70,6 +71,60 @@
     PROP_LOCATION
 };
 
+static gpgme_error_t
+passphrase_get (gconstpointer dummy, const gchar *passphrase_hint, 
+                const char* passphrase_info, int flags, int fd)
+{
+    GtkDialog *dialog;
+    gpgme_error_t err;
+    gchar **split_uid = NULL;
+    gchar *label = NULL;
+    gchar *errmsg = NULL;
+    const gchar *pass;
+    
+    if (passphrase_info && strlen(passphrase_info) < 16)
+        flags |= SEAHORSE_PASS_NEW;
+    
+    if (passphrase_hint)
+        split_uid = g_strsplit (passphrase_hint, " ", 2);
+
+    if (flags & SEAHORSE_PASS_BAD) 
+        errmsg = g_strdup_printf (_("Wrong passphrase."));
+    
+    if (split_uid && split_uid[0] && split_uid[1]) {
+        if (flags & SEAHORSE_PASS_NEW) 
+            label = g_strdup_printf (_("Enter new passphrase for '%s'"), split_uid[1]);
+        else 
+            label = g_strdup_printf (_("Enter passphrase for '%s'"), split_uid[1]);
+    } else {
+        if (flags & SEAHORSE_PASS_NEW) 
+            label = g_strdup (_("Enter new passphrase"));
+        else 
+            label = g_strdup (_("Enter passphrase"));
+    }
+
+    g_strfreev (split_uid);
+
+    dialog = seahorse_passphrase_prompt_show (NULL, errmsg ? errmsg : label, 
+                                              NULL, NULL, FALSE);
+    g_free (label);
+    g_free (errmsg);
+    
+    switch (gtk_dialog_run (dialog)) {
+    case GTK_RESPONSE_ACCEPT:
+        pass = seahorse_passphrase_prompt_get (dialog);
+        seahorse_util_printf_fd (fd, "%s\n", pass);
+        err = GPG_OK;
+        break;
+    default:
+        err = GPG_E (GPG_ERR_CANCELED);
+        break;
+    };
+    
+    gtk_widget_destroy (GTK_WIDGET (dialog));
+    return err;
+}
+
 /* Initialise a GPGME context for PGP keys */
 static gpgme_error_t
 init_gpgme (gpgme_ctx_t *ctx)
@@ -86,7 +141,7 @@
     err = gpgme_set_protocol (*ctx, proto);
     g_return_val_if_fail (GPG_IS_OK (err), err);
     
-    gpgme_set_passphrase_cb (*ctx, (gpgme_passphrase_cb_t)seahorse_passphrase_get, 
+    gpgme_set_passphrase_cb (*ctx, (gpgme_passphrase_cb_t)passphrase_get, 
                              NULL);
    
     gpgme_set_keylist_mode (*ctx, GPGME_KEYLIST_MODE_LOCAL);
@@ -249,6 +304,9 @@
     g_object_class_install_property (gobject_class, PROP_LOCATION,
         g_param_spec_uint ("location", "Key Location", "Where the key is stored. See SeahorseKeyLoc", 
                            0, G_MAXUINT, SKEY_LOC_INVALID, G_PARAM_READABLE));    
+    
+	sea_registry_register_type (NULL, SEAHORSE_TYPE_PGP_SOURCE, "key-source", "local", SEA_PGP_STR, NULL);
+
 }
 
 /* init context, private vars, set prefs, connect signals */
@@ -361,7 +419,7 @@
 {
     switch (prop_id) {
     case PROP_KEY_TYPE:
-        g_value_set_uint (value, SKEY_PGP);
+        g_value_set_uint (value, SEA_PGP);
         break;
     case PROP_KEY_DESC:
         g_value_set_string (value, _("PGP Key"));

Copied: trunk/pgp/seahorse-pgp-source.h (from r2186, /trunk/libseahorse/seahorse-pgp-source.h)
==============================================================================
--- /trunk/libseahorse/seahorse-pgp-source.h	(original)
+++ trunk/pgp/seahorse-pgp-source.h	Mon Apr 21 02:31:58 2008
@@ -31,7 +31,7 @@
  * - Monitors ~/.gnupg for changes and reloads the key ring as necessary.
  * 
  * Properties:
- *  ktype: (GQuark) The ktype (ie: SKEY_PGP) of keys originating from this 
+ *  ktype: (GQuark) The ktype (ie: SEA_PGP) of keys originating from this 
            key source.
  *  location: (SeahorseKeyLoc) The location of keys that come from this 
  *         source. (ie: SKEY_LOC_LOCAL, SKEY_LOC_REMOTE)

Copied: trunk/pgp/seahorse-server-source.c (from r2186, /trunk/libseahorse/seahorse-server-source.c)
==============================================================================
--- /trunk/libseahorse/seahorse-server-source.c	(original)
+++ trunk/pgp/seahorse-server-source.c	Mon Apr 21 02:31:58 2008
@@ -203,7 +203,7 @@
         g_value_set_string (value, ssrc->priv->uri);
         break;
     case PROP_KEY_TYPE:
-        g_value_set_uint (value, SKEY_PGP);
+        g_value_set_uint (value, SEA_PGP);
         break;
     case PROP_KEY_DESC:
         g_value_set_string (value, _("PGP Key"));

Copied: trunk/pgp/seahorse-signer.c (from r2186, /trunk/libseahorse/seahorse-signer.c)
==============================================================================
--- /trunk/libseahorse/seahorse-signer.c	(original)
+++ trunk/pgp/seahorse-signer.c	Mon Apr 21 02:31:58 2008
@@ -30,9 +30,10 @@
 #include "seahorse-validity.h"
 #include "seahorse-combo-keys.h"
 #include "seahorse-gconf.h"
-#include "seahorse-pgp-key.h"
 #include "seahorse-util.h"
 
+#include "pgp/seahorse-pgp-key.h"
+
 SeahorsePGPKey*
 seahorse_signer_get (GtkWindow *parent)
 {

Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in	(original)
+++ trunk/po/POTFILES.in	Mon Apr 21 02:31:58 2008
@@ -6,37 +6,36 @@
 daemon/seahorse-service-keyset.c
 daemon/seahorse-sharing.c
 data/seahorse.schemas.in
+gkr/seahorse-gkeyring-item.c
+gkr/seahorse-gkeyring-operation.c
+gkr/seahorse-gkeyring-source.c
 libcryptui/cryptui-key-chooser.c
 libcryptui/cryptui-key-list.c
 libseahorse/seahorse-add-keyring.glade
 libseahorse/seahorse-add-keyserver.glade
 libseahorse/seahorse-context.c
-libseahorse/seahorse-gpg-options.c
-libseahorse/seahorse-hkp-source.c
-libseahorse/seahorse-ldap-source.c
 libseahorse/seahorse-notification.c
 libseahorse/seahorse-notify.glade
 libseahorse/seahorse-passphrase.c
-libseahorse/seahorse-pgp-key.c
-libseahorse/seahorse-pgp-key-op.c
-libseahorse/seahorse-pgp-source.c
 libseahorse/seahorse-prefs.c
 libseahorse/seahorse-prefs-keyrings.c
 libseahorse/seahorse-prefs.glade
 libseahorse/seahorse-progress.glade
 libseahorse/seahorse-secure-entry.c
-libseahorse/seahorse-server-source.c
-libseahorse/seahorse-signer.c
-libseahorse/seahorse-signer.glade
-libseahorse/seahorse-ssh-askpass.c
-libseahorse/seahorse-ssh-key.c
-libseahorse/seahorse-ssh-operation.c
-libseahorse/seahorse-ssh-source.c
 libseahorse/seahorse-unknown-key.c
 libseahorse/seahorse-unknown-source.c
 libseahorse/seahorse-util.c
 libseahorse/seahorse-validity.c
 libseahorse/seahorse-widget.c
+pgp/seahorse-gpg-options.c
+pgp/seahorse-hkp-source.c
+pgp/seahorse-ldap-source.c
+pgp/seahorse-pgp-key.c
+pgp/seahorse-pgp-key-op.c
+pgp/seahorse-pgp-source.c
+pgp/seahorse-server-source.c
+pgp/seahorse-signer.c
+pgp/seahorse-signer.glade
 src/main.c
 src/seahorse-add-subkey.c
 src/seahorse-add-subkey.glade
@@ -49,11 +48,8 @@
 src/seahorse-expires.glade
 src/seahorse-generate-select.c
 src/seahorse-generate-select.glade
-src/seahorse-gkeyring-item.c
 src/seahorse-gkeyring-item-properties.c
 src/seahorse-gkeyring-item-properties.glade
-src/seahorse-gkeyring-operation.c
-src/seahorse-gkeyring-source.c
 src/seahorse-key-manager.c
 src/seahorse-key-manager.glade
 src/seahorse-key-manager-store.c
@@ -65,13 +61,10 @@
 src/seahorse-keyserver-sync.c
 src/seahorse-keyserver-sync.glade
 src/seahorse-multi-encrypt.glade
-src/seahorse-pgp-encrypted.desktop.in.in
 src/seahorse-pgp-generate.c
 src/seahorse-pgp-generate.glade
-src/seahorse-pgp-keys.desktop.in.in
 src/seahorse-pgp-private-key-properties.glade
 src/seahorse-pgp-public-key-properties.glade
-src/seahorse-pgp-signature.desktop.in.in
 src/seahorse-photos.c
 src/seahorse-revoke.c
 src/seahorse-revoke.glade
@@ -83,3 +76,7 @@
 src/seahorse-ssh-key-properties.glade
 src/seahorse-ssh-upload.c
 src/seahorse-ssh-upload.glade
+ssh/seahorse-ssh-askpass.c
+ssh/seahorse-ssh-key.c
+ssh/seahorse-ssh-operation.c
+ssh/seahorse-ssh-source.c

Modified: trunk/po/POTFILES.skip
==============================================================================
--- trunk/po/POTFILES.skip	(original)
+++ trunk/po/POTFILES.skip	Mon Apr 21 02:31:58 2008
@@ -1,5 +1 @@
-plugins/applet/GNOME_SeahorseApplet.server.in
-src/seahorse-pgp-encrypted.desktop.in
-src/seahorse-pgp-keys.desktop.in
-src/seahorse-pgp-signature.desktop.in
 src/seahorse.desktop.in

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Mon Apr 21 02:31:58 2008
@@ -27,12 +27,6 @@
 endif
 
 GNOME_KEYRING_SRCS = \
-	seahorse-gkeyring-item.c \
-	seahorse-gkeyring-item.h \
-	seahorse-gkeyring-source.c \
-	seahorse-gkeyring-source.h \
-	seahorse-gkeyring-operation.c \
-	seahorse-gkeyring-operation.h \
 	seahorse-gkeyring-item-properties.c
 
 bin_PROGRAMS = seahorse
@@ -58,7 +52,11 @@
     $(SSH_SRCS)
 
 seahorse_LDADD = \
-	$(top_builddir)/libseahorse/libseahorse.a \
+	$(top_builddir)/libseahorse/libseahorse.la \
+	$(top_builddir)/pgp/libsea-pgp.la \
+	$(top_builddir)/ssh/libsea-ssh.la \
+	$(top_builddir)/gkr/libsea-gkr.la \
+	$(top_builddir)/common/libsea-common.la \  
 	$(top_builddir)/libcryptui/libcryptui.la \
 	$(SEAHORSE_LIBS)
 
@@ -86,24 +84,14 @@
 	seahorse-keyserver-sync.glade 
 
 desktopdir = $(datadir)/applications
-desktop_in_files = seahorse.desktop.in \
-				   seahorse-pgp-encrypted.desktop.in \
-				   seahorse-pgp-signature.desktop.in \
-				   seahorse-pgp-keys.desktop.in 
+desktop_in_files = seahorse.desktop.in 
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
 EXTRA_DIST = \
     $(glade_DATA) \
-    seahorse.desktop.in.in \
-    seahorse-pgp-encrypted.desktop.in.in \
-    seahorse-pgp-keys.desktop.in.in \
-    seahorse-pgp-signature.desktop.in.in 
+    seahorse.desktop.in.in 
 
 CLEANFILES = *.gladep* *.bak \
     $(desktop_DATA) \
-    seahorse.desktop.in \
-    seahorse-pgp-encrypted.desktop.in \
-    seahorse-pgp-keys.desktop.in \
-    seahorse-pgp-signature.desktop.in
-    
+    seahorse.desktop.in 

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Mon Apr 21 02:31:58 2008
@@ -29,11 +29,12 @@
 #include "seahorse-windows.h"
 #include "seahorse-util.h"
 #include "seahorse-libdialogs.h"
-#include "seahorse-pgp-source.h"
-#include "seahorse-pgp-key.h"
 #include "seahorse-gtkstock.h"
 #include "seahorse-secure-memory.h"
 
+#include "pgp/seahorse-pgp-key.h"
+#include "pgp/seahorse-pgp-source.h"
+
 /* Initializes context and preferences, then loads key manager */
 int
 main (int argc, char **argv)

Modified: trunk/src/seahorse-add-subkey.c
==============================================================================
--- trunk/src/seahorse-add-subkey.c	(original)
+++ trunk/src/seahorse-add-subkey.c	Mon Apr 21 02:31:58 2008
@@ -22,12 +22,13 @@
 #include <config.h> 
 #include <gnome.h>
  
-#include "seahorse-gpgmex.h"
 #include "seahorse-key-dialogs.h"
 #include "seahorse-key-widget.h"
-#include "seahorse-pgp-key-op.h"
 #include "seahorse-util.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key-op.h"
+
 #define EXPIRES "expires"
 #define LENGTH "length"
 

Modified: trunk/src/seahorse-add-uid.c
==============================================================================
--- trunk/src/seahorse-add-uid.c	(original)
+++ trunk/src/seahorse-add-uid.c	Mon Apr 21 02:31:58 2008
@@ -22,12 +22,13 @@
 #include <config.h> 
 #include <gnome.h>
  
-#include "seahorse-gpgmex.h"
 #include "seahorse-key-dialogs.h"
 #include "seahorse-key-widget.h"
-#include "seahorse-pgp-key-op.h"
 #include "seahorse-util.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key-op.h"
+
 #define NAME "name"
 #define EMAIL "email"
 

Modified: trunk/src/seahorse-delete.c
==============================================================================
--- trunk/src/seahorse-delete.c	(original)
+++ trunk/src/seahorse-delete.c	Mon Apr 21 02:31:58 2008
@@ -22,11 +22,12 @@
 #include <config.h>
 #include <gnome.h>
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-windows.h"
-#include "seahorse-pgp-key-op.h"
 #include "seahorse-util.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key-op.h"
+
 static gboolean
 ask_key_pair (SeahorseKey *skey)
 {

Modified: trunk/src/seahorse-expires.c
==============================================================================
--- trunk/src/seahorse-expires.c	(original)
+++ trunk/src/seahorse-expires.c	Mon Apr 21 02:31:58 2008
@@ -22,13 +22,14 @@
 #include <config.h>
 #include <gnome.h>
  
-#include "seahorse-gpgmex.h"
 #include "seahorse-key-dialogs.h"
 #include "seahorse-key-widget.h"
-#include "seahorse-pgp-key-op.h"
 #include "seahorse-libdialogs.h"
 #include "seahorse-util.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key-op.h"
+
 static void
 ok_clicked (GtkButton *button, SeahorseWidget *swidget)
 {

Modified: trunk/src/seahorse-generate-select.c
==============================================================================
--- trunk/src/seahorse-generate-select.c	(original)
+++ trunk/src/seahorse-generate-select.c	Mon Apr 21 02:31:58 2008
@@ -24,11 +24,12 @@
 
 #include "seahorse-widget.h"
 #include "seahorse-util.h"
-#include "seahorse-pgp-key.h"
-#include "seahorse-ssh-key.h"
 #include "seahorse-key-dialogs.h"
 #include "seahorse-gtkstock.h"
 
+#include "pgp/seahorse-pgp-key.h"
+#include "ssh/seahorse-ssh-key.h"
+
 enum {
     KEY_TYPE,
     KEY_ICON,
@@ -65,11 +66,11 @@
     sksrc = seahorse_context_find_key_source (SCTX_APP (), ktype, SKEY_LOC_LOCAL);
     g_return_if_fail (sksrc != NULL);
     
-    if (ktype == SKEY_PGP)
+    if (ktype == SEA_PGP)
         seahorse_pgp_generate_show (SEAHORSE_PGP_SOURCE (sksrc), GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)));
         
 #ifdef WITH_SSH 
-    else if (ktype == SKEY_SSH)
+    else if (ktype == SEA_SSH)
         seahorse_ssh_generate_show (SEAHORSE_SSH_SOURCE (sksrc), GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)));
 #endif 
     
@@ -139,10 +140,10 @@
     
     /* Build our tree store */
     store = gtk_list_store_newv (KEY_N_COLUMNS, (GType*)key_columns);
-    add_key_type (store, SKEY_PGP, SEAHORSE_STOCK_SECRET, _("PGP Key"), 
+    add_key_type (store, SEA_PGP, SEAHORSE_STOCK_SECRET, _("PGP Key"), 
                   _("Used to encrypt email and files"));
 #ifdef WITH_SSH
-    add_key_type (store, SKEY_SSH, SEAHORSE_STOCK_KEY_SSH, _("Secure Shell Key"),
+    add_key_type (store, SEA_SSH, SEAHORSE_STOCK_KEY_SSH, _("Secure Shell Key"),
                   _("Used to access other computers (eg: via a terminal)"));
 #endif /* WITH_SSH */
     

Modified: trunk/src/seahorse-gkeyring-item-properties.c
==============================================================================
--- trunk/src/seahorse-gkeyring-item-properties.c	(original)
+++ trunk/src/seahorse-gkeyring-item-properties.c	Mon Apr 21 02:31:58 2008
@@ -24,13 +24,14 @@
 #include "seahorse-key-widget.h"
 #include "seahorse-util.h"
 #include "seahorse-key.h"
-#include "seahorse-gkeyring-item.h"
-#include "seahorse-gkeyring-source.h"
-#include "seahorse-gkeyring-operation.h"
 #include "seahorse-gtkstock.h"
 #include "seahorse-secure-memory.h"
 #include "seahorse-secure-entry.h"
 
+#include "gkr/seahorse-gkeyring-item.h"
+#include "gkr/seahorse-gkeyring-source.h"
+#include "gkr/seahorse-gkeyring-operation.h"
+
 /* -----------------------------------------------------------------------------
  * MAIN TAB 
  */

Modified: trunk/src/seahorse-key-dialogs.h
==============================================================================
--- trunk/src/seahorse-key-dialogs.h	(original)
+++ trunk/src/seahorse-key-dialogs.h	Mon Apr 21 02:31:58 2008
@@ -26,13 +26,14 @@
 #include <gtk/gtk.h>
 
 #include "seahorse-context.h"
-#include "seahorse-pgp-key.h"
+
+#include "pgp/seahorse-pgp-key.h"
 
 #ifdef WITH_SSH
-#include "seahorse-ssh-key.h"
+#include "ssh/seahorse-ssh-key.h"
 #endif
 
-#include "seahorse-gkeyring-item.h"
+#include "gkr/seahorse-gkeyring-item.h"
 
 void        seahorse_key_properties_new (SeahorsePGPKey     *pkey,
                                          GtkWindow          *parent);

Modified: trunk/src/seahorse-key-manager-store.c
==============================================================================
--- trunk/src/seahorse-key-manager-store.c	(original)
+++ trunk/src/seahorse-key-manager-store.c	Mon Apr 21 02:31:58 2008
@@ -28,13 +28,14 @@
 #include "seahorse-validity.h"
 #include "seahorse-util.h"
 #include "seahorse-gconf.h"
-#include "seahorse-gpgmex.h"
 #include "eggtreemultidnd.h"
-#include "seahorse-pgp-key.h"
 #include "seahorse-vfs-data.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key.h"
+
 #ifdef WITH_SSH
-#include "seahorse-ssh-key.h"
+#include "ssh/seahorse-ssh-key.h"
 #endif 
 
 #define KEY_MANAGER_SORT_KEY "/apps/seahorse/listing/sort_by"

Modified: trunk/src/seahorse-key-manager.c
==============================================================================
--- trunk/src/seahorse-key-manager.c	(original)
+++ trunk/src/seahorse-key-manager.c	Mon Apr 21 02:31:58 2008
@@ -25,7 +25,6 @@
 #include <gconf/gconf-client.h>
 #include <libgnomevfs/gnome-vfs.h>
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-windows.h"
 #include "seahorse-widget.h"
 #include "seahorse-progress.h"
@@ -35,24 +34,26 @@
 #include "seahorse-validity.h"
 #include "seahorse-key-manager-store.h"
 #include "seahorse-key-dialogs.h"
-#include "seahorse-pgp-key-op.h"
 #include "seahorse-key-widget.h"
-#include "seahorse-gpg-options.h"
 #include "seahorse-gconf.h"
 #include "seahorse-gtkstock.h"
 #include "seahorse-key-source.h"
 #include "seahorse-vfs-data.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-gpg-options.h"
+#include "pgp/seahorse-pgp-key-op.h"
+
 #ifdef WITH_KEYSERVER
 #include "seahorse-keyserver-sync.h"
 #endif
 
 #ifdef WITH_SSH
-#include "seahorse-ssh-key.h"
+#include "ssh/seahorse-ssh-key.h"
 #endif
 
-#include "seahorse-gkeyring-item.h"
-#include "seahorse-gkeyring-source.h"
+#include "gkr/seahorse-gkeyring-item.h"
+#include "gkr/seahorse-gkeyring-source.h"
 
 #define TRACK_SELECTED_KEY    "track-selected-keyid"
 #define TRACK_SELECTED_TAB    "track-selected-tabid"
@@ -741,7 +742,7 @@
     
     /* Only supported on PGP keys */
     for (l = keys; l; l = g_list_next (l)) {
-        if (seahorse_key_get_ktype (SEAHORSE_KEY (l->data)) != SKEY_PGP) {
+        if (seahorse_key_get_ktype (SEAHORSE_KEY (l->data)) != SEA_PGP) {
             keys = l = g_list_delete_link (keys, l);
             if (keys == NULL)
                 break;
@@ -749,7 +750,7 @@
     }
     
     if (keys == NULL)
-        keys = seahorse_context_find_keys (SCTX_APP (), SKEY_PGP, 0, SKEY_LOC_LOCAL);
+        keys = seahorse_context_find_keys (SCTX_APP (), SEA_PGP, 0, SKEY_LOC_LOCAL);
     seahorse_keyserver_sync_show (keys,GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)));
     g_list_free (keys);
 #endif
@@ -764,7 +765,7 @@
     
     /* Only supported on SSH keys */
     for (l = keys; l; l = g_list_next (l)) {
-        if (seahorse_key_get_ktype (SEAHORSE_KEY (l->data)) != SKEY_SSH) {
+        if (seahorse_key_get_ktype (SEAHORSE_KEY (l->data)) != SEA_SSH) {
             keys = l = g_list_delete_link (keys, l);
             if (keys == NULL)
                 break;
@@ -973,11 +974,11 @@
     gtk_action_group_set_sensitive (actions, selected);
     
     actions = seahorse_widget_find_actions (swidget, "pgp");
-    gtk_action_group_set_sensitive (actions, ((ktype == SKEY_PGP) && (seahorse_key_get_etype (skey) != SKEY_PRIVATE)));
+    gtk_action_group_set_sensitive (actions, ((ktype == SEA_PGP) && (seahorse_key_get_etype (skey) != SKEY_PRIVATE)));
     
 #ifdef WITH_SSH    
     actions = seahorse_widget_find_actions (swidget, "ssh");
-    gtk_action_group_set_sensitive (actions, ktype == SKEY_SSH);
+    gtk_action_group_set_sensitive (actions, ktype == SEA_SSH);
 #endif    
     
     /* This is called as a one-time idle handler, return FALSE so we don't get run again */

Modified: trunk/src/seahorse-key-properties.c
==============================================================================
--- trunk/src/seahorse-key-properties.c	(original)
+++ trunk/src/seahorse-key-properties.c	Mon Apr 21 02:31:58 2008
@@ -27,19 +27,20 @@
 #include <gnome.h>
 #include <time.h>
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-key-dialogs.h"
 #include "seahorse-key-widget.h"
 #include "seahorse-util.h"
 #include "seahorse-key.h"
-#include "seahorse-pgp-key.h"
-#include "seahorse-pgp-key-op.h"
 #include "seahorse-gtkstock.h"
 #include "seahorse-windows.h"
 #include "seahorse-vfs-data.h"
 #include "seahorse-key-model.h"
 #include "seahorse-gconf.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key.h"
+#include "pgp/seahorse-pgp-key-op.h"
+
 #ifdef WITH_KEYSERVER
 #include "seahorse-keyserver-sync.h"
 #endif
@@ -346,7 +347,7 @@
         }
         
         /* Pass it to 'DiscoverKeys' for resolution/download */
-        keys = seahorse_context_discover_keys (SCTX_APP (), SKEY_PGP, rawids);
+        keys = seahorse_context_discover_keys (SCTX_APP (), SEA_PGP, rawids);
         g_slist_free (rawids);
         rawids = NULL;
         
@@ -1480,7 +1481,7 @@
         rawids = unique_slist_strings (rawids);
         
         /* Pass it to 'DiscoverKeys' for resolution/download */
-        keys = seahorse_context_discover_keys (SCTX_APP (), SKEY_PGP, rawids);
+        keys = seahorse_context_discover_keys (SCTX_APP (), SEA_PGP, rawids);
         g_slist_free (rawids);
         rawids = NULL;
         

Modified: trunk/src/seahorse-keyserver-results.c
==============================================================================
--- trunk/src/seahorse-keyserver-results.c	(original)
+++ trunk/src/seahorse-keyserver-results.c	Mon Apr 21 02:31:58 2008
@@ -22,14 +22,12 @@
 #include <config.h>
 #include <gnome.h>
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-windows.h"
 #include "seahorse-widget.h"
 #include "seahorse-preferences.h"
 #include "seahorse-util.h"
 #include "seahorse-operation.h"
 #include "seahorse-key.h"
-#include "seahorse-pgp-key.h"
 #include "seahorse-operation.h"
 #include "seahorse-progress.h"
 #include "seahorse-key-manager-store.h"
@@ -37,6 +35,9 @@
 #include "seahorse-key-dialogs.h"
 #include "seahorse-vfs-data.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key.h"
+
 #define KEY_LIST "key_list"
 
 /* SIGNAL CALLBACKS --------------------------------------------------------- */
@@ -523,7 +524,7 @@
     
     /* Our predicate for filtering keys */
     pred = g_new0 (SeahorseKeyPredicate, 1);
-    pred->ktype = SKEY_PGP;
+    pred->ktype = SEA_PGP;
     pred->etype = SKEY_PUBLIC;
     pred->location = SKEY_LOC_REMOTE;
     pred->custom = (SeahorseKeyPredFunc)filter_keyset;

Modified: trunk/src/seahorse-keyserver-search.c
==============================================================================
--- trunk/src/seahorse-keyserver-search.c	(original)
+++ trunk/src/seahorse-keyserver-search.c	Mon Apr 21 02:31:58 2008
@@ -22,16 +22,17 @@
 #include <gnome.h>
 
 #include "seahorse-widget.h"
-#include "seahorse-gpgmex.h"
 #include "seahorse-util.h"
 #include "seahorse-context.h"
 #include "seahorse-windows.h"
 #include "seahorse-preferences.h"
-#include "seahorse-server-source.h"
 #include "seahorse-gconf.h"
 #include "seahorse-context.h"
 #include "seahorse-dns-sd.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-server-source.h"
+
 typedef struct _KeyserverSelection {
     GSList *names;
     GSList *uris;

Modified: trunk/src/seahorse-keyserver-sync.c
==============================================================================
--- trunk/src/seahorse-keyserver-sync.c	(original)
+++ trunk/src/seahorse-keyserver-sync.c	Mon Apr 21 02:31:58 2008
@@ -24,16 +24,17 @@
 
 #include "seahorse-widget.h"
 #include "seahorse-util.h"
-#include "seahorse-gpgmex.h"
 #include "seahorse-context.h"
 #include "seahorse-windows.h"
 #include "seahorse-progress.h"
 #include "seahorse-preferences.h"
-#include "seahorse-server-source.h"
 #include "seahorse-gconf.h"
 #include "seahorse-transfer-operation.h"
 #include "seahorse-keyserver-sync.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-server-source.h"
+
 static void 
 sync_import_complete (SeahorseOperation *op, SeahorseKeySource *sksrc)
 {

Modified: trunk/src/seahorse-pgp-generate.c
==============================================================================
--- trunk/src/seahorse-pgp-generate.c	(original)
+++ trunk/src/seahorse-pgp-generate.c	Mon Apr 21 02:31:58 2008
@@ -22,9 +22,6 @@
 #include "config.h"
 #include <gnome.h>
 
-#include "seahorse-pgp-source.h"
-#include "seahorse-pgp-key.h"
-#include "seahorse-pgp-key-op.h"
 #include "seahorse-widget.h"
 #include "seahorse-util.h"
 #include "seahorse-key-dialogs.h"
@@ -32,6 +29,10 @@
 #include "seahorse-gtkstock.h"
 #include "seahorse-passphrase.h"
 
+#include "pgp/seahorse-pgp-key.h"
+#include "pgp/seahorse-pgp-key-op.h"
+#include "pgp/seahorse-pgp-source.h"
+
 typedef struct _AlgorithmDesc {
     const gchar* desc;
     guint type;

Modified: trunk/src/seahorse-photos.c
==============================================================================
--- trunk/src/seahorse-photos.c	(original)
+++ trunk/src/seahorse-photos.c	Mon Apr 21 02:31:58 2008
@@ -30,7 +30,8 @@
 #include "seahorse-widget.h"
 #include "seahorse-util.h"
 #include "seahorse-key-dialogs.h"
-#include "seahorse-pgp-key-op.h"
+
+#include "pgp/seahorse-pgp-key-op.h"
 
 #define DEFAULT_WIDTH    120
 #define DEFAULT_HEIGHT   150

Modified: trunk/src/seahorse-revoke.c
==============================================================================
--- trunk/src/seahorse-revoke.c	(original)
+++ trunk/src/seahorse-revoke.c	Mon Apr 21 02:31:58 2008
@@ -22,13 +22,14 @@
 #include <config.h> 
 #include <gnome.h>
  
-#include "seahorse-gpgmex.h"
 #include "seahorse-key-dialogs.h"
 #include "seahorse-key-widget.h"
-#include "seahorse-pgp-key-op.h"
 #include "seahorse-libdialogs.h"
 #include "seahorse-util.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key-op.h"
+
 enum {
   COLUMN_TEXT,
   COLUMN_TOOLTIP,

Modified: trunk/src/seahorse-sign.c
==============================================================================
--- trunk/src/seahorse-sign.c	(original)
+++ trunk/src/seahorse-sign.c	Mon Apr 21 02:31:58 2008
@@ -22,16 +22,17 @@
 
 #include <gnome.h>
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-windows.h"
 #include "seahorse-key-widget.h"
-#include "seahorse-pgp-key-op.h"
 #include "seahorse-util.h"
 #include "seahorse-keyset.h"
 #include "seahorse-gtkstock.h"
 #include "seahorse-combo-keys.h"
 #include "seahorse-gconf.h"
 
+#include "pgp/seahorse-gpgmex.h"
+#include "pgp/seahorse-pgp-key-op.h"
+
 #ifdef WITH_KEYSERVER
 #include "seahorse-keyserver-sync.h"
 #endif

Modified: trunk/src/seahorse-ssh-generate.c
==============================================================================
--- trunk/src/seahorse-ssh-generate.c	(original)
+++ trunk/src/seahorse-ssh-generate.c	Mon Apr 21 02:31:58 2008
@@ -22,15 +22,16 @@
 #include "config.h"
 #include <gnome.h>
 
-#include "seahorse-ssh-source.h"
-#include "seahorse-ssh-key.h"
-#include "seahorse-ssh-operation.h"
 #include "seahorse-widget.h"
 #include "seahorse-util.h"
 #include "seahorse-key-dialogs.h"
 #include "seahorse-progress.h"
 #include "seahorse-gtkstock.h"
 
+#include "ssh/seahorse-ssh-source.h"
+#include "ssh/seahorse-ssh-key.h"
+#include "ssh/seahorse-ssh-operation.h"
+
 #define DSA_SIZE 1024
 #define DEFAULT_RSA_SIZE 2048
 

Modified: trunk/src/seahorse-ssh-key-properties.c
==============================================================================
--- trunk/src/seahorse-ssh-key-properties.c	(original)
+++ trunk/src/seahorse-ssh-key-properties.c	Mon Apr 21 02:31:58 2008
@@ -24,12 +24,14 @@
 #include "seahorse-key-widget.h"
 #include "seahorse-util.h"
 #include "seahorse-key.h"
-#include "seahorse-ssh-key.h"
-#include "seahorse-ssh-operation.h"
 #include "seahorse-vfs-data.h"
-#include "seahorse-gpgmex.h"
 #include "seahorse-gtkstock.h"
 
+#include "pgp/seahorse-gpgmex.h"
+
+#include "ssh/seahorse-ssh-key.h"
+#include "ssh/seahorse-ssh-operation.h"
+
 #define NOTEBOOK "notebook"
 
 static void

Modified: trunk/src/seahorse-ssh-upload.c
==============================================================================
--- trunk/src/seahorse-ssh-upload.c	(original)
+++ trunk/src/seahorse-ssh-upload.c	Mon Apr 21 02:31:58 2008
@@ -28,9 +28,10 @@
 #include "seahorse-windows.h"
 #include "seahorse-progress.h"
 #include "seahorse-gtkstock.h"
-#include "seahorse-ssh-source.h"
-#include "seahorse-ssh-key.h"
-#include "seahorse-ssh-operation.h"
+
+#include "ssh/seahorse-ssh-source.h"
+#include "ssh/seahorse-ssh-key.h"
+#include "ssh/seahorse-ssh-operation.h"
 
 static void 
 upload_complete (SeahorseOperation *op, gpointer dummy)

Modified: trunk/src/seahorse-windows.h
==============================================================================
--- trunk/src/seahorse-windows.h	(original)
+++ trunk/src/seahorse-windows.h	Mon Apr 21 02:31:58 2008
@@ -23,8 +23,6 @@
 #ifndef __SEAHORSE_WINDOWS_H__
 #define __SEAHORSE_WINDOWS_H__
 
-#include <gpgme.h>
-
 #include "seahorse-context.h"
 
 GtkWindow*	seahorse_key_manager_show	        (SeahorseOperation *op);

Added: trunk/ssh/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/ssh/Makefile.am	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,39 @@
+
+gladedir = $(datadir)/seahorse/glade/
+localedir = $(datadir)/locale
+seahorselibexecbindir = $(libdir)/seahorse/
+
+INCLUDES = -I$(top_builddir) \
+	-I$(top_srcdir) \
+	-I$(top_srcdir)/libcryptui \
+	-I$(top_srcdir)/libseahorse \
+	$(SEAHORSE_CFLAGS) \
+	-DDATA_DIR=\""$(datadir)"\" \
+	-DSEAHORSE_GLADEDIR=\""$(gladedir)"\" \
+	-DLOCALEDIR=\"$(localedir)\" \
+	-DEXECDIR=\""$(seahorselibexecbindir)"\" \
+	-DLIBCRYPTUI_API_SUBJECT_TO_CHANGE 
+
+noinst_LTLIBRARIES = libsea-ssh.la
+
+libsea_ssh_la_SOURCES = \
+	sea-ssh.c sea-ssh.h \
+	seahorse-algo.c seahorse-algo.h \
+	seahorse-ssh-key-data.c seahorse-ssh-key-data.h \
+	seahorse-ssh-key.c seahorse-ssh-key.h  \
+	seahorse-ssh-source.c seahorse-ssh-source.h \
+	seahorse-ssh-operation.c seahorse-ssh-operation.h
+	
+libsea_ssh_la_LIBADD = \
+	$(top_builddir)/libseahorse/libseahorse.la \
+	$(top_builddir)/libcryptui/libcryptui.la
+
+seahorselibexecbin_PROGRAMS = seahorse-ssh-askpass
+
+seahorse_ssh_askpass_SOURCES = seahorse-ssh-askpass.c
+seahorse_ssh_askpass_LDADD = \
+	$(top_builddir)/libseahorse/libseahorse.la \
+	$(top_builddir)/libcryptui/libcryptui.la \
+	$(SEAHORSE_LIBS)
+
+	
\ No newline at end of file

Added: trunk/ssh/sea-ssh.c
==============================================================================
--- (empty file)
+++ trunk/ssh/sea-ssh.c	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,11 @@
+
+#include "config.h"
+
+#include "sea-ssh.h"
+
+#include "seahorse-ssh-source.h"
+
+const SeaRegisterType SEA_SSH_REGISTRY[] = {
+	seahorse_ssh_source_get_type,
+	NULL
+};

Added: trunk/ssh/sea-ssh.h
==============================================================================
--- (empty file)
+++ trunk/ssh/sea-ssh.h	Mon Apr 21 02:31:58 2008
@@ -0,0 +1,11 @@
+#ifndef SEASSH_H_
+#define SEASSH_H_
+
+#include "common/sea-registry.h"
+
+#define SEA_SSH_STR                     "openssh"
+#define SEA_SSH                         (g_quark_from_static_string (SEA_SSH_STR))
+
+extern const SeaRegisterType SEA_SSH_REGISTRY[];
+
+#endif /*SEASSH_H_*/

Copied: trunk/ssh/seahorse-ssh-key.c (from r2186, /trunk/libseahorse/seahorse-ssh-key.c)
==============================================================================
--- /trunk/libseahorse/seahorse-ssh-key.c	(original)
+++ trunk/ssh/seahorse-ssh-key.c	Mon Apr 21 02:31:58 2008
@@ -100,7 +100,7 @@
     }
     
     /* Now start setting the main SeahorseKey fields */
-    key->ktype = SKEY_SSH;
+    key->ktype = SEA_SSH;
     key->keyid = 0;
     
     if (!skey->keydata || !skey->keydata->fingerprint) {
@@ -131,7 +131,7 @@
     }
     
     if (!key->keyid)
-        key->keyid = g_quark_from_string (SKEY_SSH_STR ":UNKNOWN ");
+        key->keyid = g_quark_from_string (SEA_SSH_STR ":UNKNOWN ");
     
     seahorse_key_changed (key, SKEY_CHANGE_ALL);
 }
@@ -406,7 +406,7 @@
     /* Not enough characters */
     g_return_val_if_fail (off == 0, 0);
 
-    hex = g_strdup_printf ("%s:%s", SKEY_SSH_STR, canonical_id);
+    hex = g_strdup_printf ("%s:%s", SEA_SSH_STR, canonical_id);
     ret = g_quark_from_string (hex);
     
     g_free (canonical_id);

Copied: trunk/ssh/seahorse-ssh-key.h (from r2186, /trunk/libseahorse/seahorse-ssh-key.h)
==============================================================================
--- /trunk/libseahorse/seahorse-ssh-key.h	(original)
+++ trunk/ssh/seahorse-ssh-key.h	Mon Apr 21 02:31:58 2008
@@ -41,13 +41,11 @@
 
 #include <gtk/gtk.h>
 
+#include "sea-ssh.h"
 #include "seahorse-key.h"
 #include "seahorse-ssh-source.h"
 #include "seahorse-ssh-key-data.h"
 
-#define SKEY_SSH_STR                     "openssh"
-#define SKEY_SSH                         (g_quark_from_static_string (SKEY_SSH_STR))
-
 #define SEAHORSE_TYPE_SSH_KEY            (seahorse_ssh_key_get_type ())
 #define SEAHORSE_SSH_KEY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_SSH_KEY, SeahorseSSHKey))
 #define SEAHORSE_SSH_KEY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_SSH_KEY, SeahorseSSHKeyClass))

Copied: trunk/ssh/seahorse-ssh-operation.c (from r2186, /trunk/libseahorse/seahorse-ssh-operation.c)
==============================================================================
--- /trunk/libseahorse/seahorse-ssh-operation.c	(original)
+++ trunk/ssh/seahorse-ssh-operation.c	Mon Apr 21 02:31:58 2008
@@ -27,9 +27,10 @@
 
 #include "seahorse-ssh-operation.h"
 #include "seahorse-util.h"
-#include "seahorse-gpgmex.h"
 #include "seahorse-passphrase.h"
 
+#include "pgp/seahorse-gpgmex.h"
+
 #include <gnome-keyring.h>
 
 #ifndef DEBUG_OPERATION_ENABLE

Copied: trunk/ssh/seahorse-ssh-source.c (from r2186, /trunk/libseahorse/seahorse-ssh-source.c)
==============================================================================
--- /trunk/libseahorse/seahorse-ssh-source.c	(original)
+++ trunk/ssh/seahorse-ssh-source.c	Mon Apr 21 02:31:58 2008
@@ -27,10 +27,12 @@
 #include <glib/gstdio.h>
 #include <libgnomevfs/gnome-vfs.h>
 
-#include "seahorse-gpgmex.h"
 #include "seahorse-ssh-source.h"
 #include "seahorse-operation.h"
 #include "seahorse-util.h"
+
+#include "pgp/seahorse-gpgmex.h"
+
 #include "seahorse-ssh-key.h"
 #include "seahorse-ssh-operation.h"
 
@@ -740,7 +742,7 @@
     
     switch (prop_id) {
     case PROP_KEY_TYPE:
-        g_value_set_uint (value, SKEY_SSH);
+        g_value_set_uint (value, SEA_SSH);
         break;
     case PROP_KEY_DESC:
         g_value_set_string (value, _("Secure Shell Key"));
@@ -855,6 +857,8 @@
     g_object_class_install_property (gobject_class, PROP_BASE_DIRECTORY,
         g_param_spec_string ("base-directory", "Key directory", "Directory where the keys are stored",
                              NULL, G_PARAM_READABLE));
+    
+	sea_registry_register_type (NULL, SEAHORSE_TYPE_SSH_SOURCE, "key-source", "local", SEA_SSH_STR, NULL);
 }
 
 /* -----------------------------------------------------------------------------

Copied: trunk/ssh/seahorse-ssh-source.h (from r2186, /trunk/libseahorse/seahorse-ssh-source.h)
==============================================================================
--- /trunk/libseahorse/seahorse-ssh-source.h	(original)
+++ trunk/ssh/seahorse-ssh-source.h	Mon Apr 21 02:31:58 2008
@@ -29,7 +29,7 @@
  * - Monitors ~/.ssh for changes and reloads the key ring as necessary.
  * 
  * Properties:
- *  ktype: (GQuark) The ktype (ie: SKEY_SSH) of keys originating from this 
+ *  ktype: (GQuark) The ktype (ie: SEA_SSH) of keys originating from this 
            key source.
  *  location: (SeahorseKeyLoc) The location of keys that come from this 
  *         source. (ie: SKEY_LOC_LOCAL)



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