seahorse r2636 - in trunk: . common daemon gkr libseahorse pgp pkcs11 po src ssh tests



Author: nnielsen
Date: Sat Nov 29 17:37:20 2008
New Revision: 2636
URL: http://svn.gnome.org/viewvc/seahorse?rev=2636&view=rev

Log:
	* common/Makefile.am:
	* common/seahorse-bind.c: (added)
	* common/seahorse-bind.h: (added)
	Added generic property binding from one object to another.
	
	* daemon/seahorse-service.c:
	* daemon/seahorse-service-crypto.c:
	* daemon/seahorse-service-keyset.c:
	* gkr/seahorse-gkr-commands.c:
	* gkr/seahorse-gkr-item.c:
	* gkr/seahorse-gkr-item.h:
	* gkr/seahorse-gkr-item-properties.c:
	* gkr/seahorse-gkr-operation.c:
	* gkr/seahorse-gkr-source.c:
	* libseahorse/libseahorse.vapi:
	* libseahorse/libseahorse-c.vapi:
	* libseahorse/Makefile.am:
	* libseahorse/seahorse-combo-keys.c:
	* libseahorse/seahorse-combo-keys.h:
	* libseahorse/seahorse-context.c:
	* libseahorse/seahorse-context.h:
	* libseahorse/seahorse-gtkstock.h:
	* libseahorse/seahorse-key.c: (removed)
	* libseahorse/seahorse-key.h: (removed)
	* libseahorse/seahorse-key-model.c: (moved to seahorse-object-model.c)
	* libseahorse/seahorse-key-model.h: (moved to seahorse-object-model.h)
	* libseahorse/seahorse-keyserver-control.c:
	* libseahorse/seahorse-key-widget.c: (moved to seahorse-object-widget.c)
	* libseahorse/seahorse-key-widget.h: (moved to seahorse-object-widget.h)
	* libseahorse/seahorse-notification.c:
	* libseahorse/seahorse-object.c:
	* libseahorse/seahorse-object.h:
	* libseahorse/seahorse-object.vala: (removed)
	* libseahorse/seahorse-object-model.c: (moved from seahorse-key-model.c)
	* libseahorse/seahorse-object-model.h: (moved from seahorse-key-model.h)
	* libseahorse/seahorse-object-widget.c: (moved from seahorse-key-widget.c)
	* libseahorse/seahorse-object-widget.h: (moved from seahorse-key-widget.h)
	* libseahorse/seahorse-progress.c:
	* libseahorse/seahorse-set.c:
	* libseahorse/seahorse-set.h:
	* libseahorse/seahorse-set-model.c:
	* libseahorse/seahorse-source.c:
	* libseahorse/seahorse-types.c:
	* libseahorse/seahorse-types.h:
	* libseahorse/seahorse-types.vala: (removed)
	* libseahorse/seahorse-unknown.c: (moved from seahorse-unknown-key.c)
	* libseahorse/seahorse-unknown.h: (moved from seahorse-unknown-key.h)
	* libseahorse/seahorse-unknown-key.c: (moved to seahorse-unknown.c)
	* libseahorse/seahorse-unknown-key.h: (moved from seahorse-unknown.h)
	* libseahorse/seahorse-unknown-source.c:
	* libseahorse/seahorse-util.c:
	* libseahorse/seahorse-util.h:
	* pgp/libseahorse-pgp-c.vapi:
	* pgp/seahorse-hkp-source.c:
	* pgp/seahorse-ldap-source.c:
	* pgp/seahorse-pgp-add-subkey.c:
	* pgp/seahorse-pgp-add-uid.c:
	* pgp/seahorse-pgp-commands.vala:
	* pgp/seahorse-pgp-expires.c:
	* pgp/seahorse-pgp-generate.c:
	* pgp/seahorse-pgp-key.c:
	* pgp/seahorse-pgp-key.h:
	* pgp/seahorse-pgp-key-op.c:
	* pgp/seahorse-pgp-key-properties.c:
	* pgp/seahorse-pgp-keysets.c:
	* pgp/seahorse-pgp-revoke.c:
	* pgp/seahorse-pgp-sign.c:
	* pgp/seahorse-pgp-source.c:
	* pgp/seahorse-pgp-uid.c:
	* pgp/seahorse-pgp-uid.h:
	* pgp/seahorse-server-source.c:
	* pgp/seahorse-signer.c:
	* pkcs11/seahorse-pkcs11-certificate.c:
	* pkcs11/seahorse-pkcs11-certificate.h:
	* pkcs11/seahorse-pkcs11-commands.c:
	* src/seahorse-key-manager.vala:
	* src/seahorse-key-manager-store.c:
	* src/seahorse-keyserver-results.vala:
	* src/seahorse-keyserver-sync.c:
	* src/seahorse-viewer.c:
	* ssh/libseahorse-ssh-c.vapi:
	* ssh/seahorse-ssh-commands.vala:
	* ssh/seahorse-ssh-generate.c:
	* ssh/seahorse-ssh-key.c:
	* ssh/seahorse-ssh-key.h:
	* ssh/seahorse-ssh-key-properties.c:
	* ssh/seahorse-ssh-operation.c:
	* ssh/seahorse-ssh-source.c:
	* ssh/seahorse-ssh-upload.c:
	Major refactoring. Remove SeahorseKey and use SeahorseObject directly. Remove the 
	changed signal from keys, and use GObject 'notify' signal instead. Standardize 
	set of properties, with all the common properties handled by SeahorseObject. 
	Cleanup concept of child objects. 
	

Added:
   trunk/common/seahorse-bind.c
   trunk/common/seahorse-bind.h
   trunk/libseahorse/seahorse-object-model.c   (contents, props changed)
      - copied, changed from r2632, /trunk/libseahorse/seahorse-key-model.c
   trunk/libseahorse/seahorse-object-model.h   (contents, props changed)
      - copied, changed from r2632, /trunk/libseahorse/seahorse-key-model.h
   trunk/libseahorse/seahorse-object-widget.c   (contents, props changed)
      - copied, changed from r2632, /trunk/libseahorse/seahorse-key-widget.c
   trunk/libseahorse/seahorse-object-widget.h   (contents, props changed)
      - copied, changed from r2632, /trunk/libseahorse/seahorse-key-widget.h
   trunk/libseahorse/seahorse-unknown.c   (contents, props changed)
      - copied, changed from r2632, /trunk/libseahorse/seahorse-unknown-key.c
   trunk/libseahorse/seahorse-unknown.h   (contents, props changed)
      - copied, changed from r2632, /trunk/libseahorse/seahorse-unknown-key.h
Removed:
   trunk/libseahorse/seahorse-key-model.c
   trunk/libseahorse/seahorse-key-model.h
   trunk/libseahorse/seahorse-key-widget.c
   trunk/libseahorse/seahorse-key-widget.h
   trunk/libseahorse/seahorse-key.c
   trunk/libseahorse/seahorse-key.h
   trunk/libseahorse/seahorse-object.vala
   trunk/libseahorse/seahorse-types.vala
   trunk/libseahorse/seahorse-unknown-key.c
   trunk/libseahorse/seahorse-unknown-key.h
Modified:
   trunk/ChangeLog
   trunk/common/Makefile.am
   trunk/daemon/seahorse-service-crypto.c
   trunk/daemon/seahorse-service-keyset.c
   trunk/daemon/seahorse-service.c
   trunk/gkr/seahorse-gkr-commands.c
   trunk/gkr/seahorse-gkr-item-properties.c
   trunk/gkr/seahorse-gkr-item.c
   trunk/gkr/seahorse-gkr-item.h
   trunk/gkr/seahorse-gkr-operation.c
   trunk/gkr/seahorse-gkr-source.c
   trunk/libseahorse/Makefile.am
   trunk/libseahorse/libseahorse-c.vapi
   trunk/libseahorse/libseahorse.gidl
   trunk/libseahorse/libseahorse.vapi
   trunk/libseahorse/seahorse-combo-keys.c
   trunk/libseahorse/seahorse-combo-keys.h
   trunk/libseahorse/seahorse-context.c
   trunk/libseahorse/seahorse-context.h
   trunk/libseahorse/seahorse-gtkstock.h
   trunk/libseahorse/seahorse-keyserver-control.c
   trunk/libseahorse/seahorse-notification.c
   trunk/libseahorse/seahorse-object.c
   trunk/libseahorse/seahorse-object.h
   trunk/libseahorse/seahorse-progress.c
   trunk/libseahorse/seahorse-set-model.c
   trunk/libseahorse/seahorse-set.c
   trunk/libseahorse/seahorse-set.h
   trunk/libseahorse/seahorse-source.c
   trunk/libseahorse/seahorse-types.c
   trunk/libseahorse/seahorse-types.h
   trunk/libseahorse/seahorse-unknown-source.c
   trunk/libseahorse/seahorse-util.c
   trunk/libseahorse/seahorse-util.h
   trunk/libseahorse/vala-build.stamp
   trunk/pgp/libseahorse-pgp-c.vapi
   trunk/pgp/seahorse-hkp-source.c
   trunk/pgp/seahorse-ldap-source.c
   trunk/pgp/seahorse-pgp-add-subkey.c
   trunk/pgp/seahorse-pgp-add-uid.c
   trunk/pgp/seahorse-pgp-commands.c
   trunk/pgp/seahorse-pgp-commands.vala
   trunk/pgp/seahorse-pgp-expires.c
   trunk/pgp/seahorse-pgp-generate.c
   trunk/pgp/seahorse-pgp-key-op.c
   trunk/pgp/seahorse-pgp-key-properties.c
   trunk/pgp/seahorse-pgp-key.c
   trunk/pgp/seahorse-pgp-key.h
   trunk/pgp/seahorse-pgp-keysets.c
   trunk/pgp/seahorse-pgp-revoke.c
   trunk/pgp/seahorse-pgp-sign.c
   trunk/pgp/seahorse-pgp-source.c
   trunk/pgp/seahorse-pgp-uid.c
   trunk/pgp/seahorse-pgp-uid.h
   trunk/pgp/seahorse-server-source.c
   trunk/pgp/seahorse-signer.c
   trunk/pgp/vala-build.stamp
   trunk/pkcs11/seahorse-pkcs11-certificate.c
   trunk/pkcs11/seahorse-pkcs11-certificate.h
   trunk/pkcs11/seahorse-pkcs11-commands.c
   trunk/pkcs11/vala-build.stamp
   trunk/po/POTFILES.in
   trunk/src/seahorse-key-manager-store.c
   trunk/src/seahorse-key-manager.c
   trunk/src/seahorse-key-manager.vala
   trunk/src/seahorse-keyserver-results.c
   trunk/src/seahorse-keyserver-results.vala
   trunk/src/seahorse-keyserver-sync.c
   trunk/src/seahorse-viewer.c
   trunk/src/vala-build.stamp
   trunk/ssh/libseahorse-ssh-c.vapi
   trunk/ssh/seahorse-ssh-commands.c
   trunk/ssh/seahorse-ssh-commands.vala
   trunk/ssh/seahorse-ssh-generate.c
   trunk/ssh/seahorse-ssh-key-properties.c
   trunk/ssh/seahorse-ssh-key.c
   trunk/ssh/seahorse-ssh-key.h
   trunk/ssh/seahorse-ssh-operation.c
   trunk/ssh/seahorse-ssh-source.c
   trunk/ssh/seahorse-ssh-upload.c
   trunk/ssh/vala-build.stamp
   trunk/tests/dbus-crypto-test.py
   trunk/tests/dbus-display-notification-test.py

Modified: trunk/common/Makefile.am
==============================================================================
--- trunk/common/Makefile.am	(original)
+++ trunk/common/Makefile.am	Sat Nov 29 17:37:20 2008
@@ -8,6 +8,7 @@
 noinst_LTLIBRARIES = libseahorse-common.la
 
 libseahorse_common_la_SOURCES = \
+	seahorse-bind.c seahorse-bind.h \
 	seahorse-cleanup.c seahorse-cleanup.h \
 	seahorse-registry.c seahorse-registry.h
 	
\ No newline at end of file

Added: trunk/common/seahorse-bind.c
==============================================================================
--- (empty file)
+++ trunk/common/seahorse-bind.c	Sat Nov 29 17:37:20 2008
@@ -0,0 +1,555 @@
+/* 
+ * Seahorse
+ * 
+ * Copyright (C) 2008 Stefan Walter
+ * 
+ * This program is free software; you can redistribute it and/or modify 
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *  
+ * This program 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
+ * Lesser General Public License for more details.
+ *  
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.  
+ */
+   
+#include "config.h"
+
+#include "seahorse-bind.h"
+
+#include <string.h>
+
+static gboolean
+value_equal (const GValue *a, const GValue *b)
+{
+	gboolean retval;
+	const gchar *stra, *strb;
+
+	if (G_VALUE_TYPE (a) != G_VALUE_TYPE (b))
+		return FALSE;
+	
+	switch (G_VALUE_TYPE (a))
+	{
+	case G_TYPE_BOOLEAN:
+		if (g_value_get_boolean (a) < g_value_get_boolean (b))
+			retval = FALSE;
+		else if (g_value_get_boolean (a) == g_value_get_boolean (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_CHAR:
+		if (g_value_get_char (a) < g_value_get_char (b))
+			retval = FALSE;
+		else if (g_value_get_char (a) == g_value_get_char (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_UCHAR:
+		if (g_value_get_uchar (a) < g_value_get_uchar (b))
+			retval = FALSE;
+		else if (g_value_get_uchar (a) == g_value_get_uchar (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_INT:
+		if (g_value_get_int (a) < g_value_get_int (b))
+			retval = FALSE;
+		else if (g_value_get_int (a) == g_value_get_int (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_UINT:
+		if (g_value_get_uint (a) < g_value_get_uint (b))
+			retval = FALSE;
+		else if (g_value_get_uint (a) == g_value_get_uint (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_LONG:
+		if (g_value_get_long (a) < g_value_get_long (b))
+			retval = FALSE;
+		else if (g_value_get_long (a) == g_value_get_long (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_ULONG:
+		if (g_value_get_ulong (a) < g_value_get_ulong (b))
+			retval = FALSE;
+		else if (g_value_get_ulong (a) == g_value_get_ulong (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_INT64:
+		if (g_value_get_int64 (a) < g_value_get_int64 (b))
+			retval = FALSE;
+		else if (g_value_get_int64 (a) == g_value_get_int64 (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_UINT64:
+		if (g_value_get_uint64 (a) < g_value_get_uint64 (b))
+			retval = FALSE;
+		else if (g_value_get_uint64 (a) == g_value_get_uint64 (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_ENUM:
+		/* this is somewhat bogus. */
+		if (g_value_get_enum (a) < g_value_get_enum (b))
+			retval = FALSE;
+		else if (g_value_get_enum (a) == g_value_get_enum (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_FLAGS:
+		/* this is even more bogus. */
+		if (g_value_get_flags (a) < g_value_get_flags (b))
+			retval = FALSE;
+		else if (g_value_get_flags (a) == g_value_get_flags (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_FLOAT:
+		if (g_value_get_float (a) < g_value_get_float (b))
+			retval = FALSE;
+		else if (g_value_get_float (a) == g_value_get_float (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_DOUBLE:
+		if (g_value_get_double (a) < g_value_get_double (b))
+			retval = FALSE;
+		else if (g_value_get_double (a) == g_value_get_double (b))
+			retval = TRUE;
+		else
+			retval = FALSE;
+		break;
+	case G_TYPE_STRING:
+		stra = g_value_get_string (a);
+		strb = g_value_get_string (b);
+		if (stra == strb)
+			retval = TRUE;
+		else if (!stra || !strb)
+			retval = FALSE;
+		else
+			retval = g_utf8_collate (stra, strb) == 0;
+		break;
+	case G_TYPE_POINTER:
+		retval = (g_value_get_pointer (a) == g_value_get_pointer (b));
+		break;
+	case G_TYPE_BOXED:
+		retval = (g_value_get_boxed (a) == g_value_get_boxed (b));
+		break;
+	case G_TYPE_OBJECT:
+		retval = (g_value_get_object (a) == g_value_get_object (b));
+		break;
+	default:
+		/* Default case is not equal */
+		retval = FALSE;
+		break;
+	}
+	
+	return retval;
+}
+
+static GHashTable *all_bindings = NULL;
+
+typedef struct _Binding {
+	GObject *obj_src;
+	GParamSpec *prop_src;
+	GParamSpec *prop_dest;
+	GSList *obj_dests;
+	
+	gulong connection;
+	SeahorseTransform transform;
+	gboolean processing;
+	
+	gint references;
+} Binding;
+
+static void binding_unref (Binding *binding);
+static void binding_ref (Binding *binding);
+
+static void 
+binding_src_gone (gpointer data, GObject *was)
+{
+	Binding *binding = (Binding*)data;
+	g_assert (binding->obj_src == was);
+	binding->obj_src = NULL;
+	binding_unref (binding);
+}
+
+static void
+binding_dest_gone (gpointer data, GObject *was)
+{
+	Binding *binding = (Binding*)data;
+	GSList *at;
+
+	at = g_slist_find (binding->obj_dests, was);
+	g_assert (at != NULL);
+	
+	/* Remove it from the list */
+	binding->obj_dests = g_slist_delete_link (binding->obj_dests, at);
+	
+	/* If no more destination objects, then go away */
+	if (!binding->obj_dests)
+		binding_unref (binding);
+}
+
+static void 
+binding_ref (Binding *binding)
+{
+	g_assert (binding);
+	++binding->references;
+}
+
+static void
+binding_unref (Binding *binding)
+{
+	GSList *l;
+
+	g_assert (binding);
+	
+	g_assert (binding->references > 0);
+	--binding->references;
+	if (binding->references > 0)
+		return;
+	
+	if (G_IS_OBJECT (binding->obj_src)) {
+		g_signal_handler_disconnect (binding->obj_src, binding->connection);
+		g_object_weak_unref (binding->obj_src, binding_src_gone, binding);
+		binding->obj_src = NULL;
+	}
+	
+	for (l = binding->obj_dests; l; l = g_slist_next (l)) {
+		if (G_IS_OBJECT (l->data))
+			g_object_weak_unref (l->data, binding_dest_gone, binding);
+	}
+	g_slist_free (binding->obj_dests);
+	binding->obj_dests = NULL;
+	
+	g_assert (binding->prop_src);
+	g_param_spec_unref (binding->prop_src);
+	binding->prop_src = NULL;
+	
+	g_assert (binding->prop_dest);
+	g_param_spec_unref (binding->prop_dest);
+	binding->prop_dest = NULL;
+	
+	g_free (binding);
+	
+	/* Remove from the list of all bindings */
+	g_assert (all_bindings);
+	g_hash_table_remove (all_bindings, binding);
+	if (g_hash_table_size (all_bindings) == 0) {
+		g_hash_table_destroy (all_bindings);
+		all_bindings = NULL;
+	}
+}
+
+static void
+bind_transfer (Binding *binding, gboolean forward)
+{
+	GValue src, dest, check;
+	GSList *l;
+	
+	g_assert (binding->obj_src);
+	g_assert (binding->obj_dests);
+	
+	/* IMPORTANT: No return during this fuction */
+	binding_ref (binding);
+	binding->processing = TRUE;
+
+	/* Get the value from the source object */
+	memset (&src, 0, sizeof (src));
+	g_value_init (&src, binding->prop_src->value_type);
+	g_object_get_property (binding->obj_src, binding->prop_src->name, &src);
+	
+	/* Transform the value */
+	memset (&dest, 0, sizeof (dest));
+	g_value_init (&dest, binding->prop_dest->value_type);
+	if ((binding->transform) (&src, &dest)) {
+
+
+		for (l = binding->obj_dests; l; l = g_slist_next (l)) {
+
+			/* Get the current value of the destination object */
+			memset (&check, 0, sizeof (check));
+			g_value_init (&check, binding->prop_dest->value_type);
+			g_object_get_property (l->data, binding->prop_dest->name, &check);
+			
+			/* Set the property on the destination object */
+			if (!value_equal (&dest, &check))
+				g_object_set_property (l->data, binding->prop_dest->name, &dest);
+
+			g_value_unset (&check);
+		}
+
+	} else {
+		
+		g_warning ("couldn't transform value from '%s' to '%s' when trying to "
+		           "transfer bound property from %s.%s to %s.%s",
+		           g_type_name (binding->prop_src->value_type), 
+		           g_type_name (binding->prop_dest->value_type),
+		           G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (binding->obj_src)), 
+		           binding->prop_src->name,
+		           G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (binding->obj_dests->data)), 
+		           binding->prop_dest->name);
+	}
+	
+	g_value_unset (&src);
+	g_value_unset (&dest);
+	
+	binding->processing = FALSE;
+	binding_unref (binding);
+}
+
+static void 
+binding_fire (GObject *gobject, GParamSpec *pspec, gpointer data)
+{
+	Binding *binding = (Binding*)data;
+	g_assert (gobject == binding->obj_src);
+	g_assert (pspec == binding->prop_src);
+	g_assert (binding->transform);
+	
+	if (!binding->processing)
+		bind_transfer (binding, TRUE);
+}
+
+gpointer 
+seahorse_bind_property (const gchar *prop_src, gpointer obj_src, 
+                        const gchar *prop_dest, gpointer obj_dest)
+{
+	g_return_val_if_fail (G_IS_OBJECT (obj_src), NULL);
+	g_return_val_if_fail (prop_src, NULL);
+	g_return_val_if_fail (G_IS_OBJECT (obj_dest), NULL);
+	g_return_val_if_fail (prop_dest, NULL);
+	
+	return seahorse_bind_property_full (prop_src, obj_src,
+	                                    g_value_transform,
+	                                    prop_dest, obj_dest, NULL);
+}
+
+gpointer 
+seahorse_bind_property_full (const gchar *prop_src, gpointer obj_src,
+                             SeahorseTransform transform,
+                             const gchar *prop_dest, ...)
+{
+	GObjectClass *cls;
+	GParamSpec *spec_src;
+	GParamSpec *spec_dest;
+	GParamSpec *spec;
+	Binding *binding;
+	gchar *detail;
+	GObject *dest;
+	GSList *dests, *l;
+	va_list va;
+
+	g_return_val_if_fail (transform, NULL);
+	g_return_val_if_fail (G_IS_OBJECT (obj_src), NULL);
+	g_return_val_if_fail (prop_src, NULL);
+	g_return_val_if_fail (prop_dest, NULL);
+	
+	cls = G_OBJECT_GET_CLASS (obj_src);
+	spec_src = g_object_class_find_property (cls, prop_src);
+	if (!spec_src) {
+		g_warning ("no property with the name '%s' exists in object of class '%s'",
+		           prop_src, G_OBJECT_CLASS_NAME (cls));
+		return NULL;
+	}
+	
+	dests = NULL;
+	spec_dest = NULL;
+	va_start(va, prop_dest);
+	for (;;) {
+		dest = G_OBJECT (va_arg (va, GObject*));
+		if (!dest)
+			break;
+		
+		g_return_val_if_fail (G_IS_OBJECT (dest), NULL);
+		
+		cls = G_OBJECT_GET_CLASS (dest);
+		spec = g_object_class_find_property (cls, prop_dest);
+		if (!spec) {
+			g_warning ("no property with the name '%s' exists in object of class '%s'",
+			           prop_dest, G_OBJECT_CLASS_NAME (cls));
+			return NULL;
+		} 
+		
+		if (spec_dest && spec->value_type != spec_dest->value_type) {
+			g_warning ("destination property '%s' has a different type between objects in binding: %s != %s",
+			           prop_dest, g_type_name (spec_dest->value_type), g_type_name (spec->value_type));
+			return NULL;
+		} 
+		
+		dests = g_slist_prepend (dests, dest);
+		spec_dest = spec;
+	}
+
+	g_return_val_if_fail (spec_dest, NULL);
+	g_return_val_if_fail (dests, NULL);
+	
+	binding = g_new0 (Binding, 1);
+
+	binding->obj_src = obj_src;
+	g_object_weak_ref (obj_src, binding_src_gone, binding);
+	binding->prop_src = spec_src;
+	g_param_spec_ref (spec_src);
+	binding->transform = transform;
+	detail = g_strdup_printf ("notify::%s", prop_src);
+	binding->connection = g_signal_connect (obj_src, detail, G_CALLBACK (binding_fire), binding);
+	g_free (detail);
+	
+	binding->obj_dests = dests;
+	binding->prop_dest = spec_dest;
+	g_param_spec_ref (spec_dest);
+	for (l = binding->obj_dests; l; l = g_slist_next (l))
+		g_object_weak_ref (l->data, binding_dest_gone, binding);
+
+	binding->references = 1;
+	
+	/* Note this in all bindings */
+	if (!all_bindings)
+		all_bindings = g_hash_table_new (g_direct_hash, g_direct_equal);
+	g_hash_table_insert (all_bindings, binding, binding);
+	
+	/* Transfer the first time */
+	binding_fire (obj_src, spec_src, binding);
+	
+	return binding;
+}
+
+static GHashTable *all_transfers = NULL;
+
+typedef struct _Transfer {
+	GObject *object;
+	GObject *dest;
+	gulong connection;
+	SeahorseTransfer callback;
+} Transfer;
+
+static void transfer_free (Transfer *transfer);
+
+static void
+transfer_gone (gpointer data, GObject *was)
+{
+	Transfer *transfer = (Transfer*)data;
+	if (transfer->object == was)
+		transfer->object = NULL;
+	else if (transfer->dest == was)
+		transfer->dest = NULL;
+	else
+		g_assert_not_reached ();
+	transfer_free (transfer);
+}
+
+static void 
+transfer_free (Transfer *transfer)
+{
+	g_assert (transfer);
+	
+	if (G_IS_OBJECT (transfer->object)) {
+		g_object_weak_unref (transfer->object, transfer_gone, transfer);
+		g_signal_handler_disconnect (transfer->object, transfer->connection);
+		transfer->object = NULL;
+	}
+	
+	if (G_IS_OBJECT (transfer->dest)) {
+		g_object_weak_unref (transfer->dest, transfer_gone, transfer);
+		transfer->dest = NULL;
+	}
+	
+	g_free (transfer);
+	
+	/* Remove from the list of all notifies */
+	g_assert (all_transfers);
+	g_hash_table_remove (all_transfers, transfer);
+	if (g_hash_table_size (all_transfers) == 0) {
+		g_hash_table_destroy (all_transfers);
+		all_transfers = NULL;
+	}
+}
+
+static void
+transfer_fire (GObject *object, GParamSpec *spec, gpointer data)
+{
+	Transfer *transfer = (Transfer*)data;
+	g_assert (transfer->object == object);
+	(transfer->callback) (object, transfer->dest);
+}
+
+gpointer 
+seahorse_bind_objects (const gchar *property, gpointer object, 
+                       SeahorseTransfer callback, gpointer dest)
+{
+	GObjectClass *cls;
+	Transfer *transfer;
+	gchar *detail;
+
+	g_return_val_if_fail (G_IS_OBJECT (object), NULL);
+	g_return_val_if_fail (G_IS_OBJECT (dest), NULL);
+	g_return_val_if_fail (callback, NULL);
+	
+	if (property) {
+		cls = G_OBJECT_GET_CLASS (object);
+		if (!g_object_class_find_property (cls, property)) {
+			g_warning ("no property with the name '%s' exists in object of class '%s'",
+			           property, G_OBJECT_CLASS_NAME (cls));
+			return NULL;
+		}
+	}
+	
+	transfer = g_new0 (Transfer, 1);
+
+	transfer->object = object;
+	g_object_weak_ref (object, transfer_gone, transfer);
+	transfer->dest = dest;
+	g_object_weak_ref (dest, transfer_gone, transfer);
+	transfer->callback = callback;
+	
+	if (property) {
+		detail = g_strdup_printf ("notify::%s", property);
+		transfer->connection = g_signal_connect (object, detail, G_CALLBACK (transfer_fire), transfer);
+		g_free (detail);
+	} else {
+		transfer->connection = g_signal_connect (object, "notify", G_CALLBACK (transfer_fire), transfer);
+	}
+	
+	/* Note this in all bindings */
+	if (!all_transfers)
+		all_transfers = g_hash_table_new (g_direct_hash, g_direct_equal);
+	g_hash_table_insert (all_transfers, transfer, transfer);
+	
+	/* Transfer the first time */
+	transfer_fire (object, NULL, transfer);
+	
+	return transfer;
+}
+
+void
+seahorse_bind_disconnect (gpointer what)
+{
+	g_return_if_fail (what);
+	if (all_bindings && g_hash_table_lookup (all_bindings, what))
+		binding_unref ((Binding*)what);
+	else if (all_transfers && g_hash_table_lookup (all_transfers, what))
+		transfer_free ((Transfer*)what);
+}

Added: trunk/common/seahorse-bind.h
==============================================================================
--- (empty file)
+++ trunk/common/seahorse-bind.h	Sat Nov 29 17:37:20 2008
@@ -0,0 +1,43 @@
+/* 
+ * Seahorse
+ * 
+ * Copyright (C) 2008 Stefan Walter
+ * 
+ * This program is free software; you can redistribute it and/or modify 
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *  
+ * This program 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
+ * Lesser General Public License for more details.
+ *  
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.  
+ */
+   
+#ifndef SEAHORSEBIND_H_
+#define SEAHORSEBIND_H_
+
+#include <glib-object.h>
+
+typedef gboolean (*SeahorseTransform) (const GValue *src, GValue *dest);
+
+gpointer seahorse_bind_property      (const gchar *prop_src, gpointer obj_src, 
+                                      const gchar *prop_dest, gpointer obj_dest);
+
+gpointer seahorse_bind_property_full (const gchar *prop_src, gpointer obj_src,
+                                      SeahorseTransform transform, 
+                                      const gchar *prop_dest, ...) G_GNUC_NULL_TERMINATED;
+
+typedef gboolean (*SeahorseTransfer) (GObject *src, GObject *dest);
+
+gpointer seahorse_bind_objects       (const gchar *property, gpointer obj_src,
+                                      SeahorseTransfer transfer, gpointer obj_dest);
+
+void     seahorse_bind_disconnect    (gpointer binding);
+
+#endif /* SEAHORSEBIND_H_ */

Modified: trunk/daemon/seahorse-service-crypto.c
==============================================================================
--- trunk/daemon/seahorse-service-crypto.c	(original)
+++ trunk/daemon/seahorse-service-crypto.c	Sat Nov 29 17:37:20 2008
@@ -22,7 +22,7 @@
 #include "config.h"
 
 #include "seahorse-service.h"
-#include "seahorse-key.h"
+#include "seahorse-object.h"
 #include "seahorse-gconf.h"
 #include "seahorse-util.h"
 #include "seahorse-libdialogs.h"
@@ -125,11 +125,11 @@
 notify_signatures (const gchar* data, gpgme_verify_result_t status)
 {
 	const gchar *icon = NULL;
+	SeahorseObject *object;
 	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);
@@ -137,7 +137,7 @@
 	g_slist_free (rawids);
 
 	g_return_if_fail (keys != NULL);
-	skey = SEAHORSE_KEY (keys->data);
+	object = SEAHORSE_OBJECT (keys->data);
 	g_list_free (keys);
 
 	/* Figure out what to display */
@@ -191,7 +191,7 @@
 
 	if (sig) {
 		gchar *date = seahorse_util_get_display_date_string (status->signatures->timestamp);
-		gchar *id = seahorse_context_id_to_dbus (SCTX_APP (), seahorse_key_get_keyid (skey), 0);
+		gchar *id = seahorse_context_id_to_dbus (SCTX_APP (), seahorse_object_get_id (object));
 		body = g_markup_printf_escaped (body, id, date);
 		g_free (date);
 		g_free (id);
@@ -238,7 +238,7 @@
     
     /* The signer */
     if (signer && signer[0]) {
-        signkey = seahorse_context_object_from_dbus (SCTX_APP (), signer, NULL);
+        signkey = seahorse_context_object_from_dbus (SCTX_APP (), signer);
         if (!signkey) {
             g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID, 
                          _("Invalid or unrecognized signer: %s"), signer);
@@ -246,7 +246,7 @@
         }
         
         if (!SEAHORSE_IS_PGP_KEY (signkey) || 
-            !(seahorse_object_get_flags (signkey) & SKEY_FLAG_CAN_SIGN)) {
+            !(seahorse_object_get_flags (signkey) & SEAHORSE_FLAG_CAN_SIGN)) {
             g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID,
                          _("Key is not valid for signing: %s"), signer);
             return FALSE;
@@ -256,7 +256,7 @@
     /* The recipients */
     for( ; recipients[0]; recipients++)
     {
-        skey = seahorse_context_object_from_dbus (SCTX_APP (), recipients[0], NULL);
+        skey = seahorse_context_object_from_dbus (SCTX_APP (), recipients[0]);
         if (!skey) {
             g_list_free (recipkeys);
             g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID, 
@@ -265,7 +265,7 @@
         }
         
         if (!SEAHORSE_IS_PGP_KEY (skey) ||
-            !(seahorse_object_get_flags (skey) & SKEY_FLAG_CAN_ENCRYPT)) {
+            !(seahorse_object_get_flags (skey) & SEAHORSE_FLAG_CAN_ENCRYPT)) {
             g_list_free (recipkeys);
             g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID,
                          _("Key is not a valid recipient for encryption: %s"), recipients[0]);
@@ -345,7 +345,7 @@
         g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID,
                      _("No signer specified"));
     
-    signkey = seahorse_context_object_from_dbus (SCTX_APP (), signer, NULL);
+    signkey = seahorse_context_object_from_dbus (SCTX_APP (), signer);
     if (!signkey) {
         g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID, 
                      _("Invalid or unrecognized signer: %s"), signer);
@@ -353,7 +353,7 @@
     }
         
     if (!SEAHORSE_IS_PGP_KEY (signkey) || 
-        !(seahorse_object_get_flags (signkey) & SKEY_FLAG_CAN_SIGN)) {
+        !(seahorse_object_get_flags (signkey) & SEAHORSE_FLAG_CAN_SIGN)) {
         g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID,
                      _("Key is not valid for signing: %s"), signer);
         return FALSE;
@@ -436,7 +436,7 @@
                 status->signatures->summary & GPGME_SIGSUM_VALID ||
                 status->signatures->summary & GPGME_SIGSUM_KEY_MISSING) {
                 keyid = seahorse_pgp_key_get_cannonical_id (status->signatures->fpr);
-                *signer = seahorse_context_id_to_dbus (SCTX_APP (), keyid, 0);
+                *signer = seahorse_context_id_to_dbus (SCTX_APP (), keyid);
             }
         }
     }
@@ -499,7 +499,7 @@
                 status->signatures->summary & GPGME_SIGSUM_VALID ||
                 status->signatures->summary & GPGME_SIGSUM_KEY_MISSING) {
                 keyid = seahorse_pgp_key_get_cannonical_id (status->signatures->fpr);
-                *signer = seahorse_context_id_to_dbus (SCTX_APP (), keyid, 0);
+                *signer = seahorse_context_id_to_dbus (SCTX_APP (), keyid);
             }
         }
     }

Modified: trunk/daemon/seahorse-service-keyset.c
==============================================================================
--- trunk/daemon/seahorse-service-keyset.c	(original)
+++ trunk/daemon/seahorse-service-keyset.c	Sat Nov 29 17:37:20 2008
@@ -26,7 +26,7 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 
-#include "seahorse-key.h"
+#include "seahorse-object.h"
 #include "seahorse-service.h"
 #include "seahorse-util.h"
 
@@ -55,7 +55,7 @@
 }
 
 static gboolean
-match_remove_patterns (GArray *patterns, gchar *value)
+match_remove_patterns (GArray *patterns, const gchar *value)
 {
     gboolean matched = FALSE;
     gchar *lower;
@@ -63,7 +63,6 @@
     
     if(value) {
         lower = g_utf8_casefold (value, -1);
-        g_free (value);
         
         /* 
          * Search for each pattern on this key. We try to match
@@ -92,29 +91,30 @@
 seahorse_service_keyset_list_keys (SeahorseServiceKeyset *keyset, gchar ***keys, 
                                    GError **error)
 {
-	GList *k, *l;
-	GArray *a;
+	GList *objects, *l;
+	GList *children, *k;
+	GArray *array;
 	gchar *id;
-	guint nuids, i;
-    
-	k = seahorse_set_get_objects (SEAHORSE_SET (keyset));
-	a = g_array_new (TRUE, TRUE, sizeof (gchar*));
-    
-	for (l = k; l; l = g_list_next (l)) {
-		id = seahorse_context_object_to_dbus (SCTX_APP (), SEAHORSE_OBJECT (l->data), 0);
-		g_array_append_val (a, id);
-        
-		if (SEAHORSE_IS_KEY (l->data)) {
-			nuids = seahorse_key_get_num_names (SEAHORSE_KEY (l->data));
-			for (i = 1; i < nuids; i++) {
-				id = seahorse_context_object_to_dbus (SCTX_APP (), SEAHORSE_OBJECT (l->data), i);
-				g_array_append_val (a, id);
-			}
+
+	array = g_array_new (TRUE, TRUE, sizeof (gchar*));
+
+	/* The objects in the set */
+	objects = seahorse_set_get_objects (SEAHORSE_SET (keyset));
+	for (l = objects; l; l = g_list_next (l)) {
+		id = seahorse_context_object_to_dbus (SCTX_APP (), SEAHORSE_OBJECT (l->data));
+		g_array_append_val (array, id);
+
+		/* Children of the object */
+		children = seahorse_object_get_children (SEAHORSE_OBJECT (l->data));
+		for (k = children; k; k = g_list_next (k)) {
+			id = seahorse_context_object_to_dbus (SCTX_APP (), SEAHORSE_OBJECT (k->data));
+			g_array_append_val (array, id);
 		}
 	}
     
-    *keys = (gchar**)g_array_free (a, FALSE);
-    return TRUE;
+	*keys = (gchar**)g_array_free (array, FALSE);
+	g_list_free (objects);
+	return TRUE;
 }
 
 gboolean
@@ -122,17 +122,16 @@
                                        gboolean *has, GValue *value, GError **error)
 {
     SeahorseObject *sobj;
-    guint uid;
 
-    sobj = seahorse_context_object_from_dbus (SCTX_APP(), key, &uid);
+    sobj = seahorse_context_object_from_dbus (SCTX_APP(), key);
     if (!sobj) {
         g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID, 
                      _("Invalid or unrecognized key: %s"), key);
         return FALSE;
     }
  
-    if (SEAHORSE_IS_KEY (sobj) && 
-        seahorse_key_lookup_property (SEAHORSE_KEY (sobj), uid, field, value)) {
+    if (SEAHORSE_IS_OBJECT (sobj) && 
+        seahorse_object_lookup_property (sobj, field, value)) {
         *has = TRUE;
         
     } else {
@@ -152,9 +151,8 @@
 {
 	SeahorseObject *sobj;
 	GValue *value;
-	guint uid;
     
-	sobj = seahorse_context_object_from_dbus (SCTX_APP(), key, &uid);
+	sobj = seahorse_context_object_from_dbus (SCTX_APP(), key);
 	if (!sobj) {
 		g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID, 
 		             _("Invalid or unrecognized key: %s"), key);
@@ -163,10 +161,10 @@
 
 	*values = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, value_free);
     
-	if (SEAHORSE_IS_KEY (sobj)) {
+	if (SEAHORSE_IS_OBJECT (sobj)) {
 		while (*fields) {
 			value = g_new0 (GValue, 1);
-			if (seahorse_key_lookup_property (SEAHORSE_KEY (sobj), uid, *fields, value))
+			if (seahorse_object_lookup_property (sobj, *fields, value))
 				g_hash_table_insert (*values, g_strdup (*fields), value);
 			else
 				g_free (value);
@@ -206,7 +204,7 @@
     /* Prepare return value */
     akeys = g_array_new (TRUE, TRUE, sizeof (gchar*));
     for (l = lkeys; l; l = g_list_next (l)) {
-        id = seahorse_context_object_to_dbus (SCTX_APP(), SEAHORSE_OBJECT (l->data), 0);
+        id = seahorse_context_object_to_dbus (SCTX_APP(), SEAHORSE_OBJECT (l->data));
         akeys = g_array_append_val (akeys, id);
     }
     *keys = (gchar**)g_array_free (akeys, FALSE);
@@ -223,10 +221,11 @@
     GArray *results = NULL;
     GArray *remaining = NULL;
     GList *lkeys, *l;
-    SeahorseKey *skey;
-    gchar *value, *id;
+    SeahorseObject *object;
+    const gchar *value;
+    gchar *id;
     gchar **k;
-    int i, nnames;
+    int i;
 
     /* Copy the keys so we can see what's left. */
     remaining = g_array_new (TRUE, TRUE, sizeof (gchar*));
@@ -245,46 +244,25 @@
         if (remaining->len <= 0)
             break;
 
-        if (!SEAHORSE_IS_KEY (l->data))
+        if (!SEAHORSE_IS_OBJECT (l->data))
             continue;
-        skey = SEAHORSE_KEY (l->data);
+        object = SEAHORSE_OBJECT (l->data);
         
         /* Note that match_remove_patterns frees value */
         
         /* Main name */        
-        value = seahorse_key_get_display_name (skey);
+        value = seahorse_object_get_label (object);
         if (match_remove_patterns (remaining, value)) {
-            id = seahorse_context_object_to_dbus (SCTX_APP (), SEAHORSE_OBJECT (skey), 0);
+            id = seahorse_context_object_to_dbus (SCTX_APP (), object);
             g_array_append_val (results, id);
         }
         
         /* Key ID */
-        value = g_strdup (seahorse_key_get_rawid (seahorse_key_get_keyid (skey)));
+        value = seahorse_object_get_identifier (object);
         if (match_remove_patterns (remaining, value)) {
-            id = seahorse_context_object_to_dbus (SCTX_APP (), SEAHORSE_OBJECT (skey), 0);
+            id = seahorse_context_object_to_dbus (SCTX_APP (), object);
             g_array_append_val (results, id);
         }
-        
-        /* Each UID */
-        nnames = seahorse_key_get_num_names (skey);
-        for (i = 0; i < nnames; i++) {
-            
-            /* UID name */
-            value = seahorse_key_get_name (skey, i);
-            if (match_remove_patterns (remaining, value)) {
-                id = seahorse_context_object_to_dbus (SCTX_APP (), SEAHORSE_OBJECT (skey), i);
-                g_array_append_val (results, id);
-                break;
-            }
-            
-            /* UID email */
-            value = seahorse_key_get_name_cn (skey, i);
-            if (match_remove_patterns (remaining, value)) {
-                id = seahorse_context_object_to_dbus (SCTX_APP (), SEAHORSE_OBJECT (skey), i);
-                g_array_append_val (results, id);
-                break;
-            }
-        }
     }
     
     /* Sort results and remove duplicates */
@@ -314,76 +292,53 @@
 seahorse_service_keyset_added (SeahorseSet *skset, SeahorseObject *sobj, 
                                gpointer userdata)
 {
+	GList *children, *k;
 	gchar *id;
-	guint uids = 0, i;
-    
-	if (SEAHORSE_IS_KEY (sobj))
-		uids = seahorse_key_get_num_names (SEAHORSE_KEY (sobj));
-	uids = (uids == 0) ? 1 : uids;
 
-	for (i = 0; i < uids; i++) {    
-		id = seahorse_context_object_to_dbus (SCTX_APP (), sobj, i);
+	id = seahorse_context_object_to_dbus (SCTX_APP (), sobj);
+	g_signal_emit (SEAHORSE_SERVICE_KEYSET (skset), signals[KEY_ADDED], 0, id);
+	g_free (id);        
+
+	children = seahorse_object_get_children (sobj);
+	for (k = children; k; k = g_list_next (k)) {
+		id = seahorse_context_object_to_dbus (SCTX_APP (), sobj);
 		g_signal_emit (SEAHORSE_SERVICE_KEYSET (skset), signals[KEY_ADDED], 0, id);
-		g_free (id);        
+		g_free (id);
 	}
-    
-	seahorse_set_set_closure (skset, sobj, GUINT_TO_POINTER (uids));
+	
+	g_list_free (children);
 }
 
 static void
 seahorse_service_keyset_removed (SeahorseSet *skset, SeahorseObject *sobj, 
                                  gpointer closure, gpointer userdata)
 {
-    gchar *id;
-    guint uids, i;
+	GList *children, *k;
+	gchar *id;
 
-    uids = GPOINTER_TO_UINT (closure);
-    uids = (uids == 0) ? 1 : uids;
-    
-    for (i = 0; i < uids; i++) {
-        id = seahorse_context_object_to_dbus (SCTX_APP (), sobj, i);
-        g_signal_emit (SEAHORSE_SERVICE_KEYSET (skset), signals[KEY_REMOVED], 0, id);
-        g_free (id);
-    }
+	children = seahorse_object_get_children (sobj);
+	for (k = children; k; k = g_list_next (k)) {
+		id = seahorse_context_object_to_dbus (SCTX_APP (), sobj);
+		g_signal_emit (SEAHORSE_SERVICE_KEYSET (skset), signals[KEY_REMOVED], 0, id);
+		g_free (id);
+	}
+
+	id = seahorse_context_object_to_dbus (SCTX_APP (), sobj);
+	g_signal_emit (SEAHORSE_SERVICE_KEYSET (skset), signals[KEY_REMOVED], 0, id);
+	g_free (id);        
+
+	g_list_free (children);
 }
 
 static void
 seahorse_service_keyset_changed (SeahorseSet *skset, SeahorseObject *sobj, 
-                                 SeahorseObjectChange change, gpointer closure, 
-                                 gpointer userdata)
+                                 gpointer closure, gpointer userdata)
 {
-    gchar *id;
-    guint uids = 0, euids, i;
-    
-    /* Adding or removing uids means we do a add/remove */
-    if (SEAHORSE_IS_KEY (sobj))
-        uids = seahorse_key_get_num_names (SEAHORSE_KEY (sobj));
-    uids = (uids == 0) ? 1 : uids;
-    
-    euids = GPOINTER_TO_UINT (closure);
-    if (euids != uids)
-        seahorse_set_set_closure (skset, sobj, GUINT_TO_POINTER (uids));
-
-    if (euids < uids) {
-        for (i = euids; i < uids; i++) {
-            id = seahorse_context_object_to_dbus (SCTX_APP (), sobj, i);
-            g_signal_emit (SEAHORSE_SERVICE_KEYSET (skset), signals[KEY_ADDED], 0, id);
-            g_free (id);
-        }
-    } else if (euids > uids) {
-        for (i = uids; i < euids; i++) {
-            id = seahorse_context_object_to_dbus (SCTX_APP (), sobj, i);
-            g_signal_emit (SEAHORSE_SERVICE_KEYSET (skset), signals[KEY_REMOVED], 0, id);
-            g_free (id);
-        }
-    }
-
-    for (i = 0; i < uids; i++) {
-        id = seahorse_context_object_to_dbus (SCTX_APP (), sobj, i);
-        g_signal_emit (SEAHORSE_SERVICE_KEYSET (skset), signals[KEY_CHANGED], 0, id);
-        g_free (id);
-    }
+	gchar *id;
     
+	id = seahorse_context_object_to_dbus (SCTX_APP (), sobj);
+	g_signal_emit (SEAHORSE_SERVICE_KEYSET (skset), signals[KEY_CHANGED], 0, id);
+	g_free (id);
 }
 
 /* -----------------------------------------------------------------------------

Modified: trunk/daemon/seahorse-service.c
==============================================================================
--- trunk/daemon/seahorse-service.c	(original)
+++ trunk/daemon/seahorse-service.c	Sat Nov 29 17:37:20 2008
@@ -28,13 +28,13 @@
 
 #include <dbus/dbus-glib-bindings.h>
 
+#include "seahorse-context.h"
 #include "seahorse-daemon.h"
-#include "seahorse-key.h"
+#include "seahorse-libdialogs.h"
+#include "seahorse-object.h"
 #include "seahorse-service.h"
-#include "seahorse-context.h"
 #include "seahorse-source.h"
 #include "seahorse-util.h"
-#include "seahorse-libdialogs.h"
 
 #include <gio/gio.h>
 
@@ -145,7 +145,7 @@
     a = g_array_new (TRUE, TRUE, sizeof (gchar*));
     for (l = (GList*)seahorse_operation_get_result (op); l; l = g_list_next (l)) {
         t = seahorse_context_id_to_dbus (SCTX_APP (), 
-                                seahorse_object_get_id (SEAHORSE_OBJECT (l->data)), 0);
+                                seahorse_object_get_id (SEAHORSE_OBJECT (l->data)));
         g_array_append_val (a, t);
         keynum = keynum + 1;
     }
@@ -176,7 +176,7 @@
     type = g_quark_from_string (ktype);
     
     while (*keys) {
-        sobj = seahorse_context_object_from_dbus (SCTX_APP (), *keys, 0);
+        sobj = seahorse_context_object_from_dbus (SCTX_APP (), *keys);
         
         if (!sobj || seahorse_object_get_tag (sobj) != type) {
             g_set_error (error, SEAHORSE_DBUS_ERROR, SEAHORSE_DBUS_ERROR_INVALID, 
@@ -274,8 +274,7 @@
 }
 
 static void
-seahorse_service_changed (SeahorseContext *sctx, SeahorseObject *sobj, 
-                          SeahorseObjectChange change, SeahorseService *svc)
+seahorse_service_changed (SeahorseContext *sctx, SeahorseObject *sobj, SeahorseService *svc)
 {
     /* Do the same thing as when a key is added */
     GQuark ktype = seahorse_object_get_tag (sobj);
@@ -322,7 +321,7 @@
                                           g_free, g_object_unref);
     
     /* Fill in keysets for any keys already in the context */
-    srcs = seahorse_context_find_sources (SCTX_APP (), SKEY_UNKNOWN, SEAHORSE_LOCATION_LOCAL);
+    srcs = seahorse_context_find_sources (SCTX_APP (), SEAHORSE_TAG_INVALID, SEAHORSE_LOCATION_LOCAL);
     for (l = srcs; l; l = g_slist_next (l)) 
         add_key_source (svc, seahorse_source_get_ktype (SEAHORSE_SOURCE (l->data)));
     g_slist_free (srcs);

Modified: trunk/gkr/seahorse-gkr-commands.c
==============================================================================
--- trunk/gkr/seahorse-gkr-commands.c	(original)
+++ trunk/gkr/seahorse-gkr-commands.c	Sat Nov 29 17:37:20 2008
@@ -71,7 +71,7 @@
 static SeahorseOperation* 
 seahorse_gkr_commands_delete_objects (SeahorseCommands* base, GList* objects) 
 {
-	gchar *prompt, *display;
+	gchar *prompt;
 	GtkWidget *parent;
 	gboolean ret;
 	guint num;
@@ -81,9 +81,8 @@
 		return NULL;
 
 	if (num == 1) {
-		display = seahorse_object_get_display_name (SEAHORSE_OBJECT (objects->data));
-		prompt = g_strdup_printf (_ ("Are you sure you want to delete the password '%s'?"), display);
-		g_free (display);
+		prompt = g_strdup_printf (_ ("Are you sure you want to delete the password '%s'?"), 
+		                          seahorse_object_get_label (SEAHORSE_OBJECT (objects->data)));
 	} else {
 		prompt = g_strdup_printf (ngettext ("Are you sure you want to delete %d password?", 
 		                                    "Are you sure you want to delete %d passwords?", 

Modified: trunk/gkr/seahorse-gkr-item-properties.c
==============================================================================
--- trunk/gkr/seahorse-gkr-item-properties.c	(original)
+++ trunk/gkr/seahorse-gkr-item-properties.c	Sat Nov 29 17:37:20 2008
@@ -22,23 +22,25 @@
 
 #include <glib/gi18n.h>
 
-#include "seahorse-key-widget.h"
-#include "seahorse-util.h"
-#include "seahorse-key.h"
+#include "seahorse-gkr-item.h"
+#include "seahorse-gkr-source.h"
+#include "seahorse-gkr-operation.h"
+
 #include "seahorse-gtkstock.h"
+#include "seahorse-object.h"
+#include "seahorse-object-widget.h"
 #include "seahorse-secure-memory.h"
 #include "seahorse-secure-entry.h"
+#include "seahorse-util.h"
 
-#include "seahorse-gkr-item.h"
-#include "seahorse-gkr-source.h"
-#include "seahorse-gkr-operation.h"
+#include "common/seahorse-bind.h"
 
 /* -----------------------------------------------------------------------------
  * MAIN TAB 
  */
 
 static void
-load_password (SeahorseWidget *swidget, SeahorseGkrItem *git)
+update_password (SeahorseWidget *swidget, SeahorseGkrItem *git)
 {
     SeahorseSecureEntry *entry;
     gchar *secret;
@@ -56,108 +58,177 @@
     }
 }
 
-static void
-do_main (SeahorseWidget *swidget)
+static gboolean
+transform_item_use (const GValue *from, GValue *to)
 {
-    SeahorseKey *key;
-    SeahorseGkrItem *git;
-    GtkWidget *widget;
-    gchar *text;
-    const gchar *label;
-    gchar *stock_id;
-    gboolean network = FALSE;
-
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    git = SEAHORSE_GKR_ITEM (key);
-
-    /* Image */
-    widget = seahorse_widget_get_widget (swidget, "key-image");
-    if (widget) {
-        stock_id = seahorse_key_get_stock_id (key);
-        gtk_image_set_from_stock (GTK_IMAGE (widget), stock_id, GTK_ICON_SIZE_DIALOG);
-        g_free (stock_id);
-    }
+	gchar *label;
+	guint val;
+	
+	g_return_val_if_fail (G_VALUE_TYPE (from) == G_TYPE_UINT, FALSE);
+	g_return_val_if_fail (G_VALUE_TYPE (to) == G_TYPE_STRING, FALSE);
+	
+	val = g_value_get_uint (from);
+	switch (val) {
+	case SEAHORSE_GKR_USE_NETWORK:
+		label = _("Access a network share or resource");
+		break;
+	case SEAHORSE_GKR_USE_WEB:
+		label = _("Access a website");
+		break;
+	case SEAHORSE_GKR_USE_PGP:
+		label = _("Unlocks a PGP key");
+		break;
+	case SEAHORSE_GKR_USE_SSH:
+		label = _("Unlocks a Secure Shell key");
+		break;
+	case SEAHORSE_GKR_USE_OTHER:
+		label = _("Saved password or login");
+		break;
+	default:
+	        g_return_val_if_reached (FALSE);
+	};
+	
+	g_value_set_string (to, label);
+	return TRUE;
+}
 
-    /* Description */
-    widget = seahorse_widget_get_widget (swidget, "description-field");
-    if (widget) {
-        text = seahorse_gkr_item_get_description (git);
-        gtk_entry_set_text (GTK_ENTRY (widget), text ? text : "");
-        g_free (text);
-    }
-    
-    /* Window title */
-    text = seahorse_key_get_display_name (key);
-    widget = seahorse_widget_get_toplevel (swidget);
-    gtk_window_set_title (GTK_WINDOW (widget), text);
-    g_free (text);
-
-    /* Use and type */
-    switch (seahorse_gkr_item_get_use (git)) {
-    case SEAHORSE_GKR_USE_NETWORK:
-        label = _("Access a network share or resource");
-        network = TRUE;
-        break;
-    case SEAHORSE_GKR_USE_WEB:
-        label = _("Access a website");
-        network = TRUE;
-        break;
-    case SEAHORSE_GKR_USE_PGP:
-        label = _("Unlocks a PGP key");
-        break;
-    case SEAHORSE_GKR_USE_SSH:
-        label = _("Unlocks a Secure Shell key");
-        break;
-    case SEAHORSE_GKR_USE_OTHER:
-        label = _("Saved password or login");
-        break;
-    default:
-        g_assert_not_reached ();
-    }
-    
-    widget = seahorse_widget_get_widget (swidget, "use-field");
-    if (widget)
-        gtk_label_set_text (GTK_LABEL (widget), label);
-    
-    /* The type */
-    widget = seahorse_widget_get_widget (swidget, "type-field");
-    if (widget)
-        gtk_label_set_text (GTK_LABEL (widget), 
-                network ? _("Network Credentials") : _("Password"));
-    
-    /* Network */
-    seahorse_widget_set_visible (swidget, "server-label", network);
-    seahorse_widget_set_visible (swidget, "server-field", network);
-    seahorse_widget_set_visible (swidget, "login-label", network);
-    seahorse_widget_set_visible (swidget, "login-field", network);
-    
-    if (network) {
-        label = seahorse_gkr_item_get_attribute (git, "server");
-        widget = seahorse_widget_get_widget (swidget, "server-field");
-        if (widget)
-            gtk_label_set_text (GTK_LABEL (widget), label);
-        
-        label = seahorse_gkr_item_get_attribute (git, "user");
-        widget = seahorse_widget_get_widget (swidget, "login-field");
-        if (widget)
-            gtk_label_set_text (GTK_LABEL (widget), label);
-    } 
-    
-    load_password (swidget, git);
+static gboolean
+transform_item_type (const GValue *from, GValue *to)
+{
+	gchar *label;
+	guint val;
+	
+	g_return_val_if_fail (G_VALUE_TYPE (from) == G_TYPE_UINT, FALSE);
+	g_return_val_if_fail (G_VALUE_TYPE (to) == G_TYPE_STRING, FALSE);
+	
+	val = g_value_get_uint (from);
+	switch (val) {
+	case SEAHORSE_GKR_USE_NETWORK:
+	case SEAHORSE_GKR_USE_WEB:
+		label = _("Network Credentials");
+		break;
+	case SEAHORSE_GKR_USE_PGP:
+	case SEAHORSE_GKR_USE_SSH:
+	case SEAHORSE_GKR_USE_OTHER:
+		label = _("Password");
+		break;
+	default:
+	        g_return_val_if_reached (FALSE);
+	};
+	
+	g_value_set_string (to, label);
+	return TRUE;
+}
+
+static gboolean
+transform_network_visible (const GValue *from, GValue *to)
+{
+	gboolean result;
+	guint val;
+	
+	g_return_val_if_fail (G_VALUE_TYPE (from) == G_TYPE_UINT, FALSE);
+	g_return_val_if_fail (G_VALUE_TYPE (to) == G_TYPE_BOOLEAN, FALSE);
+	
+	val = g_value_get_uint (from);
+	switch (val) {
+	case SEAHORSE_GKR_USE_NETWORK:
+	case SEAHORSE_GKR_USE_WEB:
+		result = TRUE;
+		break;
+	case SEAHORSE_GKR_USE_PGP:
+	case SEAHORSE_GKR_USE_SSH:
+	case SEAHORSE_GKR_USE_OTHER:
+		result = FALSE;
+		break;
+	default:
+	        g_return_val_if_reached (FALSE);
+	};
+	
+	g_value_set_boolean (to, result);
+	return TRUE;
+}
+
+static gboolean
+transform_attributes_server (const GValue *from, GValue *to)
+{
+	GnomeKeyringAttributeList *attrs;
+	g_return_val_if_fail (G_VALUE_TYPE (from) == G_TYPE_POINTER, FALSE);
+	g_return_val_if_fail (G_VALUE_TYPE (to) == G_TYPE_STRING, FALSE);
+	attrs = g_value_get_pointer (from);
+	if (attrs)
+		g_value_set_string (to, seahorse_gkr_find_string_attribute (attrs, "server"));
+	return TRUE;
+}
+
+static gboolean
+transform_attributes_user (const GValue *from, GValue *to)
+{
+	GnomeKeyringAttributeList *attrs;
+	g_return_val_if_fail (G_VALUE_TYPE (from) == G_TYPE_POINTER, FALSE);
+	g_return_val_if_fail (G_VALUE_TYPE (to) == G_TYPE_STRING, FALSE);
+	attrs = g_value_get_pointer (from);
+	if (attrs)
+		g_value_set_string (to, seahorse_gkr_find_string_attribute (attrs, "user"));
+	return TRUE;
+}
+
+static void
+setup_main (SeahorseWidget *swidget)
+{
+	SeahorseObject *object;
+	
+	object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+
+	/* Setup the image properly */
+	seahorse_bind_property ("icon", object, "stock", 
+	                        seahorse_widget_get_widget (swidget, "key-image"));
+	
+	/* Setup the label properly */
+	seahorse_bind_property ("label", object, "text", 
+	                        seahorse_widget_get_widget (swidget, "description-field") );
+	
+	/* Window title */
+	seahorse_bind_property ("label", object, "title", 
+	                        seahorse_widget_get_toplevel (swidget));
+	
+	/* Usage */
+	seahorse_bind_property_full ("use", object, transform_item_use, "label", 
+	                             seahorse_widget_get_widget (swidget, "use-field"), NULL);
+	
+	/* Item Type */
+	seahorse_bind_property_full ("use", object, transform_item_type, "label", 
+	                             seahorse_widget_get_widget (swidget, "type-field"), NULL);
+	
+	/* Network field visibility */
+	seahorse_bind_property_full ("use", object, transform_network_visible, "visible",
+	                             seahorse_widget_get_widget (swidget, "server-label"),
+	                             seahorse_widget_get_widget (swidget, "server-field"),
+	                             seahorse_widget_get_widget (swidget, "login-label"),
+	                             seahorse_widget_get_widget (swidget, "login-field"), NULL);
+
+	/* Server name */
+	seahorse_bind_property_full ("item-attributes", object, transform_attributes_server, "label", 
+	                             seahorse_widget_get_widget (swidget, "server-field"), NULL);
+	
+	/* User name */
+	seahorse_bind_property_full ("item-attributes", object, transform_attributes_user, "label", 
+	                             seahorse_widget_get_widget (swidget, "login-field"), NULL);
 }
 
 static void
 password_activate (SeahorseSecureEntry *entry, SeahorseWidget *swidget)
 {
-    SeahorseKey *key;
+    SeahorseObject *object;
     SeahorseGkrItem *git;
     SeahorseOperation *op;
     GnomeKeyringItemInfo *info;
     GtkWidget *widget;
     GError *err = NULL;
     
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    git = SEAHORSE_GKR_ITEM (key);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    if (!object)
+	    return;
+    git = SEAHORSE_GKR_ITEM (object);
 
     widget = seahorse_widget_get_widget (swidget, "password-expander");
     g_return_if_fail (widget);
@@ -186,7 +257,7 @@
         seahorse_operation_copy_error (op, &err);
         seahorse_util_handle_error (err, _("Couldn't change password."));
         g_clear_error (&err);
-        load_password (swidget, git);
+        update_password (swidget, git);
     }
     
     gtk_widget_set_sensitive (GTK_WIDGET (entry), TRUE);
@@ -215,23 +286,17 @@
 static void
 password_expander_activate (GtkExpander *expander, SeahorseWidget *swidget)
 {
-    SeahorseKey *key;
+    SeahorseObject *object;
     SeahorseGkrItem *git;
     GtkWidget *widget;
     GtkWidget *box;
 
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    git = SEAHORSE_GKR_ITEM (key);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    git = SEAHORSE_GKR_ITEM (object);
 
     if (!gtk_expander_get_expanded (expander))
         return;
 
-    /* 
-     * TODO: Once gnome-keyring-daemon has support for not reading 
-     * the secret, then we'd retrieve the secret when the password 
-     * expander is opened 
-     */
-    
     widget = GTK_WIDGET (g_object_get_data (G_OBJECT (swidget), "secure-password-entry"));
     if (!widget) {
         widget = seahorse_secure_entry_new ();
@@ -243,7 +308,7 @@
         gtk_widget_show (widget);
         
         /* Retrieve initial password */
-        load_password (swidget, git);
+        update_password (swidget, git);
         
         /* Now watch for changes in the password */
         g_signal_connect (widget, "activate", G_CALLBACK (password_activate), swidget);
@@ -259,7 +324,7 @@
 static void
 description_activate (GtkWidget *entry, SeahorseWidget *swidget)
 {
-    SeahorseKey *key;
+    SeahorseObject *object;
     SeahorseGkrItem *git;
     SeahorseOperation *op;
     GnomeKeyringItemInfo *info;
@@ -267,8 +332,11 @@
     gchar *original;
     GError *err = NULL;
     
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    git = SEAHORSE_GKR_ITEM (key);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    if (!object)
+	    return;
+    
+    git = SEAHORSE_GKR_ITEM (object);
 
     text = gtk_entry_get_text (GTK_ENTRY (entry));
     original = seahorse_gkr_item_get_description (git);
@@ -305,54 +373,64 @@
 static gboolean
 description_focus_out (GtkWidget* widget, GdkEventFocus *event, SeahorseWidget *swidget)
 {
-    description_activate (widget, swidget);
-    return FALSE;
+	description_activate (widget, swidget);
+	return FALSE;
 }
 
 /* -----------------------------------------------------------------------------
  * DETAILS TAB
  */
 
-static void 
-do_details (SeahorseWidget *swidget)
+static gboolean
+transform_item_details (const GValue *from, GValue *to)
 {
-    SeahorseKey *key;
-    SeahorseGkrItem *git;
-    GString *details;
-    GtkWidget *widget;
-    guint i;
+	GnomeKeyringAttributeList *attrs;
+	GnomeKeyringAttribute *attr;
+	GString *details;
+	guint i;
+
+	g_return_val_if_fail (G_VALUE_TYPE (from) == G_TYPE_POINTER, FALSE);
+	g_return_val_if_fail (G_VALUE_TYPE (to) == G_TYPE_STRING, FALSE);
+	attrs = g_value_get_pointer (from);
+	
+	details = g_string_new (NULL);
+	if (attrs) {
+		/* Build up the display string */
+		for(i = 0; i < attrs->len; ++i) {
+			attr = &(gnome_keyring_attribute_list_index (attrs, i));
+			g_string_append_printf (details, "<b>%s</b>: ", attr->name);
+			switch (attr->type) {
+			case GNOME_KEYRING_ATTRIBUTE_TYPE_STRING:
+				g_string_append_printf (details, "%s\n", attr->value.string);
+				break;
+			case GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32:
+				g_string_append_printf (details, "%u\n", attr->value.integer);
+				break;
+			default:
+				g_string_append (details, "<i>[invalid]</i>\n");
+				break;
+			}
+		}
+	}
+	    
+	g_value_take_string (to, g_string_free (details, FALSE));
+	return TRUE;
+}
 
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    git = SEAHORSE_GKR_ITEM (key);
+static void 
+setup_details (SeahorseWidget *swidget)
+{
+	SeahorseObject *object;
+	GtkWidget *widget;
 
-    details = g_string_new (NULL);
-    
-    g_string_append_printf (details, "<b>identifier</b>: %u\n", git->item_id);
+	object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
     
-    /* Build up the display string */
-    if (git->attributes) {
-        for(i = 0; i < git->attributes->len; ++i) {
-            GnomeKeyringAttribute *attr = &(gnome_keyring_attribute_list_index (git->attributes, i));
-            g_string_append_printf (details, "<b>%s</b>: ", attr->name);
-            switch (attr->type) {
-            case GNOME_KEYRING_ATTRIBUTE_TYPE_STRING:
-                g_string_append_printf (details, "%s\n", attr->value.string);
-                break;
-            case GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32:
-                g_string_append_printf (details, "%u\n", attr->value.integer);
-                break;
-            default:
-                g_string_append (details, "<i>[invalid]</i>\n");
-                break;
-            }
-        }
-    }
+	widget = seahorse_widget_get_widget (swidget, "details-box");
+	g_return_if_fail (widget != NULL);
+	gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
     
-    widget = seahorse_widget_get_widget (swidget, "details-box");
-    g_return_if_fail (widget != NULL);
-    gtk_label_set_markup (GTK_LABEL (widget), details->str);
-    
-    g_string_free (details, TRUE);
+	seahorse_bind_property_full ("item-attributes", object, transform_item_details, 
+	                             "label", widget, NULL);
 }
 
 /* -----------------------------------------------------------------------------
@@ -392,7 +470,7 @@
 static void
 update_application_details (SeahorseWidget *swidget)
 {
-    SeahorseKey *key;
+    SeahorseObject *object;
     SeahorseGkrItem *git;
     GnomeKeyringAccessControl *ac;
     GtkLabel *label;
@@ -401,8 +479,8 @@
     gint index;
     gchar *path;
     
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    git = SEAHORSE_GKR_ITEM (key);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    git = SEAHORSE_GKR_ITEM (object);
 
     index = selected_application_index (swidget);
     if (index < 0) {
@@ -461,7 +539,7 @@
 static void
 application_access_toggled (GtkCheckButton *check, SeahorseWidget *swidget)
 {
-    SeahorseKey *key;
+    SeahorseObject *object;
     SeahorseGkrItem *git;
     SeahorseOperation *op;
     GnomeKeyringAccessType access;
@@ -474,8 +552,8 @@
     if (g_object_get_data (G_OBJECT (swidget), "updating"))
         return;
     
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    git = SEAHORSE_GKR_ITEM (key);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    git = SEAHORSE_GKR_ITEM (object);
 
     index = selected_application_index (swidget);
     g_return_if_fail (index >= 0);
@@ -514,10 +592,8 @@
 }
 
 static void 
-do_application (SeahorseWidget *swidget)
+update_application (SeahorseGkrItem *git, SeahorseWidget *swidget)
 {
-    SeahorseKey *key;
-    SeahorseGkrItem *git;
     GtkTreeView *tree;
     GtkListStore *store;
     GtkTreeModel *model;
@@ -529,9 +605,6 @@
     gboolean valid;
     gchar *display;
 
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    git = SEAHORSE_GKR_ITEM (key);
-
     tree = GTK_TREE_VIEW (seahorse_widget_get_widget (swidget, "application-list"));
     g_return_if_fail (tree);
     
@@ -575,32 +648,16 @@
     update_application_details (swidget);
 }
 
-/* -----------------------------------------------------------------------------
- * GENERAL
- */
-
-static void
-key_changed (SeahorseKey *skey, SeahorseKeyChange change, SeahorseWidget *swidget)
-{
-    do_main (swidget);
-    do_details (swidget);
-    do_application (swidget);
-}
-
-static void
-key_destroyed (GtkObject *object, SeahorseWidget *swidget)
+static void 
+setup_application (SeahorseWidget *swidget)
 {
-    seahorse_widget_destroy (swidget);
+	seahorse_bind_objects ("item-acl", SEAHORSE_OBJECT_WIDGET (swidget)->object,
+	                       (SeahorseTransfer)update_application, swidget);
 }
 
-static void
-properties_destroyed (GtkObject *object, SeahorseWidget *swidget)
-{
-    g_signal_handlers_disconnect_by_func (SEAHORSE_KEY_WIDGET (swidget)->skey,
-                                          key_changed, swidget);
-    g_signal_handlers_disconnect_by_func (SEAHORSE_KEY_WIDGET (swidget)->skey,
-                                          key_destroyed, swidget);
-}
+/* -----------------------------------------------------------------------------
+ * GENERAL
+ */
 
 static void
 properties_response (GtkDialog *dialog, int response, SeahorseWidget *swidget)
@@ -616,30 +673,23 @@
 void
 seahorse_gkr_item_properties_show (SeahorseGkrItem *git, GtkWindow *parent)
 {
-    SeahorseKey *key = SEAHORSE_KEY (git);
+    SeahorseObject *object = SEAHORSE_OBJECT (git);
     SeahorseSource *sksrc;
     SeahorseWidget *swidget = NULL;
     GtkWidget *widget;
 
-    swidget = seahorse_key_widget_new ("gkr-item-properties",
-                                       parent, 
-                                       key);    
+    swidget = seahorse_object_widget_new ("gkr-item-properties", parent, object);
     
     /* This happens if the window is already open */
     if (swidget == NULL)
         return;
 
     /* This causes the key source to get any specific info about the key */
-    if (seahorse_key_get_loaded (key) < SKEY_INFO_COMPLETE) {
-        sksrc = seahorse_key_get_source (key);
-        seahorse_source_load_async (sksrc, seahorse_key_get_keyid (key));
-    }
+    sksrc = seahorse_object_get_source (SEAHORSE_OBJECT (git));
+    seahorse_source_load_async (sksrc, seahorse_object_get_id (object));
 
     widget = glade_xml_get_widget (swidget->xml, swidget->name);
     g_signal_connect (widget, "response", G_CALLBACK (properties_response), swidget);
-    g_signal_connect (widget, "destroy", G_CALLBACK (properties_destroyed), swidget);
-    g_signal_connect_after (git, "changed", G_CALLBACK (key_changed), swidget);
-    g_signal_connect_after (git, "destroy", G_CALLBACK (key_destroyed), swidget);
 
     /* 
      * The signals don't need to keep getting connected. Everytime a key changes the
@@ -647,9 +697,9 @@
      * have been created
      */
 
-    do_main (swidget);
-    do_details (swidget);
-    do_application (swidget);
+    setup_main (swidget);
+    setup_details (swidget);
+    setup_application (swidget);
     
     widget = seahorse_widget_get_widget (swidget, "password-expander");
     g_return_if_fail (widget);

Modified: trunk/gkr/seahorse-gkr-item.c
==============================================================================
--- trunk/gkr/seahorse-gkr-item.c	(original)
+++ trunk/gkr/seahorse-gkr-item.c	Sat Nov 29 17:37:20 2008
@@ -34,10 +34,10 @@
 
 /* For gnome-keyring secret type ids */
 #ifdef WITH_PGP
-#include "pgp/seahorse-pgp-key.h"
+#include "pgp/seahorse-pgp.h"
 #endif
 #ifdef WITH_SSH
-#include "ssh/seahorse-ssh-key.h"
+#include "ssh/seahorse-ssh.h"
 #endif 
 
 /* XXX Copied from libgnomeui */
@@ -51,18 +51,10 @@
     PROP_ITEM_INFO,
     PROP_ITEM_ATTRIBUTES,
     PROP_ITEM_ACL,
-    PROP_DISPLAY_NAME,
-    PROP_DISPLAY_ID,
-    PROP_SIMPLE_NAME,
-    PROP_FINGERPRINT,
-    PROP_VALIDITY,
-    PROP_TRUST,
-    PROP_EXPIRES,
-    PROP_LENGTH,
-    PROP_STOCK_ID
+    PROP_USE
 };
 
-G_DEFINE_TYPE (SeahorseGkrItem, seahorse_gkr_item, SEAHORSE_TYPE_KEY);
+G_DEFINE_TYPE (SeahorseGkrItem, seahorse_gkr_item, SEAHORSE_TYPE_OBJECT);
 
 /* -----------------------------------------------------------------------------
  * INTERNAL HELPERS
@@ -227,78 +219,11 @@
     return ret;
 }
 
-static void
-changed_key (SeahorseGkrItem *git)
-{
-    SeahorseKey *skey = SEAHORSE_KEY (git);
-    SeahorseObject *obj = SEAHORSE_OBJECT (git);
-    gchar *secret;
-
-    if (!git->info) {
-        
-        obj->_location = SEAHORSE_LOCATION_INVALID;
-        obj->_usage = SEAHORSE_USAGE_NONE;
-        skey->loaded = SKEY_INFO_NONE;
-        obj->_flags = SKEY_FLAG_DISABLED;
-        skey->keydesc = _("Invalid");
-        skey->rawid = NULL;
-        obj->_id = 0;
-        return;
-    } 
-
-    WITH_SECURE_MEM ((secret = gnome_keyring_item_info_get_secret (git->info)));
-    skey->loaded = (secret == NULL) ? SKEY_INFO_BASIC : SKEY_INFO_COMPLETE;
-    g_free (secret);
-
-    obj->_tag = SEAHORSE_GKR;
-    obj->_location = SEAHORSE_LOCATION_LOCAL;
-    obj->_usage = SEAHORSE_USAGE_CREDENTIALS;
-    obj->_flags = 0;
-    obj->_id = seahorse_gkr_item_get_cannonical (git->item_id);
-
-    if (is_network_item (git, "http")) 
-        skey->keydesc = _("Web Password");
-    else if (is_network_item (git, NULL)) 
-        skey->keydesc = _("Network Password");
-    else
-        skey->keydesc = _("Password");
-    
-    seahorse_object_fire_changed (SEAHORSE_OBJECT (skey), SEAHORSE_OBJECT_CHANGE_ALL);
-}
-
-/* -----------------------------------------------------------------------------
- * OBJECT 
- */
-
-static void
-seahorse_gkr_item_init (SeahorseGkrItem *git)
-{
-
-}
-
-static guint 
-seahorse_gkr_item_get_num_names (SeahorseKey *git)
-{
-    /* Always one name */
-    return 1;
-}
-
 static gchar* 
-seahorse_gkr_item_get_name (SeahorseKey *skey, guint index)
+calc_name_markup (SeahorseGkrItem *git)
 {
-    SeahorseGkrItem *git = SEAHORSE_GKR_ITEM (skey);
-    
-    g_return_val_if_fail (index == 0, NULL);
-    return calc_display_name (git, TRUE);
-}
-
-static gchar* 
-seahorse_gkr_item_get_name_markup (SeahorseKey *skey, guint index)
-{
-    SeahorseGkrItem *git = SEAHORSE_GKR_ITEM (skey);
     gchar *t, *markup = NULL;
     
-    g_return_val_if_fail (index == 0, NULL);
     g_return_val_if_fail (git->info != NULL, NULL);
     
     /* Only do our special markup for network passwords */
@@ -314,18 +239,88 @@
     return markup;
 }
 
-static gchar* 
-seahorse_gkr_item_get_name_cn (SeahorseKey *skey, guint index)
+static void
+changed_key (SeahorseGkrItem *git)
 {
-    g_return_val_if_fail (index == 0, NULL);
-    return NULL;
+	const gchar *description;
+	gboolean loaded;
+	gchar *secret;
+	gchar *display;
+	gchar *markup;
+	gchar *identifier;
+	const gchar *icon;
+
+	if (!git->info) {
+        
+		g_object_set (git,
+		              "id", 0,
+		              "label", "",
+		              "icon", NULL,
+		              "markup", "",
+		              "identifier", "",
+		              "description", _("Invalid"),
+		              "flags", SEAHORSE_FLAG_DISABLED,
+		              NULL);
+		return;
+	}
+
+	WITH_SECURE_MEM ((secret = gnome_keyring_item_info_get_secret (git->info)));
+	loaded = (secret == NULL);
+	g_free (secret);
+	
+	if (is_network_item (git, "http")) 
+		description = _("Web Password");
+	else if (is_network_item (git, NULL)) 
+		description = _("Network Password");
+	else
+		description = _("Password");
+
+	display = calc_display_name (git, TRUE);
+	markup = calc_name_markup(git);
+	identifier = g_strdup_printf ("%u", git->item_id);
+
+	/* We use a pointer so we don't copy the string every time */
+	switch (git->info ? gnome_keyring_item_info_get_type (git->info) : -1)
+	{
+	case GNOME_KEYRING_ITEM_GENERIC_SECRET:
+		icon = GNOME_STOCK_AUTHENTICATION;
+		break;
+	case GNOME_KEYRING_ITEM_NETWORK_PASSWORD:
+		icon = is_network_item (git, "http") ? SEAHORSE_THEMED_WEBBROWSER : GTK_STOCK_NETWORK;
+		break;
+	case GNOME_KEYRING_ITEM_NOTE:
+		icon = GNOME_STOCK_BOOK_OPEN;
+		break;
+	default:
+        	icon = GNOME_STOCK_BLANK;
+        	break;
+        }
+	
+	g_object_set (git,
+	              "id", seahorse_gkr_item_get_cannonical (git->item_id),
+	              "label", display,
+	              "icon", icon,
+	              "markup", markup,
+	              "identifier", identifier,
+	              "description", description,
+	              "flags", 0,
+	              NULL);
+	
+	g_free (display);
+	g_free (markup);
+	g_free (identifier);
 }
 
-static SeahorseValidity  
-seahorse_gkr_item_get_name_validity  (SeahorseKey *skey, guint index)
+/* -----------------------------------------------------------------------------
+ * OBJECT 
+ */
+
+static void
+seahorse_gkr_item_init (SeahorseGkrItem *git)
 {
-    g_return_val_if_fail (index == 0, SEAHORSE_VALIDITY_UNKNOWN);
-    return SEAHORSE_VALIDITY_FULL;
+	g_object_set (git, 
+	              "usage", SEAHORSE_USAGE_CREDENTIALS,
+	              NULL);
 }
 
 static void
@@ -333,7 +328,6 @@
                                 GValue *value, GParamSpec *pspec)
 {
     SeahorseGkrItem *git = SEAHORSE_GKR_ITEM (object);
-    SeahorseKey *skey = SEAHORSE_KEY (object);
     
     switch (prop_id) {
     case PROP_ITEM_ID:
@@ -348,50 +342,9 @@
     case PROP_ITEM_ACL:
     	g_value_set_pointer (value, git->acl);
     	break;
-    case PROP_DISPLAY_NAME:
-        g_value_take_string (value, seahorse_gkr_item_get_name (skey, 0));
-        break;
-    case PROP_DISPLAY_ID:
-        g_value_set_string (value, seahorse_key_get_short_keyid (skey));
-        break;
-    case PROP_SIMPLE_NAME:
-        g_value_take_string (value, seahorse_gkr_item_get_name (skey, 0));
-        break;
-    case PROP_FINGERPRINT:
-        g_value_set_string (value, seahorse_key_get_short_keyid (skey));
-        break;
-    case PROP_VALIDITY:
-        g_value_set_uint (value, SEAHORSE_VALIDITY_FULL);
-        break;
-    case PROP_TRUST:
-        g_value_set_uint (value, SEAHORSE_VALIDITY_UNKNOWN);
-        break;
-    case PROP_EXPIRES:
-        g_value_set_ulong (value, 0);
-        break;
-    case PROP_LENGTH:
-        g_value_set_uint (value, 0);
-        break;
-
-    case PROP_STOCK_ID:
-        /* We use a pointer so we don't copy the string every time */
-        switch (git->info ? gnome_keyring_item_info_get_type (git->info) : -1)
-        {
-        case GNOME_KEYRING_ITEM_GENERIC_SECRET:
-            g_value_set_string (value, GNOME_STOCK_AUTHENTICATION);
-            break;
-        case GNOME_KEYRING_ITEM_NETWORK_PASSWORD:
-            g_value_set_string (value, is_network_item (git, "http") ? 
-                    SEAHORSE_THEMED_WEBBROWSER : GTK_STOCK_NETWORK);
-            break;
-        case GNOME_KEYRING_ITEM_NOTE:
-            g_value_set_string (value, GNOME_STOCK_BOOK_OPEN);
-            break;
-        default:
-            g_value_set_string (value, GNOME_STOCK_BLANK);
-            break;
-        }        
-        break;
+    case PROP_USE:
+	g_value_set_uint (value, seahorse_gkr_item_get_use (git));
+	break;
     }
 }
 
@@ -454,7 +407,6 @@
 seahorse_gkr_item_class_init (SeahorseGkrItemClass *klass)
 {
     GObjectClass *gobject_class;
-    SeahorseKeyClass *key_class;
     
     seahorse_gkr_item_parent_class = g_type_class_peek_parent (klass);
     gobject_class = G_OBJECT_CLASS (klass);
@@ -463,14 +415,6 @@
     gobject_class->set_property = seahorse_gkr_item_set_property;
     gobject_class->get_property = seahorse_gkr_item_get_property;
     
-    key_class = SEAHORSE_KEY_CLASS (klass);
-    
-    key_class->get_num_names = seahorse_gkr_item_get_num_names;
-    key_class->get_name = seahorse_gkr_item_get_name;
-    key_class->get_name_markup = seahorse_gkr_item_get_name_markup;
-    key_class->get_name_cn = seahorse_gkr_item_get_name_cn;
-    key_class->get_name_validity = seahorse_gkr_item_get_name_validity;
-    
     g_object_class_install_property (gobject_class, PROP_ITEM_ID,
         g_param_spec_uint ("item-id", "Item ID", "GNOME Keyring Item ID", 
                            0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
@@ -487,42 +431,9 @@
         g_param_spec_pointer ("item-acl", "Item ACL", "GNOME Keyring Item ACL",
                               G_PARAM_READWRITE));
 
-    g_object_class_install_property (gobject_class, PROP_DISPLAY_NAME,
-        g_param_spec_string ("display-name", "Display Name", "User Displayable name for this key",
-                             "", G_PARAM_READABLE));
-                      
-    g_object_class_install_property (gobject_class, PROP_DISPLAY_ID,
-        g_param_spec_string ("display-id", "Display ID", "User Displayable id for this key",
-                             "", G_PARAM_READABLE));
-                      
-    g_object_class_install_property (gobject_class, PROP_SIMPLE_NAME,
-        g_param_spec_string ("simple-name", "Simple Name", "Simple name for this key",
-                             "", G_PARAM_READABLE));
-                      
-    g_object_class_install_property (gobject_class, PROP_FINGERPRINT,
-        g_param_spec_string ("fingerprint", "Fingerprint", "Unique fingerprint for this key",
-                             "", G_PARAM_READABLE));
-
-    g_object_class_install_property (gobject_class, PROP_VALIDITY,
-        g_param_spec_uint ("validity", "Validity", "Validity of this key",
-                           0, G_MAXUINT, 0, G_PARAM_READABLE));
-
-    g_object_class_install_property (gobject_class, PROP_TRUST,
-        g_param_spec_uint ("trust", "Trust", "Trust in this key",
-                           0, G_MAXUINT, 0, G_PARAM_READABLE));
-
-    g_object_class_install_property (gobject_class, PROP_EXPIRES,
-        g_param_spec_ulong ("expires", "Expires On", "Date this key expires on",
-                           0, G_MAXULONG, 0, G_PARAM_READABLE));
-
-    g_object_class_install_property (gobject_class, PROP_LENGTH,
-        g_param_spec_uint ("length", "Length", "The length of this key.",
-                           0, G_MAXUINT, 0, G_PARAM_READABLE));
-                           
-    g_object_class_install_property (gobject_class, PROP_STOCK_ID,
-        g_param_spec_string ("stock-id", "The stock icon", "The stock icon id",
-                             NULL, G_PARAM_READABLE));
-
+    g_object_class_install_property (gobject_class, PROP_USE,
+        g_param_spec_uint ("use", "Use", "Item is used for", 
+                           0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 }
 
 /* -----------------------------------------------------------------------------
@@ -534,7 +445,7 @@
                        GnomeKeyringAttributeList *attributes, GList *acl)
 {
     SeahorseGkrItem *git;
-    git = g_object_new (SEAHORSE_TYPE_GKR_ITEM, "key-source", sksrc, 
+    git = g_object_new (SEAHORSE_TYPE_GKR_ITEM, "source", sksrc, 
                         "item-id", item_id, "item-info", info, 
                         "item-attributes", attributes, "item-acl", acl, NULL);
     return git;
@@ -543,25 +454,17 @@
 gchar*
 seahorse_gkr_item_get_description  (SeahorseGkrItem *git)
 {
-    return calc_display_name (git, FALSE);
+	g_return_val_if_fail (SEAHORSE_IS_GKR_ITEM (git), NULL);
+	return calc_display_name (git, FALSE);
 }
 
 const gchar*
 seahorse_gkr_item_get_attribute (SeahorseGkrItem *git, const gchar *name)
 {
-    guint i;
-    
+    g_return_val_if_fail (SEAHORSE_IS_GKR_ITEM (git), NULL);
     if (!git->attributes)
         return NULL;
-    
-    for (i = 0; i < git->attributes->len; i++) {
-        GnomeKeyringAttribute *attr = &(gnome_keyring_attribute_list_index (git->attributes, i));
-        if (g_ascii_strcasecmp (name, attr->name) == 0 && 
-            attr->type == GNOME_KEYRING_ATTRIBUTE_TYPE_STRING)
-            return attr->value.string;
-    }
-    
-    return NULL;
+    return seahorse_gkr_find_string_attribute (git->attributes, name);
 }
 
 SeahorseGkrUse
@@ -580,11 +483,11 @@
         val = seahorse_gkr_item_get_attribute (git, "seahorse-key-type");
         if (val) {
 #ifdef WITH_PGP
-        	if (strcmp (val, SEAHORSE_PGP_STR) == 0)
+        	if (strcmp (val, SEAHORSE_PGP_TYPE_STR) == 0)
         		return SEAHORSE_GKR_USE_PGP;
 #endif
 #ifdef WITH_SSH
-        	if (strcmp (val, SEAHORSE_SSH_STR) == 0)
+        	if (strcmp (val, SEAHORSE_SSH_TYPE_STR) == 0)
         		return SEAHORSE_GKR_USE_SSH;
 #endif
         }
@@ -604,3 +507,20 @@
     return g_quark_from_string (buf);
 }
 
+const gchar*
+seahorse_gkr_find_string_attribute (GnomeKeyringAttributeList *attrs, const gchar *name)
+{
+	guint i;
+	
+	g_return_val_if_fail (attrs, NULL);
+	g_return_val_if_fail (name, NULL);
+
+	for (i = 0; i < attrs->len; i++) {
+		GnomeKeyringAttribute *attr = &(gnome_keyring_attribute_list_index (attrs, i));
+		if (g_ascii_strcasecmp (name, attr->name) == 0 && 
+				attr->type == GNOME_KEYRING_ATTRIBUTE_TYPE_STRING)
+			return attr->value.string;
+	}
+	    
+	return NULL;
+}

Modified: trunk/gkr/seahorse-gkr-item.h
==============================================================================
--- trunk/gkr/seahorse-gkr-item.h	(original)
+++ trunk/gkr/seahorse-gkr-item.h	Sat Nov 29 17:37:20 2008
@@ -19,23 +19,6 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/**
- * SeahorseCredential: Represents a gnome-keyring item 
- * 
- * - Derived from SeahorseKey
- * 
- * Properties:
- *   display-name: (gchar*) The display name for the key.
- *   display-id: (gchar*) The keyid to display.
- *   simple-name: (gchar*) Shortened display name for the key (for use in files etc...).
- *   fingerprint: (gchar*) Displayable fingerprint for the key.
- *   validity: (SeahorseValidity) The key validity.
- *   trust: (SeahorseValidity) Trust for the key.
- *   expires: (gulong) Date this key expires or 0.
- *   length: (gint) The length of the key in bits.
- *   stock-id: (string) The stock icon id.
- */
- 
 #ifndef __SEAHORSE_GKR_ITEM_H__
 #define __SEAHORSE_GKR_ITEM_H__
 
@@ -44,7 +27,7 @@
 
 #include "seahorse-gkr-module.h"
 
-#include "seahorse-key.h"
+#include "seahorse-object.h"
 #include "seahorse-source.h"
 
 typedef enum {
@@ -68,7 +51,7 @@
 typedef struct _SeahorseGkrItemClass SeahorseGkrItemClass;
 
 struct _SeahorseGkrItem {
-    SeahorseKey                 parent;
+    SeahorseObject              parent;
 
     /*< public >*/
     guint32                     item_id;
@@ -78,7 +61,7 @@
 };
 
 struct _SeahorseGkrItemClass {
-    SeahorseKeyClass            parent_class;
+    SeahorseObjectClass         parent_class;
 };
 
 SeahorseGkrItem*        seahorse_gkr_item_new              (SeahorseSource *sksrc,
@@ -98,4 +81,6 @@
 
 SeahorseGkrUse          seahorse_gkr_item_get_use          (SeahorseGkrItem *git);
 
+const gchar* 		seahorse_gkr_find_string_attribute (GnomeKeyringAttributeList *attrs, const gchar *name);
+
 #endif /* __SEAHORSE_GKR_ITEM_H__ */

Modified: trunk/gkr/seahorse-gkr-operation.c
==============================================================================
--- trunk/gkr/seahorse-gkr-operation.c	(original)
+++ trunk/gkr/seahorse-gkr-operation.c	Sat Nov 29 17:37:20 2008
@@ -70,7 +70,7 @@
 IMPLEMENT_OPERATION_PROPS(Gkr, gkr)
 
     g_object_class_install_property (gobject_class, PROP_KEY_SOURCE,
-        g_param_spec_object ("key-source", "Gkr Source", "Key source this operation works on.", 
+        g_param_spec_object ("source", "Gkr Source", "Key source this operation works on.", 
                              SEAHORSE_TYPE_GKR_SOURCE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ));
 
     g_type_class_add_private (gobject_class, sizeof (SeahorseGkrOperationPrivate));
@@ -263,15 +263,15 @@
     
     g_return_val_if_fail (SEAHORSE_IS_GKR_ITEM (git), NULL);
     
-    sksrc = seahorse_key_get_source (SEAHORSE_KEY (git));
+    sksrc = seahorse_object_get_source (SEAHORSE_OBJECT (git));
     g_return_val_if_fail (SEAHORSE_IS_GKR_SOURCE (sksrc), NULL);
     
     gop = g_object_new (SEAHORSE_TYPE_GKR_OPERATION, 
-                        "key-source", SEAHORSE_GKR_SOURCE (sksrc), NULL);
+                        "source", SEAHORSE_GKR_SOURCE (sksrc), NULL);
     pv = SEAHORSE_GKR_OPERATION_GET_PRIVATE (gop);
     
     keyring_name = seahorse_gkr_source_get_keyring_name (SEAHORSE_GKR_SOURCE (sksrc));
-    pv->keyid = seahorse_key_get_keyid (SEAHORSE_KEY (git));
+    pv->keyid = seahorse_object_get_id (SEAHORSE_OBJECT (git));
     
     /* Start actual save request */
     pv->request = gnome_keyring_item_set_info (keyring_name, git->item_id, info, 
@@ -295,15 +295,15 @@
     
     g_return_val_if_fail (SEAHORSE_IS_GKR_ITEM (git), NULL);
     
-    sksrc = seahorse_key_get_source (SEAHORSE_KEY (git));
+    sksrc = seahorse_object_get_source (SEAHORSE_OBJECT (git));
     g_return_val_if_fail (SEAHORSE_IS_GKR_SOURCE (sksrc), NULL);
     
     gop = g_object_new (SEAHORSE_TYPE_GKR_OPERATION, 
-                        "key-source", SEAHORSE_GKR_SOURCE (sksrc), NULL);
+                        "source", SEAHORSE_GKR_SOURCE (sksrc), NULL);
     pv = SEAHORSE_GKR_OPERATION_GET_PRIVATE (gop);
     
     keyring_name = seahorse_gkr_source_get_keyring_name (SEAHORSE_GKR_SOURCE (sksrc));
-    pv->keyid = seahorse_key_get_keyid (SEAHORSE_KEY (git));
+    pv->keyid = seahorse_object_get_id (SEAHORSE_OBJECT (git));
     
     /* Start actual save request */
     pv->request = gnome_keyring_item_set_acl (keyring_name, git->item_id, acl, 

Modified: trunk/gkr/seahorse-gkr-source.c
==============================================================================
--- trunk/gkr/seahorse-gkr-source.c	(original)
+++ trunk/gkr/seahorse-gkr-source.c	Sat Nov 29 17:37:20 2008
@@ -72,13 +72,6 @@
 
 G_DEFINE_TYPE (SeahorseGkrSource, seahorse_gkr_source, SEAHORSE_TYPE_SOURCE);
 
-/* Forward decls */
-
-static void         key_changed             (SeahorseKey *skey, SeahorseKeyChange change, 
-                                             SeahorseSource *sksrc);
-
-static void         key_destroyed           (SeahorseKey *skey, SeahorseSource *sksrc);
-
 /* -----------------------------------------------------------------------------
  * LIST OPERATION 
  */
@@ -217,10 +210,6 @@
     git = seahorse_gkr_item_new (SEAHORSE_SOURCE (lop->gsrc), lop->current_id, 
                                       lop->current_info, lop->current_attrs, lop->current_acl);
  
-    /* We listen in to get notified of changes on this key */
-    g_signal_connect (git, "changed", G_CALLBACK (key_changed), SEAHORSE_SOURCE (lop->gsrc));
-    g_signal_connect (git, "destroy", G_CALLBACK (key_destroyed), SEAHORSE_SOURCE (lop->gsrc));
-
     /* Add to context */ 
     seahorse_context_take_object (SCTX_APP (), SEAHORSE_OBJECT (git));
 
@@ -303,7 +292,7 @@
 
 /* Remove the given key from the context */
 static void
-remove_key_from_context (gpointer kt, SeahorseKey *dummy, SeahorseSource *sksrc)
+remove_key_from_context (gpointer kt, SeahorseObject *dummy, SeahorseSource *sksrc)
 {
     /* This function gets called as a GHFunc on the lop->checks hashtable. */
     GQuark keyid = GPOINTER_TO_UINT (kt);
@@ -621,26 +610,6 @@
  * INTERNAL
  */
 
-static void
-key_changed (SeahorseKey *skey, SeahorseKeyChange change, SeahorseSource *sksrc)
-{
-    /* TODO: We need to fix these key change flags. Currently the only thing
-     * that sets 'ALL' is when we replace a key in an skey. We don't 
-     * need to reload in that case */
-    
-    if (change == SKEY_CHANGE_ALL)
-        return;
-
-    seahorse_source_load_async (sksrc, seahorse_key_get_keyid (skey));
-}
-
-static void
-key_destroyed (SeahorseKey *skey, SeahorseSource *sksrc)
-{
-    g_signal_handlers_disconnect_by_func (skey, key_changed, sksrc);
-    g_signal_handlers_disconnect_by_func (skey, key_destroyed, sksrc);
-}
-
 /* -----------------------------------------------------------------------------
  * OBJECT 
  */
@@ -828,7 +797,7 @@
     
     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));
+                           0, G_MAXUINT, SEAHORSE_TAG_INVALID, G_PARAM_READABLE));
     
     g_object_class_install_property (gobject_class, PROP_FLAGS,
         g_param_spec_uint ("flags", "Flags", "Object Source flags.", 
@@ -843,7 +812,7 @@
                            0, G_MAXUINT, SEAHORSE_LOCATION_INVALID, G_PARAM_READABLE));    
     
     
-	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_GKR_SOURCE, "key-source", "local", SEAHORSE_GKR_STR, NULL);
+	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_GKR_SOURCE, "source", "local", SEAHORSE_GKR_STR, NULL);
 }
 
 /* -------------------------------------------------------------------------- 

Modified: trunk/libseahorse/Makefile.am
==============================================================================
--- trunk/libseahorse/Makefile.am	(original)
+++ trunk/libseahorse/Makefile.am	Sat Nov 29 17:37:20 2008
@@ -18,9 +18,7 @@
 VALA_SRCS = \
 	seahorse-commands.vala \
 	seahorse-generator.vala \
-	seahorse-object.vala \
 	seahorse-servers.vala \
-	seahorse-types.vala \
 	seahorse-view.vala
 	
 VALA_PKGS = \
@@ -52,35 +50,36 @@
 endif
 
 libseahorse_la_SOURCES = \
-	seahorse-key.c seahorse-key.h \
-	seahorse-source.c seahorse-source.h \
-	seahorse-key-widget.c seahorse-key-widget.h \
-    seahorse-unknown-key.c seahorse-unknown-key.h \
-    seahorse-unknown-source.c seahorse-unknown-source.h \
-	seahorse-context.c seahorse-context.h \
-	seahorse-widget.c seahorse-widget.h \
-	seahorse-set.c seahorse-set.h \
-	seahorse-set-model.c seahorse-set-model.h \
-	seahorse-key-model.c seahorse-key-model.h \
-	seahorse-util.c seahorse-util.h \
-	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-passphrase.c seahorse-passphrase.h \
+	seahorse-context.c seahorse-context.h \
+	seahorse-dns-sd.c seahorse-dns-sd.h \
+	seahorse-gconf.c seahorse-gconf.h \
+	seahorse-gtkstock.c seahorse-gtkstock.h \
 	seahorse-libdialogs.h \
+	seahorse-notification.c \
+	seahorse-object.c seahorse-object.h \
+	seahorse-object-model.c seahorse-object-model.h \
+	seahorse-object-widget.c seahorse-object-widget.h \
+	seahorse-operation.c seahorse-operation.h \
+	seahorse-passphrase.c seahorse-passphrase.h \
 	seahorse-prefs.c seahorse-prefs.h \
 	seahorse-prefs-keyrings.c \
-	seahorse-operation.c seahorse-operation.h \
-    seahorse-transfer-operation.c seahorse-transfer-operation.h \
 	seahorse-progress.c seahorse-progress.h \
-	seahorse-gconf.c seahorse-gconf.h \
-	seahorse-dns-sd.c seahorse-dns-sd.h \
-	seahorse-gtkstock.c seahorse-gtkstock.h \
-	seahorse-notification.c \
 	seahorse-secure-memory.c seahorse-secure-memory.h \
 	seahorse-secure-entry.c seahorse-secure-entry.h \
 	seahorse-servers.c seahorse-servers.h \
+	seahorse-set.c seahorse-set.h \
+	seahorse-set-model.c seahorse-set-model.h \
+	seahorse-source.c seahorse-source.h \
+	seahorse-transfer-operation.c seahorse-transfer-operation.h \
+	seahorse-types.c seahorse-types.h \
 	seahorse-unix-signal.c seahorse-unix-signal.h \
+	seahorse-unknown.c seahorse-unknown.h \
+	seahorse-unknown-source.c seahorse-unknown-source.h \
+	seahorse-util.c seahorse-util.h \
+	seahorse-validity.c seahorse-validity.h \
+	seahorse-widget.c seahorse-widget.h \
 	$(MARSHAL_SRCS) \
 	$(VALA_CFILES) $(VALA_HFILES) \
 	$(KEYSERVER_SRCS)

Modified: trunk/libseahorse/libseahorse-c.vapi
==============================================================================
--- trunk/libseahorse/libseahorse-c.vapi	(original)
+++ trunk/libseahorse/libseahorse-c.vapi	Sat Nov 29 17:37:20 2008
@@ -24,7 +24,7 @@
 
 	[CCode (cname = "SEAHORSE_ERROR", cheader_filename = "seahorse-util.h")]
 	public GLib.Quark ERROR_DOMAIN;
-
+	
         [CCode (cheader_filename = "seahorse-source.h")]
         public class Source : GLib.Object {
 		public GLib.Quark ktype { get; }
@@ -39,27 +39,6 @@
 		public virtual void remove (Object object, uint name) throws GLib.Error; 
         }
         
-        [CCode (cheader_filename = "seahorse-key.h")]
-        public class Key : Seahorse.Object {
-
-	       	[CCode (cprefix = "SKEY_FLAG_")]
-        	public static enum Flag {
-			IS_VALID =    0x0001,
-			CAN_ENCRYPT = 0x0002,
-			CAN_SIGN =    0x0004,
-			EXPIRED =     0x0100,
-			REVOKED =     0x0200,
-			DISABLED =    0x0400,
-			TRUSTED =     0x1000,
-			EXPORTABLE =  0x00100000
-        	}
-
-		public GLib.Quark ktype { get; }
-		public GLib.Quark keyid { get; }
-		public Usage usage { get; }
-		public string display_name { get; }
-        }
-        
 	[CCode (cheader_filename = "seahorse-set.h")]
 	public class Set : GLib.Object {
 		public Set.full (ref Object.Predicate pred); 
@@ -154,7 +133,7 @@
 		public weak Gtk.Dialog chooser_save_new (string title, Gtk.Window? parent);
 		public void chooser_show_key_files (Gtk.Dialog dialog);
 		[CCode (cname = "seahorse_chooser_set_filename_full")]
-		public void chooser_set_filename (Gtk.Dialog dialog, GLib.List<Key> keys);
+		public void chooser_set_filename (Gtk.Dialog dialog, GLib.List<Object> keys);
 		public string chooser_save_prompt (Gtk.Dialog dialog);
 		
 		public weak Gtk.Dialog chooser_open_new (string title, Gtk.Window? parent);
@@ -222,7 +201,7 @@
 	
 	[CCode (cheader_filename = "seahorse-windows.h")]
 	public class KeyserverSync : GLib.Object {
-		public static weak Gtk.Window show (GLib.List<Key> keys, Gtk.Window parent);
+		public static weak Gtk.Window show (GLib.List<Object> keys, Gtk.Window parent);
 	}
 	
 	[CCode (cheader_filename = "seahorse-viewer.h")]

Modified: trunk/libseahorse/libseahorse.gidl
==============================================================================
--- trunk/libseahorse/libseahorse.gidl	(original)
+++ trunk/libseahorse/libseahorse.gidl	Sat Nov 29 17:37:20 2008
@@ -59,13 +59,6 @@
 			</parameters>
 			<return-type type="GLib.List*" transfer="full"/>
 		</method>
-		<method name="fire_changed" symbol="seahorse_object_fire_changed">
-			<parameters>
-				<parameter name="self" type="Seahorse.Object*"/>
-				<parameter name="what" type="Seahorse.Object.Change"/>
-			</parameters>
-			<return-type type="void"/>
-		</method>
 		<property name="tag" type="GLib.Quark" readable="1"/>
 		<property name="id" type="GLib.Quark" readable="1"/>
 		<property name="location" type="Seahorse.Location" readable="1" writable="1"/>
@@ -77,12 +70,6 @@
 		<property name="markup" type="string*" readable="1"/>
 		<property name="stock_id" type="string*" readable="1"/>
 		<property name="parent" type="Seahorse.Object*" readable="1" writable="1"/>
-		<signal name="changed">
-			<parameters>
-				<parameter name="what" type="Seahorse.Object.Change"/>
-			</parameters>
-			<return-type type="void"/>
-		</signal>
 		<signal name="hierarchy">
 			<parameters>
 			</parameters>

Modified: trunk/libseahorse/libseahorse.vapi
==============================================================================
--- trunk/libseahorse/libseahorse.vapi	(original)
+++ trunk/libseahorse/libseahorse.vapi	Sat Nov 29 17:37:20 2008
@@ -35,21 +35,21 @@
 	}
 	[CCode (cheader_filename = "seahorse-object.h")]
 	public abstract class Object : GLib.Object {
-		[CCode (cprefix = "SEAHORSE_OBJECT_CHANGE_", cheader_filename = "seahorse-object.h")]
-		public enum Change {
-			ALL,
-			LOCATION,
-			PREFERRED,
-			MAX
-		}
-		protected GLib.Quark _tag;
-		protected GLib.Quark _id;
-		protected Seahorse.Location _location;
-		protected Seahorse.Usage _usage;
-		protected uint _flags;
-		public weak Seahorse.Context attached_to;
+
+ 	       	[CCode (cprefix = "SEAHORSE_FLAG_")]
+         	public static enum Flag {
+ 			IS_VALID =    0x0001,
+ 			CAN_ENCRYPT = 0x0002,
+ 			CAN_SIGN =    0x0004,
+ 			EXPIRED =     0x0100,
+ 			REVOKED =     0x0200,
+ 			DISABLED =    0x0400,
+ 			TRUSTED =     0x1000,
+ 			EXPORTABLE =  0x00100000
+         	}
+
+		public weak Seahorse.Context context;
 		public GLib.List<weak Seahorse.Object> get_children ();
-		protected void fire_changed (Seahorse.Object.Change what);
 		public GLib.Quark tag { get; }
 		public GLib.Quark id { get; }
 		public Seahorse.Location location { get; set; }
@@ -57,13 +57,10 @@
 		public uint flags { get; }
 		public Seahorse.Source source { get; set; }
 		public Seahorse.Object preferred { get; set; }
-		public abstract string# display_name { get; }
+		public abstract string# label { get; }
 		public abstract string# markup { get; }
-		public abstract string# stock_id { get; }
+		public abstract string# icon { get; }
 		public Seahorse.Object? parent { get; set; }
-		public signal void changed (Seahorse.Object.Change what);
-		public signal void hierarchy ();
-		public signal void destroy ();
 		[CCode (cheader_filename = "seahorse-object.h")]
 		public struct Predicate {
 			public GLib.Quark tag;

Modified: trunk/libseahorse/seahorse-combo-keys.c
==============================================================================
--- trunk/libseahorse/seahorse-combo-keys.c	(original)
+++ trunk/libseahorse/seahorse-combo-keys.c	Sat Nov 29 17:37:20 2008
@@ -19,9 +19,12 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include "config.h"
+
 #include "seahorse-combo-keys.h"
-#include "seahorse-key.h"
+
 #include "seahorse-gconf.h"
+#include "seahorse-object.h"
 
 enum {
   COMBO_STRING,
@@ -34,42 +37,40 @@
  */
 
 static void
-key_added (SeahorseSet *skset, SeahorseKey *skey, GtkComboBox *combo)
+object_added (SeahorseSet *skset, SeahorseObject *object, GtkComboBox *combo)
 {
     GtkListStore *model;
     GtkTreeIter iter;
-    gchar *userid;
+    const gchar *userid;
     
-    g_return_if_fail (skey != NULL);
+    g_return_if_fail (SEAHORSE_IS_OBJECT (object));
     g_return_if_fail (combo != NULL);
     
     model = GTK_LIST_STORE (gtk_combo_box_get_model (combo));
     
-    userid = seahorse_key_get_display_name (skey);
+    userid = seahorse_object_get_label (object);
 
     gtk_list_store_append (model, &iter);
     gtk_list_store_set (model, &iter,
                         COMBO_STRING, userid,
-                        COMBO_POINTER, skey,
+                        COMBO_POINTER, object,
                         -1);
-
-    g_free (userid);
     
-    seahorse_set_set_closure (skset, SEAHORSE_OBJECT (skey), GINT_TO_POINTER (TRUE));
+    seahorse_set_set_closure (skset, object, GINT_TO_POINTER (TRUE));
 }
 
 static void
-key_changed (SeahorseSet *skset, SeahorseKey *skey, SeahorseKeyChange change, 
-             GtkWidget *closure, GtkComboBox *combo)
+object_changed (SeahorseSet *skset, SeahorseObject *object, 
+                GtkWidget *closure, GtkComboBox *combo)
 {
     GtkTreeModel *model;
     GtkTreeIter iter;
     gboolean valid;
-    gchar *userid;
+    const gchar *userid;
     gpointer pntr;
-    SeahorseKey *skeyfrommodel;
+    SeahorseObject *frommodel;
     
-    g_return_if_fail (skey != NULL);
+    g_return_if_fail (SEAHORSE_IS_OBJECT (object));
 
     model = gtk_combo_box_get_model (combo);
     valid = gtk_tree_model_get_iter_first (model, &iter);
@@ -79,33 +80,32 @@
                             COMBO_POINTER, &pntr,
                             -1);
                             
-        skeyfrommodel = SEAHORSE_KEY (pntr);
+        frommodel = SEAHORSE_OBJECT (pntr);
         
-        if (skeyfrommodel == skey) {
-        userid = seahorse_key_get_display_name (skey);
+        if (frommodel == object) {
+        userid = seahorse_object_get_label (object);
             gtk_list_store_set (GTK_LIST_STORE (model), &iter,
                                 COMBO_STRING, userid,
                                 -1);
                                 
-        g_free (userid);
             break;
-    }
+        }
     
         valid = gtk_tree_model_iter_next (model, &iter);
     }
 }
 
 static void
-key_removed (SeahorseSet *skset, SeahorseKey *skey, GtkWidget *closure, 
-             GtkComboBox *combo)
+object_removed (SeahorseSet *skset, SeahorseObject *object, 
+                GtkWidget *closure, GtkComboBox *combo)
 {
     GtkTreeModel *model;
     GtkTreeIter iter;
     gpointer pntr;
     gboolean valid;
-    SeahorseKey *skeyfrommodel;
+    SeahorseObject *frommodel;
     
-    g_return_if_fail (skey != NULL);
+    g_return_if_fail (SEAHORSE_IS_OBJECT (object));
     g_return_if_fail (combo != NULL);
 
     model = gtk_combo_box_get_model (combo);
@@ -116,9 +116,9 @@
                             COMBO_POINTER, &pntr,
                             -1);
                             
-        skeyfrommodel = SEAHORSE_KEY (pntr);
+        frommodel = SEAHORSE_OBJECT (pntr);
         
-        if (skeyfrommodel == skey) {
+        if (frommodel == object) {
             gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
                                 
             break;
@@ -131,9 +131,9 @@
 static void
 combo_destroyed (GtkComboBox *combo, SeahorseSet *skset)
 {
-    g_signal_handlers_disconnect_by_func (skset, key_added, combo);
-    g_signal_handlers_disconnect_by_func (skset, key_changed, combo);
-    g_signal_handlers_disconnect_by_func (skset, key_removed, combo);
+    g_signal_handlers_disconnect_by_func (skset, object_added, combo);
+    g_signal_handlers_disconnect_by_func (skset, object_changed, combo);
+    g_signal_handlers_disconnect_by_func (skset, object_removed, combo);
 }
 
 /* -----------------------------------------------------------------------------
@@ -147,8 +147,8 @@
     GtkTreeModel *model;
     GtkTreeIter iter;
     GtkCellRenderer *renderer;
-    SeahorseKey *skey;
-    GList *l, *keys;
+    SeahorseObject *object;
+    GList *l, *objects;
 
     /* Setup the None Option */
     model = gtk_combo_box_get_model (combo);
@@ -164,17 +164,17 @@
                                        "text", COMBO_STRING);                            
     }
 
-    /* Setup the key list */
-    keys = seahorse_set_get_objects (skset);  
-    for (l = keys; l != NULL; l = g_list_next (l)) {
-        skey = SEAHORSE_KEY (l->data);
-        key_added (skset, skey, combo);
-    }
-    g_list_free (keys);
-
-    g_signal_connect_after (skset, "added", G_CALLBACK (key_added), combo);
-    g_signal_connect_after (skset, "changed", G_CALLBACK (key_changed), combo);
-    g_signal_connect_after (skset, "removed", G_CALLBACK (key_removed), combo);
+    /* Setup the object list */
+    objects = seahorse_set_get_objects (skset);  
+    for (l = objects; l != NULL; l = g_list_next (l)) {
+        object = SEAHORSE_OBJECT (l->data);
+        object_added (skset, object, combo);
+    }
+    g_list_free (objects);
+
+    g_signal_connect_after (skset, "added", G_CALLBACK (object_added), combo);
+    g_signal_connect_after (skset, "changed", G_CALLBACK (object_changed), combo);
+    g_signal_connect_after (skset, "removed", G_CALLBACK (object_removed), combo);
 
     if (none_option) {
         gtk_list_store_prepend (GTK_LIST_STORE (model), &iter);
@@ -195,9 +195,9 @@
 }
 
 void
-seahorse_combo_keys_set_active_id (GtkComboBox *combo, GQuark keyid)
+seahorse_combo_keys_set_active_id (GtkComboBox *combo, GQuark id)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     GtkTreeModel *model;
     GtkTreeIter iter;
     gboolean valid;
@@ -217,15 +217,15 @@
                             COMBO_POINTER, &pointer,
                             -1);
                             
-        skey = SEAHORSE_KEY (pointer);
+        object = SEAHORSE_OBJECT (pointer);
         
-        if (!keyid) {
-            if (!skey) {
+        if (!id) {
+            if (!object) {
                 gtk_combo_box_set_active_iter (combo, &iter);
                 break;
             }
-        } else if (skey != NULL) {
-            if (keyid == seahorse_key_get_keyid (skey)) {
+        } else if (object != NULL) {
+            if (id == seahorse_object_get_id (object)) {
                 gtk_combo_box_set_active_iter (combo, &iter);
                 break;
             }
@@ -237,13 +237,13 @@
 }
 
 void 
-seahorse_combo_keys_set_active (GtkComboBox *combo, SeahorseKey *skey)
+seahorse_combo_keys_set_active (GtkComboBox *combo, SeahorseObject *object)
 {
     seahorse_combo_keys_set_active_id (combo, 
-                skey == NULL ? 0 : seahorse_key_get_keyid (skey));
+                object == NULL ? 0 : seahorse_object_get_id (object));
 }
 
-SeahorseKey* 
+SeahorseObject* 
 seahorse_combo_keys_get_active (GtkComboBox *combo)
 {
     GtkTreeModel *model;
@@ -261,12 +261,12 @@
                         COMBO_POINTER, &pointer,
                         -1);
 
-    return SEAHORSE_KEY (pointer);
+    return SEAHORSE_OBJECT (pointer);
 }
 
 GQuark 
 seahorse_combo_keys_get_active_id (GtkComboBox *combo)
 {
-    SeahorseKey *skey = seahorse_combo_keys_get_active (combo);
-    return skey == NULL ? 0 : seahorse_key_get_keyid (skey);
+    SeahorseObject *object = seahorse_combo_keys_get_active (combo);
+    return object == NULL ? 0 : seahorse_object_get_id (object);
 }

Modified: trunk/libseahorse/seahorse-combo-keys.h
==============================================================================
--- trunk/libseahorse/seahorse-combo-keys.h	(original)
+++ trunk/libseahorse/seahorse-combo-keys.h	Sat Nov 29 17:37:20 2008
@@ -29,11 +29,11 @@
 #ifndef __SEAHORSE_COMBO_KEYS_H__
 #define __SEAHORSE_COMBO_KEYS_H__
 
-#include <gtk/gtk.h>
-
-#include "seahorse-key.h"
+#include "seahorse-object.h"
 #include "seahorse-set.h"
 
+#include <gtk/gtk.h>
+
 void                        seahorse_combo_keys_attach              (GtkComboBox *combo,
                                                                      SeahorseSet *skset,
                                                                      const gchar *none_option);
@@ -42,9 +42,9 @@
                                                                      GQuark keyid);
 
 void                        seahorse_combo_keys_set_active          (GtkComboBox *combo,
-                                                                     SeahorseKey *skey);
+                                                                     SeahorseObject *object);
 
-SeahorseKey*                seahorse_combo_keys_get_active          (GtkComboBox *combo);
+SeahorseObject*             seahorse_combo_keys_get_active          (GtkComboBox *combo);
 
 GQuark                      seahorse_combo_keys_get_active_id       (GtkComboBox *combo);
 

Modified: trunk/libseahorse/seahorse-context.c
==============================================================================
--- trunk/libseahorse/seahorse-context.c	(original)
+++ trunk/libseahorse/seahorse-context.c	Sat Nov 29 17:37:20 2008
@@ -33,10 +33,11 @@
 #include "seahorse-marshal.h"
 #include "seahorse-servers.h"
 #include "seahorse-transfer-operation.h"
+#include "seahorse-unknown.h"
 #include "seahorse-unknown-source.h"
-#include "seahorse-unknown-key.h"
 #include "seahorse-util.h"
 
+#include "common/seahorse-bind.h"
 #include "common/seahorse-registry.h"
 
 #ifdef WITH_PGP
@@ -103,7 +104,7 @@
                 NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, SEAHORSE_TYPE_OBJECT);    
     signals[CHANGED] = g_signal_new ("changed", SEAHORSE_TYPE_CONTEXT, 
                 G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (SeahorseContextClass, changed),
-                NULL, NULL, seahorse_marshal_VOID__OBJECT_UINT, G_TYPE_NONE, 2, SEAHORSE_TYPE_OBJECT, G_TYPE_UINT);    
+                NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, SEAHORSE_TYPE_OBJECT);    
 }
 
 /* init context, private vars, set prefs, connect signals */
@@ -320,7 +321,7 @@
     for (l = sctx->pv->sources; l; l = g_slist_next (l)) {
         ks = SEAHORSE_SOURCE (l->data);
         
-        if (ktype != SKEY_UNKNOWN && 
+        if (ktype != SEAHORSE_TAG_INVALID && 
             seahorse_source_get_ktype (ks) != ktype)
             continue;
         
@@ -332,7 +333,7 @@
     }
     
     /* If we don't have an unknown source for this type, create it */
-    if (location == SEAHORSE_LOCATION_MISSING && location != SKEY_UNKNOWN) {
+    if (location == SEAHORSE_LOCATION_MISSING && location != SEAHORSE_TAG_INVALID) {
         ks = SEAHORSE_SOURCE (seahorse_unknown_source_new (ktype));
         seahorse_context_add_source (sctx, ks);
         return ks;
@@ -356,7 +357,7 @@
     for (l = sctx->pv->sources; l; l = g_slist_next (l)) {
         ks = SEAHORSE_SOURCE (l->data);
         
-        if (ktype != SKEY_UNKNOWN && 
+        if (ktype != SEAHORSE_TAG_INVALID && 
             seahorse_source_get_ktype (ks) != ktype)
             continue;
         
@@ -418,16 +419,9 @@
 
 
 static void
-object_changed (SeahorseObject *sobj, SeahorseKeyChange change, SeahorseContext *sctx)
-{
-    g_signal_emit (sctx, signals[CHANGED], 0, sobj, change);
-}
-
-static void
-object_destroyed (SeahorseObject *sobj, SeahorseContext *sctx)
+object_notify (SeahorseObject *sobj, SeahorseContext *sctx)
 {
-    /* When objects are destroyed elsewhere */
-    seahorse_context_remove_object (sctx, sobj);
+	g_signal_emit (sctx, signals[CHANGED], 0, sobj);
 }
 
 static gpointer                 
@@ -518,8 +512,7 @@
         sctx = seahorse_context_for_app ();
     g_return_if_fail (SEAHORSE_IS_CONTEXT (sctx));
     g_return_if_fail (SEAHORSE_IS_OBJECT (sobj));
-    g_return_if_fail (sobj->_id != 0);
-    g_return_if_fail (!sobj->attached_to);
+    g_return_if_fail (seahorse_object_get_id (sobj) != 0);
     
     ks = hashkey_by_source (seahorse_object_get_source (sobj), 
                             seahorse_object_get_id (sobj));
@@ -528,14 +521,13 @@
 
     g_object_ref (sobj);
 
-    sobj->attached_to = sctx;
+    g_object_set (sobj, "context", sctx, NULL);
     g_hash_table_replace (sctx->pv->objects_by_source, ks, sobj);
     setup_objects_by_type (sctx, sobj, TRUE);
     g_signal_emit (sctx, signals[ADDED], 0, sobj);
     g_object_unref (sobj);
     
-    g_signal_connect (sobj, "changed", G_CALLBACK (object_changed), sctx);
-    g_signal_connect (sobj, "destroy", G_CALLBACK (object_destroyed), sctx);
+    seahorse_bind_objects (NULL, sobj, (SeahorseTransfer)object_notify, sctx);
 }
 
 guint
@@ -668,12 +660,6 @@
     return km.objects; 
 }
 
-gboolean
-seahorse_context_owns_object (SeahorseContext *sctx, SeahorseObject *sobj)
-{
-    return sobj->attached_to == sctx;
-}
-
 void 
 seahorse_context_remove_object (SeahorseContext *sctx, SeahorseObject *sobj)
 {
@@ -688,12 +674,11 @@
                            seahorse_object_get_id (sobj));
     
     if (g_hash_table_lookup (sctx->pv->objects_by_source, k)) {
-        g_return_if_fail (sobj->attached_to == sctx);
+        g_return_if_fail (seahorse_object_get_context (sobj) == sctx);
 
         g_object_ref (sobj);
-        g_signal_handlers_disconnect_by_func (sobj, object_changed, sctx);
-        g_signal_handlers_disconnect_by_func (sobj, object_destroyed, sctx);
-        sobj->attached_to = NULL;
+        g_signal_handlers_disconnect_by_func (sobj, object_notify, sctx);
+        g_object_set (sobj, "context", NULL, NULL);
         g_hash_table_remove (sctx->pv->objects_by_source, k);
         setup_objects_by_type (sctx, sobj, FALSE);
         g_signal_emit (sctx, signals[REMOVED], 0, sobj);    
@@ -712,7 +697,7 @@
  * 
  * Returns: the secret key that's the default key 
  */
-SeahorseKey*
+SeahorseObject*
 seahorse_context_get_default_key (SeahorseContext *sctx)
 {
     SeahorseObject *sobj = NULL;
@@ -732,9 +717,7 @@
     
     g_free (id);
     
-    if (SEAHORSE_IS_KEY (sobj))
-	    return SEAHORSE_KEY (sobj);
-    return NULL;
+    return sobj;
 }
 
 /**
@@ -1152,54 +1135,25 @@
 }
 
 SeahorseObject*
-seahorse_context_object_from_dbus (SeahorseContext *sctx, const gchar *key, guint *uid)
+seahorse_context_object_from_dbus (SeahorseContext *sctx, const gchar *key)
 {
     SeahorseObject *sobj;
-    const gchar *t = NULL;
-    gchar *x, *alloc = NULL;
-    
-    /* Find the second colon, if any */
-    t = strchr (key, ':');
-    if (t != NULL) {
-        t = strchr (t + 1, ':');
-        if(t != NULL) {
-            key = alloc = g_strndup (key, t - key);
-            ++t;
-        }
-    }
     
     /* This will always get the most preferred key */
     sobj = seahorse_context_find_object (sctx, g_quark_from_string (key), 
                                          SEAHORSE_LOCATION_INVALID);
     
-    if (uid)
-        *uid = 0;
-        
-    /* Parse out the uid */
-    if (SEAHORSE_IS_KEY (sobj) && sobj && t) {
-        glong l = strtol (t, &x, 10);
-            
-        /* Make sure it's valid */
-        if (*x || l < 0 || l >= seahorse_key_get_num_names (SEAHORSE_KEY (sobj)))
-            sobj = NULL;
-        else if (uid)
-            *uid = (guint)l;
-    }
-    
     return sobj;
 }
 
 gchar*
-seahorse_context_object_to_dbus (SeahorseContext *sctx, SeahorseObject *sobj, guint uid)
+seahorse_context_object_to_dbus (SeahorseContext *sctx, SeahorseObject *sobj)
 {
-    return seahorse_context_id_to_dbus (sctx, seahorse_object_get_id (sobj), uid);
+    return seahorse_context_id_to_dbus (sctx, seahorse_object_get_id (sobj));
 }
 
 gchar*
-seahorse_context_id_to_dbus (SeahorseContext* sctx, GQuark id, guint uid)
+seahorse_context_id_to_dbus (SeahorseContext* sctx, GQuark id)
 {
-    if (uid == 0)
-        return g_strdup (g_quark_to_string (id));
-    else
-        return g_strdup_printf ("%s:%d", g_quark_to_string (id), uid);
+	return g_strdup (g_quark_to_string (id));
 }

Modified: trunk/libseahorse/seahorse-context.h
==============================================================================
--- trunk/libseahorse/seahorse-context.h	(original)
+++ trunk/libseahorse/seahorse-context.h	Sat Nov 29 17:37:20 2008
@@ -83,7 +83,7 @@
     void (*removed) (SeahorseContext *sctx, struct _SeahorseObject *sobj);
     
     /* This object has changed */
-    void (*changed) (SeahorseContext *sctx, struct _SeahorseObject *sobj, int change);
+    void (*changed) (SeahorseContext *sctx, struct _SeahorseObject *sobj);
 };
 
 enum SeahorseContextType {
@@ -154,13 +154,11 @@
 void                seahorse_context_remove_object      (SeahorseContext *sctx,
                                                          struct _SeahorseObject *sobj);
 
-gboolean            seahorse_context_owns_object        (SeahorseContext *sctx,
-                                                         struct _SeahorseObject *sobj);
-
 SeahorseServiceDiscovery*
                     seahorse_context_get_discovery      (SeahorseContext    *sctx);
 
-struct _SeahorseKey*   seahorse_context_get_default_key (SeahorseContext    *sctx);
+struct _SeahorseObject*   
+                    seahorse_context_get_default_key    (SeahorseContext    *sctx);
 
 SeahorseOperation*  seahorse_context_refresh_local         (SeahorseContext    *sctx);
 
@@ -183,15 +181,12 @@
                                                          GSList             *ids);
 
 struct _SeahorseObject*     seahorse_context_object_from_dbus   (SeahorseContext    *sctx,
-                                                         const gchar        *dbusid,
-                                                         guint              *uid);
+                                                         const gchar        *dbusid);
 
 gchar*              seahorse_context_object_to_dbus     (SeahorseContext    *sctx,
-                                                         struct _SeahorseObject *sobj,
-                                                         guint              uid);
+                                                         struct _SeahorseObject *sobj);
 
 gchar*              seahorse_context_id_to_dbus         (SeahorseContext    *sctx,
-                                                         GQuark             id, 
-                                                         guint              uid);
+                                                         GQuark             id);
 
 #endif /* __SEAHORSE_CONTEXT_H__ */

Modified: trunk/libseahorse/seahorse-gtkstock.h
==============================================================================
--- trunk/libseahorse/seahorse-gtkstock.h	(original)
+++ trunk/libseahorse/seahorse-gtkstock.h	Sat Nov 29 17:37:20 2008
@@ -26,6 +26,8 @@
 #ifndef _SEAHORSE_GTKSTOCK_H_
 #define _SEAHORSE_GTKSTOCK_H_
 
+#include <glib.h>
+
 /* The default stock icons */
 #define SEAHORSE_STOCK_KEY          "seahorse-key"
 #define SEAHORSE_STOCK_SECRET       "seahorse-key-personal"

Modified: trunk/libseahorse/seahorse-keyserver-control.c
==============================================================================
--- trunk/libseahorse/seahorse-keyserver-control.c	(original)
+++ trunk/libseahorse/seahorse-keyserver-control.c	Sat Nov 29 17:37:20 2008
@@ -22,7 +22,6 @@
 #include "seahorse-context.h"
 #include "seahorse-gconf.h"
 #include "seahorse-keyserver-control.h"
-#include "seahorse-key.h"
 #include "seahorse-servers.h"
 #include "seahorse-util.h"
 

Modified: trunk/libseahorse/seahorse-notification.c
==============================================================================
--- trunk/libseahorse/seahorse-notification.c	(original)
+++ trunk/libseahorse/seahorse-notification.c	Sat Nov 29 17:37:20 2008
@@ -29,11 +29,12 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 
-#include "seahorse-key.h"
-#include "seahorse-object.h"
 #include "seahorse-libdialogs.h"
+#include "seahorse-object.h"
 #include "seahorse-util.h"
 
+#include "libcryptui/cryptui.h"
+
 #ifdef HAVE_LIBNOTIFY
 #include <libnotify/notify.h>
 #endif
@@ -72,7 +73,7 @@
  */
 
 /* Forward Declaration */
-static void object_changed (SeahorseObject *sobj, SeahorseObjectChange change, SeahorseNotification *snotif);
+static void object_notify (SeahorseObject *sobj, GParamSpec *spec, SeahorseNotification *snotif);
 
 static void
 insert_key_field (GString *res, const gchar *id, const gchar *field)
@@ -81,22 +82,21 @@
     GValue value;
     GValue svalue;
     gchar *str;
-    guint uid;
     
-    sobj = seahorse_context_object_from_dbus (SCTX_APP (), id, &uid);
-    if (!sobj || !SEAHORSE_IS_KEY (sobj)) {
+    sobj = seahorse_context_object_from_dbus (SCTX_APP (), id);
+    if (!sobj || !SEAHORSE_IS_OBJECT (sobj)) {
         g_warning ("key '%s' in key text does not exist", id);
         return;
     }
     
     /* A default field */
     if (!field)
-        field = "display-name";
+        field = "label";
     
     memset (&value, 0, sizeof (value));
     memset (&svalue, 0, sizeof (value));
     
-    if (seahorse_key_lookup_property (SEAHORSE_KEY (sobj), uid, field, &value)) {
+    if (seahorse_object_lookup_property (SEAHORSE_OBJECT (sobj), field, &value)) {
         g_value_init (&svalue, G_TYPE_STRING);
         if (g_value_transform (&value, &svalue)) {
             str = g_markup_escape_text (g_value_get_string (&svalue), -1);
@@ -365,7 +365,7 @@
 }
 
 static void 
-object_changed (SeahorseObject *sobj, SeahorseObjectChange change, SeahorseNotification *snotif)
+object_notify (SeahorseObject *sobj, GParamSpec *spec, SeahorseNotification *snotif)
 {
     if (!snotif->widget)
         return;
@@ -402,10 +402,10 @@
             g_warning ("key text <key> element requires the following attributes\n"
                        "     <key id=\"xxxxx\" field=\"xxxxx\"/>");
         
-        sobj = seahorse_context_object_from_dbus (SCTX_APP (), key, NULL);
+        sobj = seahorse_context_object_from_dbus (SCTX_APP (), key);
         if (sobj) {
             snotif->objects = g_list_append (snotif->objects, sobj);
-            g_signal_connect (sobj, "changed", G_CALLBACK (object_changed), snotif);
+            g_signal_connect (sobj, "notify", G_CALLBACK (object_notify), snotif);
         }
     }
     
@@ -440,7 +440,7 @@
     snotif->widget = NULL;
     
     for (l = snotif->objects; l; l = g_list_next (l)) 
-        g_signal_handlers_disconnect_by_func (l->data, object_changed, snotif);
+        g_signal_handlers_disconnect_by_func (l->data, object_notify, snotif);
     g_list_free (snotif->objects);
     snotif->objects = NULL;
     
@@ -572,7 +572,7 @@
         body = g_strdup_printf(ngettext("Imported a key for", "Imported keys for", keynum));
         
         for (keyptr = keys; *keyptr; keyptr++) {
-            t = g_strdup_printf ("%s\n<key id='%s' field=\"display-name\"/>", body, *keyptr);
+            t = g_strdup_printf ("%s\n<key id='%s' field=\"label\"/>", body, *keyptr);
             g_free (body);
             body = t;
         }

Copied: trunk/libseahorse/seahorse-object-model.c (from r2632, /trunk/libseahorse/seahorse-key-model.c)
==============================================================================
--- /trunk/libseahorse/seahorse-key-model.c	(original)
+++ trunk/libseahorse/seahorse-object-model.c	Sat Nov 29 17:37:20 2008
@@ -23,9 +23,11 @@
 
 #include <string.h>
 
-#include "seahorse-key-model.h"
+#include "seahorse-object-model.h"
 #include "seahorse-marshal.h"
 
+#include "common/seahorse-bind.h"
+
 enum {
     PROP_0,
     PROP_DATA_COLUMN,
@@ -38,40 +40,40 @@
 
 static guint signals[LAST_SIGNAL] = { 0 };
 
-typedef struct _SeahorseKeyModelPrivate {
+typedef struct _SeahorseObjectModelPrivate {
     GHashTable *rows;
     guint data_column;
-} SeahorseKeyModelPrivate;
+} SeahorseObjectModelPrivate;
 
-G_DEFINE_TYPE (SeahorseKeyModel, seahorse_key_model, GTK_TYPE_TREE_STORE);
+G_DEFINE_TYPE (SeahorseObjectModel, seahorse_object_model, GTK_TYPE_TREE_STORE);
 
-#define SEAHORSE_KEY_MODEL_GET_PRIVATE(obj)  \
-    (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SEAHORSE_TYPE_KEY_MODEL, SeahorseKeyModelPrivate))
+#define SEAHORSE_OBJECT_MODEL_GET_PRIVATE(obj)  \
+    (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SEAHORSE_TYPE_OBJECT_MODEL, SeahorseObjectModelPrivate))
 
 /* Internal data stored at 0 in the tree store in order to keep track
  * of the location, key-store and key.
  */
 typedef struct {
-    SeahorseKeyModel    *skmodel;
-    GPtrArray           *refs;     /* GtkTreeRowReference pointers */
-    SeahorseKey         *skey;     /* The key we're dealing with */
-} SeahorseKeyRow;
+	SeahorseObjectModel *self;
+	GPtrArray           *refs;     /* GtkTreeRowReference pointers */
+	SeahorseObject      *object;     /* The key we're dealing with */
+	gpointer            binding;
+} SeahorseObjectRow;
 
 /* -----------------------------------------------------------------------------
  * INTERNAL 
  */
 
 static void
-key_changed (SeahorseKey *skey, SeahorseKeyChange change, 
-             SeahorseKeyModel *skmodel)
+key_notify (SeahorseObject *object, SeahorseObjectModel *self)
 {
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
-    SeahorseKeyRow *skrow;
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
+    SeahorseObjectRow *skrow;
     GtkTreeIter iter;
     GtkTreePath *path;
     int i;
 
-    skrow = g_hash_table_lookup (pv->rows, skey);
+    skrow = g_hash_table_lookup (pv->rows, object);
     if (!skrow)
         return;
     
@@ -79,51 +81,55 @@
         
         path = gtk_tree_row_reference_get_path (g_ptr_array_index (skrow->refs, i));
         if (path) {
-            gtk_tree_model_get_iter (GTK_TREE_MODEL (skmodel), &iter, path);
-            g_signal_emit (skmodel, signals[UPDATE_ROW], 0, skey, &iter);
+            gtk_tree_model_get_iter (GTK_TREE_MODEL (self), &iter, path);
+            g_signal_emit (self, signals[UPDATE_ROW], 0, object, &iter);
             gtk_tree_path_free (path);
         }
     }
 }
 
 static void
-key_destroyed (SeahorseKey *skey, SeahorseKeyModel *skmodel)
+key_destroyed (gpointer data, GObject *was)
 {
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
-    g_hash_table_remove (pv->rows, skey);
+	SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (data);
+	SeahorseObjectRow *skrow = g_hash_table_lookup (pv->rows, was);
+	if (skrow) {
+		skrow->object = NULL;
+		g_hash_table_remove (pv->rows, was);
+	}
 }
 
 
 static gboolean
-remove_each (SeahorseKey *skey, gchar *path, SeahorseKeyModel *skmodel)
+remove_each (SeahorseObject *object, gchar *path, SeahorseObjectModel *self)
 {
     return TRUE;
 }
 
-static SeahorseKeyRow*
-key_row_new (SeahorseKeyModel *skmodel, SeahorseKey *skey)
+static SeahorseObjectRow*
+key_row_new (SeahorseObjectModel *self, SeahorseObject *object)
 {
-    SeahorseKeyRow *skrow;
+    SeahorseObjectRow *skrow;
     
-    g_assert (SEAHORSE_IS_KEY_MODEL (skmodel));
-    g_assert (SEAHORSE_IS_KEY (skey));
+    g_assert (SEAHORSE_IS_OBJECT_MODEL (self));
+    g_assert (SEAHORSE_IS_OBJECT (object));
     
-    skrow = g_new0 (SeahorseKeyRow, 1);
+    skrow = g_new0 (SeahorseObjectRow, 1);
     skrow->refs = g_ptr_array_new ();
-    skrow->skmodel = skmodel;
-    skrow->skey = skey;
+    skrow->self = self;
+    skrow->object = object;
+    skrow->binding = seahorse_bind_objects (NULL, object, (SeahorseTransfer)key_notify, self);
     
-    g_signal_connect (skey, "changed", G_CALLBACK (key_changed), skmodel);
-    g_signal_connect (skey, "destroy", G_CALLBACK (key_destroyed), skmodel);
+    g_object_weak_ref (G_OBJECT (object), key_destroyed, self);
     
     return skrow;
 }
 
 static void
-key_row_free (SeahorseKeyRow *skrow)
+key_row_free (SeahorseObjectRow *skrow)
 {
-    SeahorseKeyModel *skmodel = skrow->skmodel;
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
+    SeahorseObjectModel *self = skrow->self;
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
     GtkTreeRowReference *ref;
     GtkTreePath *path;
     GtkTreeIter iter;
@@ -137,8 +143,8 @@
         if (ref) {
             path = gtk_tree_row_reference_get_path (ref);
             if (path) {
-                gtk_tree_model_get_iter (GTK_TREE_MODEL (skmodel), &iter, path);
-                gtk_tree_store_set (GTK_TREE_STORE (skmodel), &iter, 
+                gtk_tree_model_get_iter (GTK_TREE_MODEL (self), &iter, path);
+                gtk_tree_store_set (GTK_TREE_STORE (self), &iter, 
                                     pv->data_column, NULL, -1);
                 gtk_tree_path_free (path);
             }
@@ -147,21 +153,22 @@
         
     }
     
-    g_signal_handlers_disconnect_by_func (skrow->skey, key_changed, skrow->skmodel);
-    g_signal_handlers_disconnect_by_func (skrow->skey, key_destroyed, skrow->skmodel);
+    seahorse_bind_disconnect (skrow->binding);
+    if (skrow->object)
+	    g_object_weak_unref (G_OBJECT (skrow->object), key_destroyed, skrow->self);
 
     g_ptr_array_free (skrow->refs, TRUE);
     g_free (skrow);
 }
 
 static void
-row_inserted (SeahorseKeyModel *skmodel, GtkTreePath *path, GtkTreeIter *iter, 
+row_inserted (SeahorseObjectModel *self, GtkTreePath *path, GtkTreeIter *iter, 
               gpointer user_data)
 {
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
     g_return_if_fail (pv->data_column != -1);
     /* XXX: The following line causes problems with GtkTreeModelFilter */
-    /* gtk_tree_store_set (GTK_TREE_STORE (skmodel), iter, pv->data_column, NULL, -1); */
+    /* gtk_tree_store_set (GTK_TREE_STORE (self), iter, pv->data_column, NULL, -1); */
 }
 
 /* -----------------------------------------------------------------------------
@@ -169,21 +176,21 @@
  */
 
 static void
-seahorse_key_model_init (SeahorseKeyModel *skmodel)
+seahorse_object_model_init (SeahorseObjectModel *self)
 {
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
     pv->rows = g_hash_table_new_full (g_direct_hash, g_direct_equal,
                                       NULL, (GDestroyNotify)key_row_free);
     pv->data_column = -1;
-    g_signal_connect (skmodel, "row-inserted", G_CALLBACK (row_inserted), NULL);
+    g_signal_connect (self, "row-inserted", G_CALLBACK (row_inserted), NULL);
 }
 
 static void
-seahorse_key_model_set_property (GObject *gobject, guint prop_id,
+seahorse_object_model_set_property (GObject *gobject, guint prop_id,
                                  const GValue *value, GParamSpec *pspec)
 {
-    SeahorseKeyModel *skmodel = SEAHORSE_KEY_MODEL (gobject);
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
+    SeahorseObjectModel *self = SEAHORSE_OBJECT_MODEL (gobject);
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
 
     switch (prop_id) {
     case PROP_DATA_COLUMN:
@@ -194,11 +201,11 @@
 }
 
 static void
-seahorse_key_model_get_property (GObject *gobject, guint prop_id,
+seahorse_object_model_get_property (GObject *gobject, guint prop_id,
                                  GValue *value, GParamSpec *pspec)
 {
-    SeahorseKeyModel *skmodel = SEAHORSE_KEY_MODEL (gobject);
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
+    SeahorseObjectModel *self = SEAHORSE_OBJECT_MODEL (gobject);
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
 
     switch (prop_id) {
     case PROP_DATA_COLUMN:
@@ -208,51 +215,51 @@
 }
 
 static void
-seahorse_key_model_dispose (GObject *gobject)
+seahorse_object_model_dispose (GObject *gobject)
 {
-    SeahorseKeyModel *skmodel = SEAHORSE_KEY_MODEL (gobject);
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
+    SeahorseObjectModel *self = SEAHORSE_OBJECT_MODEL (gobject);
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
     
     /* Release all our pointers and stuff */
-    g_hash_table_foreach_remove (pv->rows, (GHRFunc)remove_each, skmodel);
-    G_OBJECT_CLASS (seahorse_key_model_parent_class)->dispose (gobject);
+    g_hash_table_foreach_remove (pv->rows, (GHRFunc)remove_each, self);
+    G_OBJECT_CLASS (seahorse_object_model_parent_class)->dispose (gobject);
 }
 
 static void
-seahorse_key_model_finalize (GObject *gobject)
+seahorse_object_model_finalize (GObject *gobject)
 {
-    SeahorseKeyModel *skmodel = SEAHORSE_KEY_MODEL (gobject);
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
+    SeahorseObjectModel *self = SEAHORSE_OBJECT_MODEL (gobject);
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
 
     if (pv->rows)
         g_hash_table_destroy (pv->rows);
     pv->rows = NULL;
     
-    G_OBJECT_CLASS (seahorse_key_model_parent_class)->finalize (gobject);
+    G_OBJECT_CLASS (seahorse_object_model_parent_class)->finalize (gobject);
 }
 
 static void
-seahorse_key_model_class_init (SeahorseKeyModelClass *klass)
+seahorse_object_model_class_init (SeahorseObjectModelClass *klass)
 {
     GObjectClass *gobject_class;
     
-    seahorse_key_model_parent_class = g_type_class_peek_parent (klass);
+    seahorse_object_model_parent_class = g_type_class_peek_parent (klass);
     gobject_class = G_OBJECT_CLASS (klass);
     
-    gobject_class->dispose = seahorse_key_model_dispose;
-    gobject_class->finalize = seahorse_key_model_finalize;
-    gobject_class->set_property = seahorse_key_model_set_property;
-    gobject_class->get_property = seahorse_key_model_get_property;
+    gobject_class->dispose = seahorse_object_model_dispose;
+    gobject_class->finalize = seahorse_object_model_finalize;
+    gobject_class->set_property = seahorse_object_model_set_property;
+    gobject_class->get_property = seahorse_object_model_get_property;
     
     g_object_class_install_property (gobject_class, PROP_DATA_COLUMN,
         g_param_spec_uint ("data-column", "Column data is stored", "Column where internal data is stored",
                            0, ~0, 0, G_PARAM_READWRITE | G_PARAM_READWRITE));
 
-    signals[UPDATE_ROW] = g_signal_new ("update-row", SEAHORSE_TYPE_KEY_MODEL, 
-                G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (SeahorseKeyModelClass, update_row),
-                NULL, NULL, seahorse_marshal_VOID__OBJECT_POINTER, G_TYPE_NONE, 2, SEAHORSE_TYPE_KEY, G_TYPE_POINTER);
+    signals[UPDATE_ROW] = g_signal_new ("update-row", SEAHORSE_TYPE_OBJECT_MODEL, 
+                G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (SeahorseObjectModelClass, update_row),
+                NULL, NULL, seahorse_marshal_VOID__OBJECT_POINTER, G_TYPE_NONE, 2, SEAHORSE_TYPE_OBJECT, G_TYPE_POINTER);
     
-    g_type_class_add_private (klass, sizeof (SeahorseKeyModelPrivate));
+    g_type_class_add_private (klass, sizeof (SeahorseObjectModelPrivate));
 }
 
 /* -----------------------------------------------------------------------------
@@ -260,73 +267,73 @@
  */
 
 
-SeahorseKeyModel* 
-seahorse_key_model_new (gint n_columns, GType *types)
+SeahorseObjectModel* 
+seahorse_object_model_new (gint n_columns, GType *types)
 {
-    SeahorseKeyModel *model;
+    SeahorseObjectModel *model;
     
-    model = g_object_new (SEAHORSE_TYPE_KEY_MODEL, NULL);
-    seahorse_key_model_set_column_types (model, n_columns, types);
+    model = g_object_new (SEAHORSE_TYPE_OBJECT_MODEL, NULL);
+    seahorse_object_model_set_column_types (model, n_columns, types);
     
     return model;
 }
 
 void
-seahorse_key_model_set_column_types (SeahorseKeyModel *skmodel, gint n_columns,
+seahorse_object_model_set_column_types (SeahorseObjectModel *self, gint n_columns,
                                      GType *types)
 {
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
     GType *itypes;
     
-    g_return_if_fail (SEAHORSE_IS_KEY_MODEL (skmodel));
+    g_return_if_fail (SEAHORSE_IS_OBJECT_MODEL (self));
 
     itypes = g_new0(GType, n_columns + 1);
     memcpy (itypes, types, n_columns * sizeof (GType));
 
     itypes[n_columns] = G_TYPE_POINTER;
     pv->data_column = n_columns;
-    gtk_tree_store_set_column_types (GTK_TREE_STORE (skmodel), n_columns + 1, itypes);
+    gtk_tree_store_set_column_types (GTK_TREE_STORE (self), n_columns + 1, itypes);
     
     g_free (itypes);
 }
 
 void
-seahorse_key_model_set_row_key (SeahorseKeyModel *skmodel, GtkTreeIter *iter,
-                                SeahorseKey *skey)
+seahorse_object_model_set_row_object (SeahorseObjectModel *self, GtkTreeIter *iter,
+                                      SeahorseObject *object)
 {
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
-    SeahorseKeyRow *skrow;
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
+    SeahorseObjectRow *skrow;
     GtkTreePath *path;
     GtkTreePath *ipath;
     int i;
     
-    g_return_if_fail (SEAHORSE_IS_KEY_MODEL (skmodel));
-    g_return_if_fail (SEAHORSE_IS_KEY (skey) || skey == NULL);
+    g_return_if_fail (SEAHORSE_IS_OBJECT_MODEL (self));
+    g_return_if_fail (SEAHORSE_IS_OBJECT (object) || object == NULL);
     g_return_if_fail (pv->data_column >= 0);
     
     /* Add the row/key association */
-    if (skey) {
+    if (object) {
         
         /* Do we already have a row for this key? */
-        skrow = (SeahorseKeyRow*)g_hash_table_lookup (pv->rows, skey);
+        skrow = (SeahorseObjectRow*)g_hash_table_lookup (pv->rows, object);
         if (!skrow) {
-            skrow = key_row_new (skmodel, skey);
+            skrow = key_row_new (self, object);
 
             /* Put it in our row cache */
-            g_hash_table_replace (pv->rows, skey, skrow);
+            g_hash_table_replace (pv->rows, object, skrow);
         }
         
-        path = gtk_tree_model_get_path (GTK_TREE_MODEL (skmodel), iter);
-        g_ptr_array_add (skrow->refs, gtk_tree_row_reference_new (GTK_TREE_MODEL (skmodel), path));
+        path = gtk_tree_model_get_path (GTK_TREE_MODEL (self), iter);
+        g_ptr_array_add (skrow->refs, gtk_tree_row_reference_new (GTK_TREE_MODEL (self), path));
         gtk_tree_path_free (path);
         
     /* Remove the row/key association */
     } else {
         
-        gtk_tree_model_get (GTK_TREE_MODEL (skmodel), iter, pv->data_column, &skrow, -1);
+        gtk_tree_model_get (GTK_TREE_MODEL (self), iter, pv->data_column, &skrow, -1);
         if (skrow) {
             
-            ipath = gtk_tree_model_get_path (GTK_TREE_MODEL (skmodel), iter);
+            ipath = gtk_tree_model_get_path (GTK_TREE_MODEL (self), iter);
             g_return_if_fail (ipath != NULL);
             
             for (i = 0; i < skrow->refs->len; i++) {
@@ -346,47 +353,47 @@
             
             /* If we no longer have rows associated with this key, then remove */
             if (skrow->refs->len == 0)
-                g_hash_table_remove (pv->rows, skrow->skey);
+                g_hash_table_remove (pv->rows, skrow->object);
         }
     }
     
-    gtk_tree_store_set (GTK_TREE_STORE (skmodel), iter, 
-                        pv->data_column, skey ? skrow : NULL, -1);
+    gtk_tree_store_set (GTK_TREE_STORE (self), iter, 
+                        pv->data_column, object ? skrow : NULL, -1);
     
-    if (skey)
-        key_changed (skey, 0, skmodel);
+    if (object)
+        key_notify (object, self);
 }
 
-SeahorseKey*
-seahorse_key_model_get_row_key (SeahorseKeyModel *skmodel, GtkTreeIter *iter)
+SeahorseObject*
+seahorse_object_model_get_row_key (SeahorseObjectModel *self, GtkTreeIter *iter)
 {
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
-    SeahorseKeyRow *skrow;
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
+    SeahorseObjectRow *skrow;
     
-    g_return_val_if_fail (SEAHORSE_IS_KEY_MODEL (skmodel), NULL);
+    g_return_val_if_fail (SEAHORSE_IS_OBJECT_MODEL (self), NULL);
     g_return_val_if_fail (pv->data_column >= 0, NULL);
     
-    gtk_tree_model_get (GTK_TREE_MODEL (skmodel), iter, pv->data_column, &skrow, -1);
+    gtk_tree_model_get (GTK_TREE_MODEL (self), iter, pv->data_column, &skrow, -1);
     if (!skrow)
         return NULL;
-    g_assert (SEAHORSE_IS_KEY (skrow->skey));
-    return skrow->skey;
+    g_assert (SEAHORSE_IS_OBJECT (skrow->object));
+    return skrow->object;
 }
 
 void
-seahorse_key_model_remove_rows_for_key (SeahorseKeyModel *skmodel, SeahorseKey *skey)
+seahorse_object_model_remove_rows_for_object (SeahorseObjectModel *self, SeahorseObject *object)
 {
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
-    SeahorseKeyRow *skrow;
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
+    SeahorseObjectRow *skrow;
     GtkTreeIter iter;
     GtkTreePath *path;
     int i;
     
-    g_return_if_fail (SEAHORSE_IS_KEY_MODEL (skmodel));
-    g_return_if_fail (SEAHORSE_IS_KEY (skey));
+    g_return_if_fail (SEAHORSE_IS_OBJECT_MODEL (self));
+    g_return_if_fail (SEAHORSE_IS_OBJECT (object));
     g_return_if_fail (pv->data_column >= 0);
     
-    skrow = (SeahorseKeyRow*)g_hash_table_lookup (pv->rows, skey);
+    skrow = (SeahorseObjectRow*)g_hash_table_lookup (pv->rows, object);
     if (!skrow) 
         return;
     
@@ -394,30 +401,30 @@
         
         path = gtk_tree_row_reference_get_path (g_ptr_array_index (skrow->refs, i));
         if (path) {
-            gtk_tree_model_get_iter (GTK_TREE_MODEL (skmodel), &iter, path);
-            gtk_tree_store_remove (GTK_TREE_STORE (skmodel), &iter);
+            gtk_tree_model_get_iter (GTK_TREE_MODEL (self), &iter, path);
+            gtk_tree_store_remove (GTK_TREE_STORE (self), &iter);
             gtk_tree_path_free (path);
         }
     }
     
     /* We no longer have rows associated with this key, then remove */
-    g_hash_table_remove (pv->rows, skey);
+    g_hash_table_remove (pv->rows, object);
 }
 
 GSList*
-seahorse_key_model_get_rows_for_key (SeahorseKeyModel *skmodel, SeahorseKey *skey)
+seahorse_object_model_get_rows_for_object (SeahorseObjectModel *self, SeahorseObject *object)
 {
-    SeahorseKeyModelPrivate *pv = SEAHORSE_KEY_MODEL_GET_PRIVATE (skmodel);
+    SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
     GSList *rows = NULL;
-    SeahorseKeyRow *skrow;
+    SeahorseObjectRow *skrow;
     GtkTreeIter *iter;
     GtkTreePath *path;
     int i;
     
-    g_return_val_if_fail (SEAHORSE_IS_KEY_MODEL (skmodel), NULL);
-    g_return_val_if_fail (SEAHORSE_IS_KEY (skey), NULL);
+    g_return_val_if_fail (SEAHORSE_IS_OBJECT_MODEL (self), NULL);
+    g_return_val_if_fail (SEAHORSE_IS_OBJECT (object), NULL);
     
-    skrow = (SeahorseKeyRow*)g_hash_table_lookup (pv->rows, skey);
+    skrow = (SeahorseObjectRow*)g_hash_table_lookup (pv->rows, object);
     if (!skrow) 
         return NULL;
     
@@ -426,7 +433,7 @@
         path = gtk_tree_row_reference_get_path (g_ptr_array_index (skrow->refs, i));
         if (path) {
             iter = g_new0(GtkTreeIter, 1);
-            gtk_tree_model_get_iter (GTK_TREE_MODEL (skmodel), iter, path);
+            gtk_tree_model_get_iter (GTK_TREE_MODEL (self), iter, path);
             rows = g_slist_prepend (rows, iter);
             gtk_tree_path_free (path);
         }
@@ -436,7 +443,7 @@
 }
 
 void
-seahorse_key_model_free_rows (GSList *rows)
+seahorse_object_model_free_rows (GSList *rows)
 {
     GSList *l;
     for (l = rows; l; l = g_slist_next (l))

Copied: trunk/libseahorse/seahorse-object-model.h (from r2632, /trunk/libseahorse/seahorse-key-model.h)
==============================================================================
--- /trunk/libseahorse/seahorse-key-model.h	(original)
+++ trunk/libseahorse/seahorse-object-model.h	Sat Nov 29 17:37:20 2008
@@ -20,64 +20,65 @@
  */
 
 /**
- * SeahorseKeyModel: A GtkTreeModel that can assign certain rows as 
+ * SeahorseObjectModel: A GtkTreeModel that can assign certain rows as 
  *   'key rows' which are updated when a key is updated. 
  *
  * Signals:
  *   update-row: A request to update a row 
  */
  
-#ifndef __SEAHORSE_KEY_MODEL_H__
-#define __SEAHORSE_KEY_MODEL_H__
+#ifndef __SEAHORSE_OBJECT_MODEL_H__
+#define __SEAHORSE_OBJECT_MODEL_H__
 
 #include <gtk/gtk.h>
-#include "seahorse-key.h"
 
-#define SEAHORSE_TYPE_KEY_MODEL               (seahorse_key_model_get_type ())
-#define SEAHORSE_KEY_MODEL(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_KEY_MODEL, SeahorseKeyModel))
-#define SEAHORSE_KEY_MODEL_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_KEY_MODEL, SeahorseKeyModelClass))
-#define SEAHORSE_IS_KEY_MODEL(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_KEY_MODEL))
-#define SEAHORSE_IS_KEY_MODEL_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_KEY_MODEL))
-#define SEAHORSE_KEY_MODEL_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_KEY_MODEL, SeahorseKeyModelClass))
+#include "seahorse-object.h"
 
-typedef struct _SeahorseKeyModel SeahorseKeyModel;
-typedef struct _SeahorseKeyModelClass SeahorseKeyModelClass;
+#define SEAHORSE_TYPE_OBJECT_MODEL               (seahorse_object_model_get_type ())
+#define SEAHORSE_OBJECT_MODEL(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_OBJECT_MODEL, SeahorseObjectModel))
+#define SEAHORSE_OBJECT_MODEL_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_OBJECT_MODEL, SeahorseObjectModelClass))
+#define SEAHORSE_IS_OBJECT_MODEL(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_OBJECT_MODEL))
+#define SEAHORSE_IS_OBJECT_MODEL_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_OBJECT_MODEL))
+#define SEAHORSE_OBJECT_MODEL_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_OBJECT_MODEL, SeahorseObjectModelClass))
+
+typedef struct _SeahorseObjectModel SeahorseObjectModel;
+typedef struct _SeahorseObjectModelClass SeahorseObjectModelClass;
     
-struct _SeahorseKeyModel {
+struct _SeahorseObjectModel {
     GtkTreeStore parent;
 };
 
-struct _SeahorseKeyModelClass {
+struct _SeahorseObjectModelClass {
     GtkTreeStoreClass parent_class;
     
     /* signals --------------------------------------------------------- */
     
     /* A key was added to this view */
-    void (*update_row)   (SeahorseKeyModel *skmodel, SeahorseKey *skey, GtkTreeIter *iter);
+    void (*update_row)   (SeahorseObjectModel *self, SeahorseObject *object, GtkTreeIter *iter);
 };
 
-GType               seahorse_key_model_get_type                (void);
+GType               seahorse_object_model_get_type                (void);
 
-SeahorseKeyModel*   seahorse_key_model_new                     (gint n_columns,
-                                                                GType *types);
+SeahorseObjectModel*   seahorse_object_model_new                  (gint n_columns,
+                                                                   GType *types);
 
-void                seahorse_key_model_set_column_types        (SeahorseKeyModel *skmodel, 
-                                                                gint n_columns,
-                                                                GType *types);
+void                seahorse_object_model_set_column_types        (SeahorseObjectModel *self, 
+                                                                   gint n_columns,
+                                                                   GType *types);
 
-void                seahorse_key_model_set_row_key             (SeahorseKeyModel *skmodel,
-                                                                GtkTreeIter *iter,
-                                                                SeahorseKey *skey);
+void                seahorse_object_model_set_row_object          (SeahorseObjectModel *self,
+                                                                   GtkTreeIter *iter,
+                                                                   SeahorseObject *object);
 
-SeahorseKey*        seahorse_key_model_get_row_key             (SeahorseKeyModel *skmodel,
-                                                                GtkTreeIter *iter);
+SeahorseObject*     seahorse_object_model_get_row_key             (SeahorseObjectModel *self,
+                                                                   GtkTreeIter *iter);
 
-GSList*             seahorse_key_model_get_rows_for_key        (SeahorseKeyModel *skmodel,
-                                                                SeahorseKey *skey);
+GSList*             seahorse_object_model_get_rows_for_object     (SeahorseObjectModel *self,
+                                                                   SeahorseObject *object);
 
-void                seahorse_key_model_remove_rows_for_key     (SeahorseKeyModel *skmodel,
-                                                                SeahorseKey *skey);
+void                seahorse_object_model_remove_rows_for_object  (SeahorseObjectModel *self,
+                                                                   SeahorseObject *object);
 
-void                seahorse_key_model_free_rows               (GSList *rows);
+void                seahorse_object_model_free_rows               (GSList *rows);
 
-#endif /* __SEAHORSE_KEY_SET_H__ */
+#endif /* __SEAHORSE_OBJECT_MODEL_H__ */

Copied: trunk/libseahorse/seahorse-object-widget.c (from r2632, /trunk/libseahorse/seahorse-key-widget.c)
==============================================================================
--- /trunk/libseahorse/seahorse-key-widget.c	(original)
+++ trunk/libseahorse/seahorse-object-widget.c	Sat Nov 29 17:37:20 2008
@@ -19,107 +19,105 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "seahorse-key-widget.h"
+#include "config.h"
 
-#define PROPERTIES "key-properties"
+#include "seahorse-object-widget.h"
+
+#define PROPERTIES "object-properties"
 
 enum {
 	PROP_0,
-	PROP_KEY,
-	PROP_INDEX
+	PROP_OBJECT
 };
 
-static void	seahorse_key_widget_class_init		(SeahorseKeyWidgetClass	*klass);
-static void	seahorse_key_widget_finalize		(GObject		*gobject);
-static void	seahorse_key_widget_set_property	(GObject		*object,
+static void	seahorse_object_widget_class_init	(SeahorseObjectWidgetClass	*klass);
+static void	seahorse_object_widget_finalize		(GObject		*gobject);
+static void	seahorse_object_widget_set_property	(GObject		*object,
 							 guint			prop_id,
 							 const GValue		*value,
 							 GParamSpec		*pspec);
-static void	seahorse_key_widget_get_property	(GObject		*object,
+static void	seahorse_object_widget_get_property	(GObject		*object,
 							 guint			prop_id,
 							 GValue			*value,
 							 GParamSpec		*pspec);
 /* signal functions */
-static void	seahorse_key_widget_destroyed		(GtkObject		*skey,
-							 SeahorseKeyWidget	*skwidget);
+static void	seahorse_object_widget_destroyed	(gpointer data,
+           	                                	 GObject *was);
 
 static SeahorseWidgetClass	*parent_class		= NULL;
 
-/* Hash set of widget hash sets with the keyid as the key */
+/* Hash set of widget hash sets with the object id as the object */
 static GHashTable *types = NULL;
-/* Hash set of window groups with the keyid as the key */
+
+/* Hash set of window groups with the object id as the object */
 static GHashTable *groups = NULL;
 
 GType
-seahorse_key_widget_get_type (void)
+seahorse_object_widget_get_type (void)
 {
-	static GType key_widget_type = 0;
+	static GType object_widget_type = 0;
 	
-	if (!key_widget_type) {
-		static const GTypeInfo key_widget_info =
+	if (!object_widget_type) {
+		static const GTypeInfo object_widget_info =
 		{
-			sizeof (SeahorseKeyWidgetClass),
+			sizeof (SeahorseObjectWidgetClass),
 			NULL, NULL,
-			(GClassInitFunc) seahorse_key_widget_class_init,
+			(GClassInitFunc) seahorse_object_widget_class_init,
 			NULL, NULL,
-			sizeof (SeahorseKeyWidget),
+			sizeof (SeahorseObjectWidget),
 			0, NULL
 		};
 		
-		key_widget_type = g_type_register_static (SEAHORSE_TYPE_WIDGET,
-			"SeahorseKeyWidget",  &key_widget_info, 0);
+		object_widget_type = g_type_register_static (SEAHORSE_TYPE_WIDGET,
+			"SeahorseObjectWidget",  &object_widget_info, 0);
 	}
 	
-	return key_widget_type;
+	return object_widget_type;
 }
 
 static void
-seahorse_key_widget_class_init (SeahorseKeyWidgetClass *klass)
+seahorse_object_widget_class_init (SeahorseObjectWidgetClass *klass)
 {
 	GObjectClass *gobject_class;
 	
 	parent_class = g_type_class_peek_parent (klass);
 	gobject_class = G_OBJECT_CLASS (klass);
 	
-	gobject_class->finalize = seahorse_key_widget_finalize;
-	gobject_class->set_property = seahorse_key_widget_set_property;
-	gobject_class->get_property = seahorse_key_widget_get_property;
+	gobject_class->finalize = seahorse_object_widget_finalize;
+	gobject_class->set_property = seahorse_object_widget_set_property;
+	gobject_class->get_property = seahorse_object_widget_get_property;
 	
-	g_object_class_install_property (gobject_class, PROP_KEY,
-		g_param_spec_object ("key",  "Seahorse Key",
-				     "Seahorse Key of this widget",
-				    SEAHORSE_TYPE_KEY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-	g_object_class_install_property (gobject_class, PROP_INDEX,
-		g_param_spec_uint ("index", "Attribute index",
-				   "Index of attribute in key, 0 being none",
-				   0, G_MAXUINT, 0, G_PARAM_READWRITE));
+	g_object_class_install_property (gobject_class, PROP_OBJECT,
+		g_param_spec_object ("object",  "Seahorse Object",
+				     "Seahorse Object of this widget",
+				     SEAHORSE_TYPE_OBJECT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 }
 
 static void
-seahorse_key_widget_finalize (GObject *gobject)
+seahorse_object_widget_finalize (GObject *gobject)
 {
     SeahorseWidget *swidget;
-    SeahorseKeyWidget *skwidget;
+    SeahorseObjectWidget *self;
     GHashTable *widgets = NULL;
     GtkWindowGroup *group = NULL;
-    GQuark keyid;
+    GQuark id;
     GtkWidget *widget;
     
-    skwidget = SEAHORSE_KEY_WIDGET (gobject);
-    swidget = SEAHORSE_WIDGET (skwidget);
+    self = SEAHORSE_OBJECT_WIDGET (gobject);
+    swidget = SEAHORSE_WIDGET (self);
     
-    g_return_if_fail (SEAHORSE_IS_KEY (skwidget->skey));
-    keyid = seahorse_key_get_keyid (skwidget->skey);
+    g_return_if_fail (SEAHORSE_IS_OBJECT (self->object));
+    id = seahorse_object_get_id (self->object);
     
     /* get widgets hash from types */
-    widgets = g_hash_table_lookup (types, GUINT_TO_POINTER (keyid));
+    widgets = g_hash_table_lookup (types, GUINT_TO_POINTER (id));
     /* if have a widgets hash, remove the widget */
     if (widgets != NULL) {
         g_hash_table_remove (widgets, swidget->name);
         /* if there are no more widgets, remove the hash */
         if (g_hash_table_size (widgets) == 0) {
-            g_hash_table_remove (types, GUINT_TO_POINTER (keyid));
-            /* if there are no more keys, destroy types */
+            g_hash_table_remove (types, GUINT_TO_POINTER (id));
+            /* if there are no more objects, destroy types */
             if (g_hash_table_size (types) == 0) {
                 g_hash_table_destroy (types);
                 types = NULL;
@@ -128,7 +126,7 @@
     }
     
     /* get group from groups */
-    group = g_hash_table_lookup (groups, GUINT_TO_POINTER (keyid));
+    group = g_hash_table_lookup (groups, GUINT_TO_POINTER (id));
     /* if have a group, remove grab & window */
     if (group != NULL) {
         widget = glade_xml_get_widget (swidget->xml, swidget->name);
@@ -136,34 +134,31 @@
         gtk_window_group_remove_window (group, GTK_WINDOW (widget));
     }
     
-    g_signal_handlers_disconnect_by_func (skwidget->skey, seahorse_key_widget_destroyed, skwidget);
+    if (self->object)
+	    g_object_weak_unref (G_OBJECT (self->object), seahorse_object_widget_destroyed, self); 
+    self->object = NULL;
 
     G_OBJECT_CLASS (parent_class)->finalize (gobject);
-    
-    g_object_unref (skwidget->skey);
-    skwidget->skey = NULL;
 }
 
 static void
-seahorse_key_widget_set_property (GObject *object, guint prop_id,
+seahorse_object_widget_set_property (GObject *object, guint prop_id,
 				  const GValue *value, GParamSpec *pspec)
 {
-	SeahorseKeyWidget *skwidget;
+	SeahorseObjectWidget *self;
 	SeahorseWidget *swidget;
 	
-	skwidget = SEAHORSE_KEY_WIDGET (object);
+	self = SEAHORSE_OBJECT_WIDGET (object);
 	swidget = SEAHORSE_WIDGET (object);
 	
 	switch (prop_id) {
-		/* Refs key and connects to 'destroy' signal */
-		case PROP_KEY:
-			skwidget->skey = g_value_get_object (value);
-			g_object_ref (skwidget->skey);
-			g_signal_connect_after (skwidget->skey, "destroy",
-				G_CALLBACK (seahorse_key_widget_destroyed), skwidget);
-			break;
-		case PROP_INDEX:
-			skwidget->index = g_value_get_uint (value);
+		/* Watches object for destroy */
+		case PROP_OBJECT:
+			if (self->object)
+				g_object_weak_unref (G_OBJECT (self->object), seahorse_object_widget_destroyed, self);
+			self->object = g_value_get_object (value);
+			if (self->object)
+				g_object_weak_ref (G_OBJECT (self->object), seahorse_object_widget_destroyed, self);
 			break;
 		default:
 			break;
@@ -171,74 +166,74 @@
 }
 
 static void
-seahorse_key_widget_get_property (GObject *object, guint prop_id,
+seahorse_object_widget_get_property (GObject *object, guint prop_id,
 				  GValue *value, GParamSpec *pspec)
 {
-	SeahorseKeyWidget *skwidget;
+	SeahorseObjectWidget *self;
 	
-	skwidget = SEAHORSE_KEY_WIDGET (object);
+	self = SEAHORSE_OBJECT_WIDGET (object);
 	
 	switch (prop_id) {
-		case PROP_KEY:
-			g_value_set_object (value, skwidget->skey);
+		case PROP_OBJECT:
+			g_value_set_object (value, self->object);
 			break;
-		case PROP_INDEX:
-			g_value_set_uint (value, skwidget->index);
 		default:
 			break;
 	}
 }
 
-/* Called when skey is destroyed */
+/* Called when object is destroyed */
 static void
-seahorse_key_widget_destroyed (GtkObject *skey, SeahorseKeyWidget *skwidget)
+seahorse_object_widget_destroyed (gpointer data, GObject *object)
 {
-	seahorse_widget_destroy (SEAHORSE_WIDGET (skwidget));
+	SeahorseObjectWidget *self =  SEAHORSE_OBJECT_WIDGET (data);
+	self->object = NULL;
+	seahorse_widget_destroy (SEAHORSE_WIDGET (self));
 }
 
-/* Tries to create a new key widget given parameters.
+/* Tries to create a new object widget given parameters.
  * Makes use of hash sets to control which widgets can be created and how
  * the focus is grabbed.
  */
 static SeahorseWidget*
-seahorse_key_widget_create (gchar *name, GtkWindow *parent, SeahorseKey *skey, guint index)
+seahorse_object_widget_create (gchar *name, GtkWindow *parent, SeahorseObject *object)
 {
     SeahorseWidget *swidget = NULL;     // widget to lookup or create
     GHashTable *widgets = NULL;         // hash of widgets from types
-    GQuark keyid;                       // hash key
+    GQuark id;                          // hash key
     GtkWindowGroup *group = NULL;       // window group from groups
     GtkWidget *widget;                  // main window widget of swidget
     
-    keyid = seahorse_key_get_keyid (skey);
+    id = seahorse_object_get_id (object);
     
     /* if don't have a types hash, create one */
     if (types == NULL)
         types = g_hash_table_new_full (g_direct_hash, g_direct_equal,
                                        NULL, (GDestroyNotify)g_hash_table_destroy);
     
-    /* otherwise lookup the widgets hash for the key */
+    /* otherwise lookup the widgets hash for the object */
     else
-        widgets = g_hash_table_lookup (types, GUINT_TO_POINTER (keyid));
+        widgets = g_hash_table_lookup (types, GUINT_TO_POINTER (id));
     
-    /* if don't have a widgets hash for a key, create one and insert it */
+    /* if don't have a widgets hash for a object, create one and insert it */
     if (widgets == NULL) {
         widgets = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
-        g_hash_table_insert (types, GUINT_TO_POINTER (keyid), widgets);
+        g_hash_table_insert (types, GUINT_TO_POINTER (id), widgets);
         
     /* otherwise lookup the widget */
     } else {
         swidget = g_hash_table_lookup (widgets, name);
     }
     
-    /* if already have a widget of that type for the key, return null */
+    /* if already have a widget of that type for the object, return null */
     if (swidget != NULL) {
         gtk_window_present (GTK_WINDOW (seahorse_widget_get_toplevel (swidget)));
         return NULL;
     }
     
-    /* otherwise create a new widget & insert into widgets hash for the key */
-    swidget = g_object_new (SEAHORSE_TYPE_KEY_WIDGET, "name", name,
-                            "key", skey, "index", index, NULL);
+    /* otherwise create a new widget & insert into widgets hash for the object */
+    swidget = g_object_new (SEAHORSE_TYPE_OBJECT_WIDGET, "name", name,
+                            "object", object, NULL);
     g_hash_table_insert (widgets, g_strdup (name), swidget);
     
     /* if don't have a groups hash, create one */
@@ -246,14 +241,14 @@
         groups = g_hash_table_new_full (g_direct_hash, g_direct_equal,
                                         NULL, g_object_unref);
     
-    /* otherwise lookup the group for that key */
+    /* otherwise lookup the group for that object */
     else
-        group = g_hash_table_lookup (groups, GUINT_TO_POINTER (keyid));
+        group = g_hash_table_lookup (groups, GUINT_TO_POINTER (id));
     
-    /* if don't have a group for the key, create one and insert it */
+    /* if don't have a group for the object, create one and insert it */
     if (group == NULL) {
         group = gtk_window_group_new ();
-        g_hash_table_insert (groups, GUINT_TO_POINTER (keyid), group);
+        g_hash_table_insert (groups, GUINT_TO_POINTER (id), group);
     }
     
     /* get window, add it to the group, grab it, return it */
@@ -268,11 +263,11 @@
 }
 
 SeahorseWidget*
-seahorse_key_widget_new (gchar *name, GtkWindow *parent, SeahorseKey *skey)
+seahorse_object_widget_new (gchar *name, GtkWindow *parent, SeahorseObject *object)
 {
     SeahorseWidget *swidget;
     
-    swidget = seahorse_key_widget_create (name, parent, skey, 0);
+    swidget = seahorse_object_widget_create (name, parent, object);
     
     /* We don't care about this floating business */
     g_object_ref (GTK_OBJECT (swidget));
@@ -280,33 +275,3 @@
 
     return swidget;
 }
-
-SeahorseWidget*
-seahorse_key_widget_new_with_index (gchar *name, GtkWindow *parent, SeahorseKey *skey, guint index)
-{
-    SeahorseWidget *swidget;
-    
-    swidget = seahorse_key_widget_create (name, parent, skey, index);
-    
-    /* We don't care about this floating business */
-    g_object_ref (GTK_OBJECT (swidget));
-    gtk_object_sink (GTK_OBJECT (swidget));
-
-    return swidget;
-}
-
-gboolean
-seahorse_key_widget_can_create (gchar *name, SeahorseKey *skey)
-{
-    GHashTable *widgets = NULL;
-    
-    if (types == NULL)
-        return TRUE;
-    
-    widgets = g_hash_table_lookup (types, GUINT_TO_POINTER (seahorse_key_get_keyid (skey)));
-    
-    if (widgets == NULL)
-        return TRUE;
-    
-    return (g_hash_table_lookup (widgets, name) == NULL);
-}

Copied: trunk/libseahorse/seahorse-object-widget.h (from r2632, /trunk/libseahorse/seahorse-key-widget.h)
==============================================================================
--- /trunk/libseahorse/seahorse-key-widget.h	(original)
+++ trunk/libseahorse/seahorse-object-widget.h	Sat Nov 29 17:37:20 2008
@@ -19,47 +19,37 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifndef __SEAHORSE_KEY_WIDGET_H__
-#define __SEAHORSE_KEY_WIDGET_H__
+#ifndef __SEAHORSE_OBJECT_WIDGET_H__
+#define __SEAHORSE_OBJECT_WIDGET_H__
 
 #include <glib.h>
 
+#include "seahorse-object.h"
 #include "seahorse-widget.h"
-#include "seahorse-key.h"
 
-#define SEAHORSE_TYPE_KEY_WIDGET		(seahorse_key_widget_get_type ())
-#define SEAHORSE_KEY_WIDGET(obj)		(GTK_CHECK_CAST ((obj), SEAHORSE_TYPE_KEY_WIDGET, SeahorseKeyWidget))
-#define SEAHORSE_KEY_WIDGET_CLASS(klass)	(GTK_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_KEY_WIDGET, SeahorseKeyWidgetClass))
-#define SEAHORSE_IS_KEY_WIDGET(obj)		(GTK_CHECK_TYPE ((obj), SEAHORSE_TYPE_KEY_WIDGET))
-#define SEAHORSE_IS_KEY_WIDGET_CLASS(klass)	(GTK_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_KEY_WIDGET))
-#define SEAHORSE_KEY_WIDGET_GET_CLASS(obj)	(GTK_CHECK_GET_CLASS ((obj), SEAHORSE_TYPE_KEY_WIDGET, SeahorseKeyWidgetClass))
+#define SEAHORSE_TYPE_OBJECT_WIDGET		(seahorse_object_widget_get_type ())
+#define SEAHORSE_OBJECT_WIDGET(obj)		(GTK_CHECK_CAST ((obj), SEAHORSE_TYPE_OBJECT_WIDGET, SeahorseObjectWidget))
+#define SEAHORSE_OBJECT_WIDGET_CLASS(klass)	(GTK_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_OBJECT_WIDGET, SeahorseObjectWidgetClass))
+#define SEAHORSE_IS_OBJECT_WIDGET(obj)		(GTK_CHECK_TYPE ((obj), SEAHORSE_TYPE_OBJECT_WIDGET))
+#define SEAHORSE_IS_OBJECT_WIDGET_CLASS(klass)	(GTK_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_OBJECT_WIDGET))
+#define SEAHORSE_OBJECT_WIDGET_GET_CLASS(obj)	(GTK_CHECK_GET_CLASS ((obj), SEAHORSE_TYPE_OBJECT_WIDGET, SeahorseObjectWidgetClass))
 
-typedef struct _SeahorseKeyWidget SeahorseKeyWidget;
-typedef struct _SeahorseKeyWidgetClass SeahorseKeyWidgetClass;
+typedef struct _SeahorseObjectWidget SeahorseObjectWidget;
+typedef struct _SeahorseObjectWidgetClass SeahorseObjectWidgetClass;
 	
-struct _SeahorseKeyWidget {
+struct _SeahorseObjectWidget {
 	SeahorseWidget		parent;
-	
-	SeahorseKey		*skey;
-	guint			index;
+	SeahorseObject		*object;
 };
 
-struct _SeahorseKeyWidgetClass {
+struct _SeahorseObjectWidgetClass {
 	SeahorseWidgetClass	parent_class;
 };
 
-GType           seahorse_key_widget_get_type    (void);
+GType           seahorse_object_widget_get_type    (void);
 
-SeahorseWidget*	seahorse_key_widget_new         (gchar              *name,
-                                                 GtkWindow          *parent,
-                                                 SeahorseKey        *skey);
-
-SeahorseWidget*	seahorse_key_widget_new_with_index	(gchar          *name,
-                                                     GtkWindow          *parent,
-                                                     SeahorseKey        *skey,
-                                                     guint              index);
+SeahorseWidget*	seahorse_object_widget_new         (gchar              *name,
+                                                    GtkWindow          *parent,
+                                                    SeahorseObject     *object);
 
-gboolean        seahorse_key_widget_can_create  (gchar              *name,
-                                                 SeahorseKey        *skey);
-	
-#endif /* __SEAHORSE_KEY_WIDGET_H__ */
+#endif /* __SEAHORSE_OBJECT_WIDGET_H__ */

Modified: trunk/libseahorse/seahorse-object.c
==============================================================================
--- trunk/libseahorse/seahorse-object.c	(original)
+++ trunk/libseahorse/seahorse-object.c	Sat Nov 29 17:37:20 2008
@@ -1,396 +1,753 @@
-
-#include <seahorse-object.h>
-
-
-
+/* 
+ * Seahorse
+ * 
+ * Copyright (C) 2008 Stefan Walter
+ * 
+ * This program is free software; you can redistribute it and/or modify 
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *  
+ * This program 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
+ * Lesser General Public License for more details.
+ *  
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.  
+ */
+
+#include "config.h"
+
+#include "seahorse-object.h"
+
+#include "seahorse-context.h"
+#include "seahorse-source.h"
+
+#include "string.h"
+
+#include <glib/gi18n.h>
+
+enum {
+	PROP_0,
+	PROP_CONTEXT,
+	PROP_SOURCE,
+	PROP_PREFERRED,
+	PROP_PARENT,
+	PROP_ID,
+	PROP_TAG,
+	PROP_LABEL,
+	PROP_MARKUP,
+	PROP_NICKNAME,
+	PROP_DESCRIPTION,
+	PROP_ICON,
+	PROP_IDENTIFIER,
+	PROP_LOCATION,
+	PROP_USAGE,
+	PROP_FLAGS
+};
 
 struct _SeahorseObjectPrivate {
-	SeahorseSource* _source;
-	SeahorseObject* _preferred;
-	SeahorseObject* _parent;
-	GList* _children;
-};
+	GQuark id;
+	GQuark tag;
 
-#define SEAHORSE_OBJECT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SEAHORSE_TYPE_OBJECT, SeahorseObjectPrivate))
-enum  {
-	SEAHORSE_OBJECT_DUMMY_PROPERTY,
-	SEAHORSE_OBJECT_TAG,
-	SEAHORSE_OBJECT_ID,
-	SEAHORSE_OBJECT_LOCATION,
-	SEAHORSE_OBJECT_USAGE,
-	SEAHORSE_OBJECT_FLAGS,
-	SEAHORSE_OBJECT_SOURCE,
-	SEAHORSE_OBJECT_PREFERRED,
-	SEAHORSE_OBJECT_DISPLAY_NAME,
-	SEAHORSE_OBJECT_MARKUP,
-	SEAHORSE_OBJECT_STOCK_ID,
-	SEAHORSE_OBJECT_PARENT
+	SeahorseSource *source;
+	SeahorseContext *context;
+	SeahorseObject *preferred;
+	SeahorseObject *parent;
+	GList *children;
+	
+	gchar *label;
+	gchar *markup;
+	gboolean markup_explicit;
+	gchar *nickname;
+	gboolean nickname_explicit;
+	gchar *description;
+	gboolean description_explicit;
+	gchar *icon;
+	gchar *identifier;
+	gboolean identifier_explicit;
+	
+	SeahorseLocation location;
+	SeahorseUsage usage;
+	guint flags;
 };
-static void seahorse_object_register_child (SeahorseObject* self, SeahorseObject* child);
-static void seahorse_object_unregister_child (SeahorseObject* self, SeahorseObject* child);
-static GObject * seahorse_object_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
-static gpointer seahorse_object_parent_class = NULL;
-static void seahorse_object_finalize (GObject * obj);
 
+G_DEFINE_TYPE (SeahorseObject, seahorse_object, G_TYPE_OBJECT);
 
-
-
-GType seahorse_object_change_get_type (void) {
-	static GType seahorse_object_change_type_id = 0;
-	if (G_UNLIKELY (seahorse_object_change_type_id == 0)) {
-		static const GEnumValue values[] = {{SEAHORSE_OBJECT_CHANGE_ALL, "SEAHORSE_OBJECT_CHANGE_ALL", "all"}, {SEAHORSE_OBJECT_CHANGE_LOCATION, "SEAHORSE_OBJECT_CHANGE_LOCATION", "location"}, {SEAHORSE_OBJECT_CHANGE_PREFERRED, "SEAHORSE_OBJECT_CHANGE_PREFERRED", "preferred"}, {SEAHORSE_OBJECT_CHANGE_MAX, "SEAHORSE_OBJECT_CHANGE_MAX", "max"}, {0, NULL, NULL}};
-		seahorse_object_change_type_id = g_enum_register_static ("SeahorseObjectChange", values);
+/* -----------------------------------------------------------------------------
+ * INTERNAL 
+ */
+
+static void 
+register_child (SeahorseObject* self, SeahorseObject* child) 
+{
+	g_assert (SEAHORSE_IS_OBJECT (self));
+	g_assert (SEAHORSE_IS_OBJECT (child));
+	g_assert (self != child);
+	g_assert (child->pv->parent == NULL);
+	
+	child->pv->parent = self;
+	self->pv->children = g_list_append (self->pv->children, child);
+}
+
+static void 
+unregister_child (SeahorseObject* self, SeahorseObject* child) 
+{
+	g_assert (SEAHORSE_IS_OBJECT (self));
+	g_assert (SEAHORSE_IS_OBJECT (child));
+	g_assert (self != child);
+	g_assert (child->pv->parent == self);
+	
+	child->pv->parent = NULL;
+	self->pv->children = g_list_remove (self->pv->children, child);
+}
+
+static void
+recalculate_id (SeahorseObject *self)
+{
+	const gchar *str;
+	const gchar *at;
+	gchar *result;
+	gsize len;
+
+	/* No id, clear any tag and auto generated identifer */
+	if (!self->pv->id) {
+		self->pv->tag = 0; 
+		if (!self->pv->identifier_explicit) {
+			g_free (self->pv->identifier);
+			self->pv->identifier = g_strdup ("");
+		}
+		
+	/* Have hande, configure tag and auto generated identifer */
+	} else {
+		str = g_quark_to_string (self->pv->id);
+		len = strlen (str);
+		at = strchr (str, ':');
+		
+		result = g_strndup (str, at ? at - str : len);
+		self->pv->tag = g_quark_from_string (result);
+		g_free (result);
+		
+		if (!self->pv->identifier_explicit) {
+			g_free (self->pv->identifier);
+			self->pv->identifier = g_strdup (at ? at + 1 : "");
+		}
 	}
-	return seahorse_object_change_type_id;
 }
 
-
-GList* seahorse_object_get_children (SeahorseObject* self) {
-	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
-	return g_list_copy (self->priv->_children);
+static void
+recalculate_label (SeahorseObject *self)
+{
+	if (!self->pv->markup_explicit) {
+		g_free (self->pv->markup);
+		self->pv->markup = g_markup_escape_text (self->pv->label ? self->pv->label : "", -1);
+	}
+
+	if (!self->pv->nickname_explicit) {
+		g_free (self->pv->nickname);
+		self->pv->nickname = g_strdup (self->pv->label);
+	}
 }
 
-
-void seahorse_object_fire_changed (SeahorseObject* self, SeahorseObjectChange what) {
-	g_return_if_fail (SEAHORSE_IS_OBJECT (self));
-	g_signal_emit_by_name (G_OBJECT (self), "changed", what);
+static void
+recalculate_usage (SeahorseObject *self)
+{
+	const gchar *desc;
+	
+	if (!self->pv->description_explicit) {
+		g_free (self->pv->description);
+		
+		switch (self->pv->usage) {
+		case SEAHORSE_USAGE_SYMMETRIC_KEY:
+			desc = _("Symmetric Key");
+			break;
+		case SEAHORSE_USAGE_PUBLIC_KEY:
+			desc = _("Public Key");
+			break;
+		case SEAHORSE_USAGE_PRIVATE_KEY:
+			desc = _("Private Key");
+			break;
+		case SEAHORSE_USAGE_CREDENTIALS:
+			desc = _("Credentials");
+			break;
+		case SEAHORSE_USAGE_IDENTITY:
+			desc = _("Identity");
+			break;
+		default:
+			desc = "";
+			break;
+		}
+		
+		self->pv->description = g_strdup (desc); 
+	}
 }
 
 
-static void seahorse_object_register_child (SeahorseObject* self, SeahorseObject* child) {
-	g_return_if_fail (SEAHORSE_IS_OBJECT (self));
-	g_return_if_fail (SEAHORSE_IS_OBJECT (child));
-	g_assert (child->priv->_parent == NULL);
-	child->priv->_parent = self;
-	self->priv->_children = g_list_append (self->priv->_children, child);
-}
-
+/* -----------------------------------------------------------------------------
+ * OBJECT 
+ */
+
+static void
+seahorse_object_init (SeahorseObject *self)
+{
+	self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, SEAHORSE_TYPE_OBJECT, 
+	                                        SeahorseObjectPrivate);
+	self->pv->label = g_strdup ("");
+	self->pv->markup = g_strdup ("");
+	self->pv->description = g_strdup ("");
+	self->pv->icon = g_strdup ("gtk-missing-image");
+	self->pv->identifier = g_strdup ("");
+	self->pv->location = SEAHORSE_LOCATION_LOCAL;
+}
+
+static void
+seahorse_object_dispose (GObject *obj)
+{
+	SeahorseObject *self = SEAHORSE_OBJECT (obj);
+	SeahorseObject *parent;
+	GList *l;
+	
+	if (self->pv->context != NULL) {
+		seahorse_context_remove_object (self->pv->context, self);
+		g_assert (self->pv->context == NULL);
+	}
+	
+	if (self->pv->source != NULL) {
+		g_object_remove_weak_pointer (G_OBJECT (self->pv->source), (gpointer*)&self->pv->source);
+		self->pv->source = NULL;
+	}
+	
+	if (self->pv->preferred != NULL) {
+		g_object_remove_weak_pointer (G_OBJECT (self->pv->source), (gpointer*)&self->pv->preferred);
+		self->pv->preferred = NULL;
+	}
+
+	/* 
+	 * When an object is destroyed, we reparent all
+	 * children to this objects parent. If no parent
+	 * of this object, all children become root objects.
+	 */
+
+	parent = self->pv->parent;
+	if (parent)
+		g_object_ref (parent);
+	
+	for (l = self->pv->children; l; l = g_list_next (l)) {
+		g_return_if_fail (SEAHORSE_IS_OBJECT (l->data));
+		seahorse_object_set_parent (l->data, parent);
+	}
+
+	if (parent)
+		g_object_unref (parent);
+	
+	g_assert (self->pv->children == NULL);
+	
+	/* Now remove this object from its parent */
+	seahorse_object_set_parent (self, NULL);
+	
+	G_OBJECT_CLASS (seahorse_object_parent_class)->dispose (obj);	
+}
+
+static void
+seahorse_object_finalize (GObject *obj)
+{
+	SeahorseObject *self = SEAHORSE_OBJECT (obj);
+	
+	g_assert (self->pv->source == NULL);
+	g_assert (self->pv->preferred == NULL);
+	g_assert (self->pv->parent == NULL);
+	g_assert (self->pv->context == NULL);
+	g_assert (self->pv->children == NULL);
+	
+	g_free (self->pv->label);
+	self->pv->label = NULL;
+	
+	g_free (self->pv->markup);
+	self->pv->markup = NULL;
+	
+	g_free (self->pv->nickname);
+	self->pv->nickname = NULL;
+	
+	g_free (self->pv->description);
+	self->pv->description = NULL;
+	
+	g_free (self->pv->icon);
+	self->pv->icon = NULL;
+	
+	g_free (self->pv->identifier);
+	self->pv->identifier = NULL;
 
-static void seahorse_object_unregister_child (SeahorseObject* self, SeahorseObject* child) {
-	g_return_if_fail (SEAHORSE_IS_OBJECT (self));
-	g_return_if_fail (SEAHORSE_IS_OBJECT (child));
-	g_assert (child->priv->_parent == self);
-	child->priv->_parent = NULL;
-	self->priv->_children = g_list_remove (self->priv->_children, child);
+	G_OBJECT_CLASS (seahorse_object_parent_class)->finalize (obj);
 }
 
-
-GQuark seahorse_object_get_tag (SeahorseObject* self) {
-	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), 0U);
-	return self->_tag;
+static void
+seahorse_object_get_property (GObject *obj, guint prop_id, GValue *value, 
+                           GParamSpec *pspec)
+{
+	SeahorseObject *self = SEAHORSE_OBJECT (obj);
+	
+	switch (prop_id) {
+	case PROP_CONTEXT:
+		g_value_set_object (value, self->pv->context);
+		break;
+	case PROP_SOURCE:
+		g_value_set_object (value, self->pv->source);
+		break;
+	case PROP_PREFERRED:
+		g_value_set_object (value, self->pv->preferred);
+		break;
+	case PROP_PARENT:
+		g_value_set_object (value, self->pv->parent);
+		break;
+	case PROP_ID:
+		g_value_set_uint (value, self->pv->id);
+		break;
+	case PROP_TAG:
+		g_value_set_uint (value, self->pv->tag);
+		break;
+	case PROP_LABEL:
+		g_value_set_string (value, self->pv->label);
+		break;
+	case PROP_NICKNAME:
+		g_value_set_string (value, self->pv->nickname);
+		break;
+	case PROP_MARKUP:
+		g_value_set_string (value, self->pv->markup);
+		break;
+	case PROP_DESCRIPTION:
+		g_value_set_string (value, self->pv->description);
+		break;
+	case PROP_ICON:
+		g_value_set_string (value, self->pv->icon);
+		break;
+	case PROP_IDENTIFIER:
+		g_value_set_string (value, self->pv->identifier);
+		break;
+	case PROP_LOCATION:
+		g_value_set_enum (value, self->pv->location);
+		break;
+	case PROP_USAGE:
+		g_value_set_enum (value, self->pv->usage);
+		break;
+	case PROP_FLAGS:
+		g_value_set_uint (value, self->pv->flags);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+		break;
+	}
 }
 
+static void
+seahorse_object_set_property (GObject *obj, guint prop_id, const GValue *value, 
+                              GParamSpec *pspec)
+{
+	SeahorseObject *self = SEAHORSE_OBJECT (obj);
 
-GQuark seahorse_object_get_id (SeahorseObject* self) {
-	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), 0U);
-	return self->_id;
+	switch (prop_id) {
+	case PROP_CONTEXT:
+		if (self->pv->context) 
+			g_object_remove_weak_pointer (G_OBJECT (self->pv->context), (gpointer*)&self->pv->context);
+		self->pv->context = SEAHORSE_CONTEXT (g_value_get_object (value));
+		if (self->pv->context != NULL)
+			g_object_add_weak_pointer (G_OBJECT (self->pv->context), (gpointer*)&self->pv->context);
+		g_object_notify (G_OBJECT (self), "context");
+		break;
+	case PROP_SOURCE:
+		seahorse_object_set_source (self, SEAHORSE_SOURCE (g_value_get_object (value)));
+		break;
+	case PROP_PREFERRED:
+		seahorse_object_set_preferred (self, SEAHORSE_OBJECT (g_value_get_object (value)));
+		break;
+	case PROP_PARENT:
+		seahorse_object_set_parent (self, SEAHORSE_OBJECT (g_value_get_object (value)));
+		break;
+	case PROP_ID:
+		self->pv->id = g_value_get_uint (value);
+		g_object_notify (obj, "id");
+		recalculate_id (self);
+		break;
+	case PROP_LABEL:
+		g_free (self->pv->label);
+		self->pv->label = g_value_dup_string (value);
+		g_object_notify (obj, "label");
+		recalculate_label (self);
+		break;
+	case PROP_NICKNAME:
+		g_free (self->pv->nickname);
+		self->pv->nickname = g_value_dup_string (value);
+		self->pv->nickname_explicit = TRUE;
+		g_object_notify (obj, "nickname");
+		break;
+	case PROP_MARKUP:
+		g_free (self->pv->markup);
+		self->pv->markup = g_value_dup_string (value);
+		self->pv->markup_explicit = TRUE;
+		g_object_notify (obj, "markup");
+		break;
+	case PROP_DESCRIPTION:
+		g_free (self->pv->description);
+		self->pv->description = g_value_dup_string (value);
+		self->pv->description_explicit = TRUE;
+		g_object_notify (obj, "description");
+		break;
+	case PROP_ICON:
+		g_free (self->pv->icon);
+		self->pv->icon = g_value_dup_string (value);
+		g_object_notify (obj, "icon");
+		break;
+	case PROP_IDENTIFIER:
+		g_free (self->pv->identifier);
+		self->pv->identifier = g_value_dup_string (value);
+		self->pv->identifier_explicit = TRUE;
+		g_object_notify (obj, "identifier");
+		break;
+	case PROP_LOCATION:
+		self->pv->location = g_value_get_enum (value);
+		g_object_notify (obj, "location");
+		break;
+	case PROP_USAGE:
+		self->pv->usage = g_value_get_enum (value);
+		g_object_notify (obj, "usage");
+		recalculate_usage (self);
+		break;
+	case PROP_FLAGS:
+		self->pv->flags = g_value_get_uint (value);
+		g_object_notify (obj, "flags");
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+		break;
+	}
 }
 
+static void
+seahorse_object_class_init (SeahorseObjectClass *klass)
+{
+	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+    
+	seahorse_object_parent_class = g_type_class_peek_parent (klass);
+	g_type_class_add_private (klass, sizeof (SeahorseObjectPrivate));
 
-SeahorseLocation seahorse_object_get_location (SeahorseObject* self) {
+	gobject_class->dispose = seahorse_object_dispose;
+	gobject_class->finalize = seahorse_object_finalize;
+	gobject_class->set_property = seahorse_object_set_property;
+	gobject_class->get_property = seahorse_object_get_property;
+    
+	g_object_class_install_property (gobject_class, PROP_SOURCE,
+	           g_param_spec_object ("source", "Object Source", "Source the Object came from", 
+	                                SEAHORSE_TYPE_SOURCE, G_PARAM_READWRITE));
+
+	g_object_class_install_property (gobject_class, PROP_CONTEXT,
+	           g_param_spec_object ("context", "Context for object", "Object that this context belongs to", 
+	                                SEAHORSE_TYPE_CONTEXT, G_PARAM_READWRITE));
+
+	g_object_class_install_property (gobject_class, PROP_PREFERRED,
+	           g_param_spec_object ("preferred", "Preferred Object", "An object to prefer over this one", 
+	                                SEAHORSE_TYPE_OBJECT, G_PARAM_READWRITE));
+    
+	g_object_class_install_property (gobject_class, PROP_PREFERRED,
+	           g_param_spec_object ("parent", "Parent Object", "This object's parent in the tree.", 
+	                                SEAHORSE_TYPE_OBJECT, G_PARAM_READWRITE));
+	
+	g_object_class_install_property (gobject_class, PROP_ID,
+	           g_param_spec_uint ("id", "Object ID", "This object's ID.", 
+	                              0, G_MAXUINT, 0, G_PARAM_READWRITE));
+	
+	g_object_class_install_property (gobject_class, PROP_TAG,
+	           g_param_spec_uint ("tag", "Object Type Tag", "This object's type tag.", 
+	                              0, G_MAXUINT, 0, G_PARAM_READABLE));
+	
+	g_object_class_install_property (gobject_class, PROP_LABEL,
+	           g_param_spec_string ("label", "Object Display Label", "This object's displayable label.", 
+	                                "", G_PARAM_READWRITE));
+
+	g_object_class_install_property (gobject_class, PROP_NICKNAME,
+	           g_param_spec_string ("nickname", "Object Short Name", "This object's short name.", 
+	                                "", G_PARAM_READWRITE));
+	
+	g_object_class_install_property (gobject_class, PROP_ICON,
+	           g_param_spec_string ("icon", "Object Icon", "Stock ID for object.", 
+	                                "", G_PARAM_READWRITE));
+	
+	g_object_class_install_property (gobject_class, PROP_MARKUP,
+	           g_param_spec_string ("markup", "Object Display Markup", "This object's displayable markup.", 
+	                                "", G_PARAM_READWRITE));
+	
+	g_object_class_install_property (gobject_class, PROP_DESCRIPTION,
+	           g_param_spec_string ("description", "Object Description", "Description of the type of object", 
+	                                "", G_PARAM_READWRITE));
+	
+	g_object_class_install_property (gobject_class, PROP_IDENTIFIER,
+	           g_param_spec_string ("identifier", "Object Identifier", "Displayable ID for the object.", 
+	                                "", G_PARAM_READWRITE));
+	
+	g_object_class_install_property (gobject_class, PROP_LOCATION,
+	           g_param_spec_enum ("location", "Object Location", "Where the object is located.", 
+	                              SEAHORSE_TYPE_LOCATION, SEAHORSE_LOCATION_INVALID, G_PARAM_READWRITE));
+	
+	g_object_class_install_property (gobject_class, PROP_USAGE,
+	           g_param_spec_enum ("usage", "Object Usage", "How this object is used.", 
+	                              SEAHORSE_TYPE_USAGE, SEAHORSE_USAGE_NONE, G_PARAM_READWRITE));
+
+	g_object_class_install_property (gobject_class, PROP_FLAGS,
+	           g_param_spec_uint ("flags", "Object Flags", "This object's flags.", 
+	                              0, G_MAXUINT, 0, G_PARAM_READWRITE));
+}
+
+/* -----------------------------------------------------------------------------
+ * PUBLIC 
+ */
+
+GQuark
+seahorse_object_get_id (SeahorseObject *self)
+{
 	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), 0);
-	return self->_location;
+	return self->pv->id;
 }
 
+GQuark
+seahorse_object_get_tag (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), 0);
+	return self->pv->tag;	
+}
 
-void seahorse_object_set_location (SeahorseObject* self, SeahorseLocation value) {
-	g_return_if_fail (SEAHORSE_IS_OBJECT (self));
-	self->_location = value;
-	seahorse_object_fire_changed (self, SEAHORSE_OBJECT_CHANGE_LOCATION);
-	g_object_notify (((GObject *) (self)), "location");
+SeahorseSource*
+seahorse_object_get_source (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
+	return self->pv->source;	
 }
 
+void
+seahorse_object_set_source (SeahorseObject *self, SeahorseSource *value)
+{
+	g_return_if_fail (SEAHORSE_IS_OBJECT (self));
+	
+	if (value == self->pv->source)
+		return;
 
-SeahorseUsage seahorse_object_get_usage (SeahorseObject* self) {
-	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), 0);
-	return self->_usage;
-}
+	if (self->pv->source) 
+		g_object_remove_weak_pointer (G_OBJECT (self->pv->source), (gpointer*)&self->pv->source);
 
+	self->pv->source = value;
+	if (self->pv->source != NULL)
+		g_object_add_weak_pointer (G_OBJECT (self->pv->source), (gpointer*)&self->pv->source);
 
-guint seahorse_object_get_flags (SeahorseObject* self) {
-	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), 0U);
-	return self->_flags;
+	g_object_notify (G_OBJECT (self), "source");
 }
 
-
-SeahorseSource* seahorse_object_get_source (SeahorseObject* self) {
+SeahorseContext*
+seahorse_object_get_context (SeahorseObject *self)
+{
 	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
-	return self->priv->_source;
+	return self->pv->context;
 }
 
+SeahorseObject*
+seahorse_object_get_preferred (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
+	return self->pv->preferred;
+}
 
-void seahorse_object_set_source (SeahorseObject* self, SeahorseSource* value) {
+void
+seahorse_object_set_preferred (SeahorseObject *self, SeahorseObject *value)
+{
 	g_return_if_fail (SEAHORSE_IS_OBJECT (self));
-	if (value == self->priv->_source) {
+	
+	if (self->pv->preferred == value)
 		return;
-	}
-	if (self->priv->_source != NULL) {
-		g_object_remove_weak_pointer (G_OBJECT (self->priv->_source), &self->priv->_source);
-	}
-	self->priv->_source = value;
-	if (self->priv->_source != NULL) {
-		g_object_add_weak_pointer (G_OBJECT (self->priv->_source), &self->priv->_source);
-	}
-	g_object_notify (((GObject *) (self)), "source");
-}
 
+	if (self->pv->preferred)
+		g_object_remove_weak_pointer (G_OBJECT (self->pv->preferred), (gpointer*)&self->pv->preferred);
 
-SeahorseObject* seahorse_object_get_preferred (SeahorseObject* self) {
-	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
-	return self->priv->_preferred;
+	self->pv->preferred = value;
+	if (self->pv->preferred != NULL)
+		g_object_add_weak_pointer (G_OBJECT (self->pv->preferred), (gpointer*)&self->pv->preferred);
+
+	g_object_notify (G_OBJECT (self), "preferred");
 }
 
+SeahorseObject*
+seahorse_object_get_parent (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
+	return self->pv->parent;
+}
 
-void seahorse_object_set_preferred (SeahorseObject* self, SeahorseObject* value) {
+void
+seahorse_object_set_parent (SeahorseObject *self, SeahorseObject *value)
+{
 	g_return_if_fail (SEAHORSE_IS_OBJECT (self));
-	if (self->priv->_preferred == value) {
+	g_return_if_fail (self->pv->parent != self);
+	g_return_if_fail (value != self);
+	
+	if (value == self->pv->parent)
 		return;
-	}
-	if (self->priv->_preferred != NULL) {
-		g_object_remove_weak_pointer (G_OBJECT (self->priv->_preferred), &self->priv->_preferred);
-	}
-	self->priv->_preferred = value;
-	if (self->priv->_preferred != NULL) {
-		g_object_add_weak_pointer (G_OBJECT (self->priv->_preferred), &self->priv->_preferred);
-	}
-	seahorse_object_fire_changed (self, SEAHORSE_OBJECT_CHANGE_PREFERRED);
-	g_object_notify (((GObject *) (self)), "preferred");
-}
-
+	
+	/* Set the new parent/child relationship */
+	if (self->pv->parent != NULL)
+		unregister_child (self->pv->parent, self);
 
-char* seahorse_object_get_display_name (SeahorseObject* self) {
-	return SEAHORSE_OBJECT_GET_CLASS (self)->get_display_name (self);
+	if (value != NULL)
+		register_child (value, self);
+	
+	g_assert (self->pv->parent == value);
+
+	g_object_notify (G_OBJECT (self), "parent");
+}
+ 
+GList*
+seahorse_object_get_children (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
+	return g_list_copy (self->pv->children);
 }
 
-
-char* seahorse_object_get_markup (SeahorseObject* self) {
-	return SEAHORSE_OBJECT_GET_CLASS (self)->get_markup (self);
+SeahorseObject*
+seahorse_object_get_nth_child (SeahorseObject *self, guint index)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
+	return SEAHORSE_OBJECT (g_list_nth_data (self->pv->children, index));
 }
 
+const gchar*
+seahorse_object_get_label (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
+	return self->pv->label;
+}
 
-char* seahorse_object_get_stock_id (SeahorseObject* self) {
-	return SEAHORSE_OBJECT_GET_CLASS (self)->get_stock_id (self);
+const gchar*
+seahorse_object_get_markup (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
+	return self->pv->markup;
 }
 
+const gchar*
+seahorse_object_get_nickname (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
+	return self->pv->nickname;
+}
 
-SeahorseObject* seahorse_object_get_parent (SeahorseObject* self) {
+const gchar*
+seahorse_object_get_description (SeahorseObject *self)
+{
 	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
-	return self->priv->_parent;
+	return self->pv->description;
 }
 
+const gchar*
+seahorse_object_get_icon (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
+	return self->pv->icon;
+}
 
-void seahorse_object_set_parent (SeahorseObject* self, SeahorseObject* value) {
-	g_return_if_fail (SEAHORSE_IS_OBJECT (self));
-	g_assert (self->priv->_parent != self);
-	if (value == self->priv->_parent) {
-		return;
-	}
-	/* Set the new parent/child relationship */
-	if (self->priv->_parent != NULL) {
-		seahorse_object_unregister_child (self->priv->_parent, self);
-	}
-	if (value != NULL) {
-		seahorse_object_register_child (value, self);
-	}
-	g_assert (self->priv->_parent == value);
-	/* Fire a signal to let watchers know this changed */
-	g_signal_emit_by_name (G_OBJECT (self), "hierarchy");
-	g_object_notify (((GObject *) (self)), "parent");
+const gchar*
+seahorse_object_get_identifier (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
+	return self->pv->identifier;	
 }
 
+SeahorseLocation
+seahorse_object_get_location (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), SEAHORSE_LOCATION_INVALID);
+	return self->pv->location;
+}
 
-static GObject * seahorse_object_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
-	GObject * obj;
-	SeahorseObjectClass * klass;
-	GObjectClass * parent_class;
-	SeahorseObject * self;
-	klass = SEAHORSE_OBJECT_CLASS (g_type_class_peek (SEAHORSE_TYPE_OBJECT));
-	parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
-	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
-	self = SEAHORSE_OBJECT (obj);
-	{
-		self->priv->_parent = NULL;
-		self->priv->_children = NULL;
-	}
-	return obj;
+SeahorseUsage
+seahorse_object_get_usage (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), SEAHORSE_USAGE_NONE);
+	return self->pv->usage;	
 }
 
+guint
+seahorse_object_get_flags (SeahorseObject *self)
+{
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), 0);
+	return self->pv->flags;	
+}
 
-gboolean seahorse_object_predicate_match (SeahorseObjectPredicate *self, SeahorseObject* obj) {
+gboolean
+seahorse_object_lookup_property (SeahorseObject *self, const gchar *field, GValue *value)
+{
+	GParamSpec *spec;
+	
+	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), FALSE);
+	g_return_val_if_fail (field, FALSE);
+	g_return_val_if_fail (value, FALSE);
+	
+	spec = g_object_class_find_property (G_OBJECT_GET_CLASS (self), field);
+	if (!spec) {
+		/* Some name mapping to new style names */
+		if (g_str_equal (field, "simple-name"))
+			field = "nickname";
+		else if (g_str_equal (field, "key-id"))
+			field = "identifier";
+		else if (g_str_equal (field, "display-name"))
+			field = "label";
+		else if (g_str_equal (field, "key-desc"))
+			field = "description";
+		else if (g_str_equal (field, "ktype"))
+			field = "tag";
+		else if (g_str_equal (field, "etype"))
+			field = "usage";
+		else if (g_str_equal (field, "display-id"))
+			field = "identifier";
+		else if (g_str_equal (field, "stock-id"))
+			field = "icon";
+		else 
+			return FALSE;
+	
+		/* Try again */
+		spec = g_object_class_find_property (G_OBJECT_GET_CLASS (self), field);
+		if (!spec)
+			return FALSE;
+	}
+
+	g_value_init (value, spec->value_type);
+	g_object_get_property (G_OBJECT (self), field, value);
+	return TRUE; 
+}
+
+gboolean 
+seahorse_object_predicate_match (SeahorseObjectPredicate *self, SeahorseObject* obj) 
+{
+	SeahorseObjectPrivate *pv;
+	
 	g_return_val_if_fail (SEAHORSE_IS_OBJECT (obj), FALSE);
+	pv = obj->pv;
+	
 	/* Check all the fields */
-	if ((*self).tag != 0 && ((*self).tag != obj->_tag)) {
+	if (self->tag != 0 && self->tag != pv->tag)
 		return FALSE;
-	}
-	if ((*self).id != 0 && ((*self).id != obj->_id)) {
+	if (self->id != 0 && self->id != pv->id)
 		return FALSE;
-	}
-	if ((*self).location != 0 && ((*self).location != obj->_location)) {
+	if (self->location != 0 && self->location != pv->location)
 		return FALSE;
-	}
-	if ((*self).usage != 0 && ((*self).usage != obj->_usage)) {
+	if (self->usage != 0 && self->usage != pv->usage) 
 		return FALSE;
-	}
-	if ((*self).flags != 0 && ((*self).flags & obj->_flags) == 0) {
+	if (self->flags != 0 && (self->flags & pv->flags) == 0) 
 		return FALSE;
-	}
-	if ((*self).nflags != 0 && ((*self).nflags & obj->_flags) != 0) {
+	if (self->nflags != 0 && (self->nflags & pv->flags) != 0)
 		return FALSE;
-	}
-	if ((*self).source != NULL && ((*self).source != obj->priv->_source)) {
+	if (self->source != NULL && self->source != pv->source)
 		return FALSE;
-	}
+
 	/* And any custom stuff */
-	if ((*self).custom != NULL && !(*self).custom (obj, (*self).custom_target)) {
+	if (self->custom != NULL && !self->custom (obj, self->custom_target)) 
 		return FALSE;
-	}
-	return TRUE;
-}
 
-
-static void seahorse_object_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
-	SeahorseObject * self;
-	self = SEAHORSE_OBJECT (object);
-	switch (property_id) {
-		case SEAHORSE_OBJECT_TAG:
-		g_value_set_uint (value, seahorse_object_get_tag (self));
-		break;
-		case SEAHORSE_OBJECT_ID:
-		g_value_set_uint (value, seahorse_object_get_id (self));
-		break;
-		case SEAHORSE_OBJECT_LOCATION:
-		g_value_set_enum (value, seahorse_object_get_location (self));
-		break;
-		case SEAHORSE_OBJECT_USAGE:
-		g_value_set_enum (value, seahorse_object_get_usage (self));
-		break;
-		case SEAHORSE_OBJECT_FLAGS:
-		g_value_set_uint (value, seahorse_object_get_flags (self));
-		break;
-		case SEAHORSE_OBJECT_SOURCE:
-		g_value_set_object (value, seahorse_object_get_source (self));
-		break;
-		case SEAHORSE_OBJECT_PREFERRED:
-		g_value_set_object (value, seahorse_object_get_preferred (self));
-		break;
-		case SEAHORSE_OBJECT_PARENT:
-		g_value_set_object (value, seahorse_object_get_parent (self));
-		break;
-		default:
-		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-		break;
-	}
-}
-
-
-static void seahorse_object_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
-	SeahorseObject * self;
-	self = SEAHORSE_OBJECT (object);
-	switch (property_id) {
-		case SEAHORSE_OBJECT_LOCATION:
-		seahorse_object_set_location (self, g_value_get_enum (value));
-		break;
-		case SEAHORSE_OBJECT_SOURCE:
-		seahorse_object_set_source (self, g_value_get_object (value));
-		break;
-		case SEAHORSE_OBJECT_PREFERRED:
-		seahorse_object_set_preferred (self, g_value_get_object (value));
-		break;
-		case SEAHORSE_OBJECT_PARENT:
-		seahorse_object_set_parent (self, g_value_get_object (value));
-		break;
-		default:
-		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-		break;
-	}
-}
-
-
-static void seahorse_object_class_init (SeahorseObjectClass * klass) {
-	seahorse_object_parent_class = g_type_class_peek_parent (klass);
-	g_type_class_add_private (klass, sizeof (SeahorseObjectPrivate));
-	G_OBJECT_CLASS (klass)->get_property = seahorse_object_get_property;
-	G_OBJECT_CLASS (klass)->set_property = seahorse_object_set_property;
-	G_OBJECT_CLASS (klass)->constructor = seahorse_object_constructor;
-	G_OBJECT_CLASS (klass)->finalize = seahorse_object_finalize;
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_OBJECT_TAG, g_param_spec_uint ("tag", "tag", "tag", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_OBJECT_ID, g_param_spec_uint ("id", "id", "id", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_OBJECT_LOCATION, g_param_spec_enum ("location", "location", "location", SEAHORSE_TYPE_LOCATION, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_OBJECT_USAGE, g_param_spec_enum ("usage", "usage", "usage", SEAHORSE_TYPE_USAGE, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_OBJECT_FLAGS, g_param_spec_uint ("flags", "flags", "flags", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_OBJECT_SOURCE, g_param_spec_object ("source", "source", "source", SEAHORSE_TYPE_SOURCE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_OBJECT_PREFERRED, g_param_spec_object ("preferred", "preferred", "preferred", SEAHORSE_TYPE_OBJECT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_OBJECT_DISPLAY_NAME, g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_OBJECT_MARKUP, g_param_spec_string ("markup", "markup", "markup", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_OBJECT_STOCK_ID, g_param_spec_string ("stock-id", "stock-id", "stock-id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_OBJECT_PARENT, g_param_spec_object ("parent", "parent", "parent", SEAHORSE_TYPE_OBJECT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
-	g_signal_new ("changed", SEAHORSE_TYPE_OBJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__ENUM, G_TYPE_NONE, 1, SEAHORSE_OBJECT_TYPE_CHANGE);
-	g_signal_new ("hierarchy", SEAHORSE_TYPE_OBJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
-	g_signal_new ("destroy", SEAHORSE_TYPE_OBJECT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
-}
-
-
-static void seahorse_object_instance_init (SeahorseObject * self) {
-	self->priv = SEAHORSE_OBJECT_GET_PRIVATE (self);
-}
-
-
-static void seahorse_object_finalize (GObject * obj) {
-	SeahorseObject * self;
-	self = SEAHORSE_OBJECT (obj);
-	{
-		SeahorseObject* _tmp0;
-		SeahorseObject* new_parent;
-		/* Fire our destroy signal, so that any watchers can go away */
-		g_signal_emit_by_name (G_OBJECT (self), "destroy");
-		if (self->priv->_source != NULL) {
-			g_object_remove_weak_pointer (G_OBJECT (self->priv->_source), &self->priv->_source);
-		}
-		if (self->priv->_preferred != NULL) {
-			g_object_remove_weak_pointer (G_OBJECT (self->priv->_source), &self->priv->_preferred);
-		}
-		/* 
-		 * When an object is destroyed, we reparent all
-		 * children to this objects parent. If no parent
-		 * of this object, all children become root objects.
-		 */
-		_tmp0 = NULL;
-		new_parent = (_tmp0 = self->priv->_parent, (_tmp0 == NULL ? NULL : g_object_ref (_tmp0)));
-		{
-			GList* child_collection;
-			GList* child_it;
-			child_collection = self->priv->_children;
-			for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
-				SeahorseObject* _tmp1;
-				SeahorseObject* child;
-				_tmp1 = NULL;
-				child = (_tmp1 = ((SeahorseObject*) (child_it->data)), (_tmp1 == NULL ? NULL : g_object_ref (_tmp1)));
-				{
-					seahorse_object_unregister_child (self, child);
-					if (new_parent != NULL) {
-						seahorse_object_register_child (new_parent, child);
-					}
-					/* Fire signal to let anyone know this has moved */
-					g_signal_emit_by_name (G_OBJECT (child), "hierarchy");
-					(child == NULL ? NULL : (child = (g_object_unref (child), NULL)));
-				}
-			}
-		}
-		(new_parent == NULL ? NULL : (new_parent = (g_object_unref (new_parent), NULL)));
-	}
-	G_OBJECT_CLASS (seahorse_object_parent_class)->finalize (obj);
-}
-
-
-GType seahorse_object_get_type (void) {
-	static GType seahorse_object_type_id = 0;
-	if (seahorse_object_type_id == 0) {
-		static const GTypeInfo g_define_type_info = { sizeof (SeahorseObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seahorse_object_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeahorseObject), 0, (GInstanceInitFunc) seahorse_object_instance_init };
-		seahorse_object_type_id = g_type_register_static (G_TYPE_OBJECT, "SeahorseObject", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
-	}
-	return seahorse_object_type_id;
+	return TRUE;
 }
-
-
-
-

Modified: trunk/libseahorse/seahorse-object.h
==============================================================================
--- trunk/libseahorse/seahorse-object.h	(original)
+++ trunk/libseahorse/seahorse-object.h	Sat Nov 29 17:37:20 2008
@@ -1,59 +1,130 @@
+/* 
+ * Seahorse
+ * 
+ * Copyright (C) 2008 Stefan Walter
+ * 
+ * This program is free software; you can redistribute it and/or modify 
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *  
+ * This program 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
+ * Lesser General Public License for more details.
+ *  
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.  
+ */
 
 #ifndef __SEAHORSE_OBJECT_H__
 #define __SEAHORSE_OBJECT_H__
 
-#include <glib.h>
-#include <glib-object.h>
-#include <seahorse-context.h>
-#include <seahorse-source.h>
-#include <stdlib.h>
-#include <string.h>
-#include <seahorse-types.h>
-
-G_BEGIN_DECLS
+/* 
+ * Derived classes must set the following properties:
+ * 
+ * id: GQuark: Unique identifier for this object.
+ * tag: GQuark: The module (openpgp, pkcs11, etc...) that handles this object. 
+ * label: string: The displayable string label of this object.
+ * icon: string: The stock ID of an icon to show for this object.
+ * usage: SeahorseUsage: The usage of this object.
+ *  
+ * The following will be calculated automatically if not set:
+ * 
+ * markup: string: The markup string label of this object.
+ * identifier: string: The displayable key identifier for this object.
+ * description: string: The description of the type of object.
+ *
+ * The following can optionally be set:
+ *  
+ * location: SeahorseLocation: The location this object is present at. 
+ * flags: guint: Flags from the SEAHORSE_FLAG_ set. 
+ */
+
+#include "seahorse-context.h"
+#include "seahorse-source.h"
+#include "seahorse-types.h"
 
+#include <glib-object.h>
 
-#define SEAHORSE_TYPE_OBJECT (seahorse_object_get_type ())
-#define SEAHORSE_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_OBJECT, SeahorseObject))
-#define SEAHORSE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_OBJECT, SeahorseObjectClass))
-#define SEAHORSE_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_OBJECT))
-#define SEAHORSE_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_OBJECT))
-#define SEAHORSE_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_OBJECT, SeahorseObjectClass))
+#define SEAHORSE_TYPE_OBJECT               (seahorse_object_get_type ())
+#define SEAHORSE_OBJECT(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_OBJECT, SeahorseObject))
+#define SEAHORSE_OBJECT_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_OBJECT, SeahorseObjectClass))
+#define SEAHORSE_IS_OBJECT(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_OBJECT))
+#define SEAHORSE_IS_OBJECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_OBJECT))
+#define SEAHORSE_OBJECT_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_OBJECT, SeahorseObjectClass))
 
 typedef struct _SeahorseObject SeahorseObject;
 typedef struct _SeahorseObjectClass SeahorseObjectClass;
 typedef struct _SeahorseObjectPrivate SeahorseObjectPrivate;
-
-#define SEAHORSE_OBJECT_TYPE_CHANGE (seahorse_object_change_get_type ())
-typedef struct _SeahorseObjectPredicate SeahorseObjectPredicate;
-typedef gboolean (*SeahorseObjectPredicateFunc) (SeahorseObject* obj, void* user_data);
-
+    
 struct _SeahorseObject {
-	GObject parent_instance;
-	SeahorseObjectPrivate * priv;
-	GQuark _tag;
-	GQuark _id;
-	SeahorseLocation _location;
-	SeahorseUsage _usage;
-	guint _flags;
-	SeahorseContext* attached_to;
+	GObject parent;
+	SeahorseObjectPrivate *pv;
 };
 
 struct _SeahorseObjectClass {
 	GObjectClass parent_class;
-	char* (*get_display_name) (SeahorseObject* self);
-	char* (*get_markup) (SeahorseObject* self);
-	char* (*get_stock_id) (SeahorseObject* self);
 };
 
-/* INTERFACE -------------------------------------------------- 
- TODO: Are we sure we need this? */
-typedef enum  {
-	SEAHORSE_OBJECT_CHANGE_ALL = 1,
-	SEAHORSE_OBJECT_CHANGE_LOCATION,
-	SEAHORSE_OBJECT_CHANGE_PREFERRED,
-	SEAHORSE_OBJECT_CHANGE_MAX
-} SeahorseObjectChange;
+GType               seahorse_object_get_type               (void);
+
+SeahorseObject*     seahorse_object_new                    (void);
+
+GQuark              seahorse_object_get_id                 (SeahorseObject *self);
+
+GQuark              seahorse_object_get_tag                (SeahorseObject *self);
+
+SeahorseSource*     seahorse_object_get_source             (SeahorseObject *self);
+
+void                seahorse_object_set_source             (SeahorseObject *self, 
+                                                            SeahorseSource *value);
+
+SeahorseContext*    seahorse_object_get_context            (SeahorseObject *self);
+
+SeahorseObject*     seahorse_object_get_preferred          (SeahorseObject *self);
+
+void                seahorse_object_set_preferred          (SeahorseObject *self, 
+                                                            SeahorseObject *value);
+
+SeahorseObject*     seahorse_object_get_parent             (SeahorseObject *self);
+
+void                seahorse_object_set_parent             (SeahorseObject *self, 
+                                                            SeahorseObject *value);
+ 
+GList*              seahorse_object_get_children           (SeahorseObject *self);
+
+SeahorseObject*     seahorse_object_get_nth_child          (SeahorseObject *self,
+                                                            guint index);
+
+const gchar*        seahorse_object_get_label              (SeahorseObject *self);
+
+const gchar*        seahorse_object_get_markup             (SeahorseObject *self);
+
+const gchar*        seahorse_object_get_identifier         (SeahorseObject *self);
+
+const gchar*        seahorse_object_get_description        (SeahorseObject *self);
+
+const gchar*        seahorse_object_get_nickname           (SeahorseObject *self);
+
+const gchar*        seahorse_object_get_icon               (SeahorseObject *self);
+
+
+SeahorseLocation    seahorse_object_get_location           (SeahorseObject *self);
+
+SeahorseUsage       seahorse_object_get_usage              (SeahorseObject *self);
+
+guint               seahorse_object_get_flags              (SeahorseObject *self);
+
+gboolean            seahorse_object_lookup_property        (SeahorseObject *self, 
+                                                            const gchar *field, 
+                                                            GValue *value);
+
+typedef gboolean (*SeahorseObjectPredicateFunc) (SeahorseObject *obj, void *user_data);
+
+typedef struct _SeahorseObjectPredicate SeahorseObjectPredicate;
 
 struct _SeahorseObjectPredicate {
 	GQuark tag;
@@ -62,34 +133,13 @@
 	SeahorseUsage usage;
 	guint flags;
 	guint nflags;
-	SeahorseSource* source;
+	SeahorseSource *source;
 	SeahorseObjectPredicateFunc custom;
 	gpointer custom_target;
 };
 
+gboolean           seahorse_object_predicate_match         (SeahorseObjectPredicate *self, 
+                                                            SeahorseObject *obj);
 
-GType seahorse_object_change_get_type (void);
-GList* seahorse_object_get_children (SeahorseObject* self);
-void seahorse_object_fire_changed (SeahorseObject* self, SeahorseObjectChange what);
-GQuark seahorse_object_get_tag (SeahorseObject* self);
-GQuark seahorse_object_get_id (SeahorseObject* self);
-SeahorseLocation seahorse_object_get_location (SeahorseObject* self);
-void seahorse_object_set_location (SeahorseObject* self, SeahorseLocation value);
-SeahorseUsage seahorse_object_get_usage (SeahorseObject* self);
-guint seahorse_object_get_flags (SeahorseObject* self);
-SeahorseSource* seahorse_object_get_source (SeahorseObject* self);
-void seahorse_object_set_source (SeahorseObject* self, SeahorseSource* value);
-SeahorseObject* seahorse_object_get_preferred (SeahorseObject* self);
-void seahorse_object_set_preferred (SeahorseObject* self, SeahorseObject* value);
-char* seahorse_object_get_display_name (SeahorseObject* self);
-char* seahorse_object_get_markup (SeahorseObject* self);
-char* seahorse_object_get_stock_id (SeahorseObject* self);
-SeahorseObject* seahorse_object_get_parent (SeahorseObject* self);
-void seahorse_object_set_parent (SeahorseObject* self, SeahorseObject* value);
-gboolean seahorse_object_predicate_match (SeahorseObjectPredicate *self, SeahorseObject* obj);
-GType seahorse_object_get_type (void);
-
-
-G_END_DECLS
 
-#endif
+#endif /* __SEAHORSE_OBJECT_H__ */

Modified: trunk/libseahorse/seahorse-progress.c
==============================================================================
--- trunk/libseahorse/seahorse-progress.c	(original)
+++ trunk/libseahorse/seahorse-progress.c	Sat Nov 29 17:37:20 2008
@@ -272,7 +272,7 @@
                             (GDestroyNotify)g_object_unref);    
 
     w = glade_xml_get_widget (swidget->xml, swidget->name);
-    gtk_window_move (w, 10, 10);
+    gtk_window_move (GTK_WINDOW (w), 10, 10);
 
     /* Setup the title */
     title = (const gchar*)g_object_get_data (G_OBJECT (operation), "progress-title");

Modified: trunk/libseahorse/seahorse-set-model.c
==============================================================================
--- trunk/libseahorse/seahorse-set-model.c	(original)
+++ trunk/libseahorse/seahorse-set-model.c	Sat Nov 29 17:37:20 2008
@@ -20,6 +20,8 @@
 
 #include "seahorse-set-model.h"
 
+#include <string.h>
+
 enum {
 	PROP_0,
 	PROP_SET
@@ -75,7 +77,7 @@
 }
 
 static void
-key_hierarchy (SeahorseObject *sobj, SeahorseSetModel *smodel)
+key_hierarchy (SeahorseObject *sobj, GParamSpec *spec, SeahorseSetModel *smodel)
 {
 	SeahorseSetModelPrivate *pv = SEAHORSE_SET_MODEL_GET_PRIVATE (smodel);
 
@@ -121,7 +123,7 @@
 	had = parent_node->children ? TRUE : FALSE;
 	node = g_node_append_data (parent_node, sobj);
 	g_hash_table_insert (pv->object_to_node, sobj, node);
-	g_signal_connect (sobj, "hierarchy", G_CALLBACK (key_hierarchy), smodel);
+	g_signal_connect (sobj, "notify::parent", G_CALLBACK (key_hierarchy), smodel);
 
 	pv->last_stamp++;
 
@@ -254,7 +256,7 @@
 }
 
 static void
-set_changed (SeahorseSet *set, SeahorseObject *sobj, SeahorseObjectChange change, 
+set_changed (SeahorseSet *set, SeahorseObject *sobj, 
              gpointer closure, SeahorseSetModel *smodel)
 {
 	SeahorseSetModelPrivate *pv = SEAHORSE_SET_MODEL_GET_PRIVATE (smodel);

Modified: trunk/libseahorse/seahorse-set.c
==============================================================================
--- trunk/libseahorse/seahorse-set.c	(original)
+++ trunk/libseahorse/seahorse-set.c	Sat Nov 29 17:37:20 2008
@@ -73,7 +73,7 @@
 static gboolean
 maybe_add_object (SeahorseSet *skset, SeahorseObject *sobj)
 {
-    if (!seahorse_context_owns_object (SCTX_APP (), sobj))
+    if (seahorse_object_get_context (sobj) != SCTX_APP ())
         return FALSE;
 
     if (g_hash_table_lookup (skset->pv->objects, sobj))
@@ -121,8 +121,7 @@
 }
 
 static void
-object_changed (SeahorseContext *sctx, SeahorseObject *sobj, SeahorseObjectChange change,
-                SeahorseSet *skset)
+object_changed (SeahorseContext *sctx, SeahorseObject *sobj, SeahorseSet *skset)
 {
     gpointer closure = g_hash_table_lookup (skset->pv->objects, sobj);
 
@@ -137,7 +136,7 @@
             if (closure == GINT_TO_POINTER (TRUE))
                 closure = NULL;
             
-            g_signal_emit (skset, signals[CHANGED], 0, sobj, change, closure);
+            g_signal_emit (skset, signals[CHANGED], 0, sobj, closure);
         }
         
     /* Not in our set yet */
@@ -256,7 +255,7 @@
     
     signals[CHANGED] = g_signal_new ("changed", SEAHORSE_TYPE_SET, 
                 G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (SeahorseSetClass, changed),
-                NULL, NULL, seahorse_marshal_VOID__OBJECT_UINT_POINTER, G_TYPE_NONE, 3, SEAHORSE_TYPE_OBJECT, G_TYPE_UINT, G_TYPE_POINTER);
+                NULL, NULL, seahorse_marshal_VOID__OBJECT_POINTER, G_TYPE_NONE, 2, SEAHORSE_TYPE_OBJECT, G_TYPE_POINTER);
                 
     signals[SET_CHANGED] = g_signal_new ("set-changed", SEAHORSE_TYPE_SET,
                 G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (SeahorseSetClass, set_changed),

Modified: trunk/libseahorse/seahorse-set.h
==============================================================================
--- trunk/libseahorse/seahorse-set.h	(original)
+++ trunk/libseahorse/seahorse-set.h	Sat Nov 29 17:37:20 2008
@@ -80,8 +80,7 @@
     void (*removed) (SeahorseSet *skset, SeahorseObject *sobj, gpointer closure);
     
     /* One of the key's attributes has changed */
-    void (*changed) (SeahorseSet *skset, SeahorseObject *sobj, 
-                     SeahorseObjectChange change, gpointer closure);
+    void (*changed) (SeahorseSet *skset, SeahorseObject *sobj, gpointer closure);
     
     /* The set of keys changed */
     void (*set_changed) (SeahorseSet *skset);

Modified: trunk/libseahorse/seahorse-source.c
==============================================================================
--- trunk/libseahorse/seahorse-source.c	(original)
+++ trunk/libseahorse/seahorse-source.c	Sat Nov 29 17:37:20 2008
@@ -379,7 +379,7 @@
 
 	g_return_val_if_fail (id != NULL, 0);
     
-	type = seahorse_registry_find_type (NULL, "key-source", g_quark_to_string (ktype), "local", NULL);
+	type = seahorse_registry_find_type (NULL, "source", g_quark_to_string (ktype), "local", NULL);
 	g_return_val_if_fail (type, 0);
 	
 	klass = SEAHORSE_SOURCE_CLASS (g_type_class_peek (type));

Modified: trunk/libseahorse/seahorse-types.c
==============================================================================
--- trunk/libseahorse/seahorse-types.c	(original)
+++ trunk/libseahorse/seahorse-types.c	Sat Nov 29 17:37:20 2008
@@ -1,17 +1,40 @@
+/*
+ * Seahorse
+ *
+ * Copyright (C) 2008 Stefan Walter
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
 
-#include <seahorse-types.h>
+#include "config.h"
 
+#include "seahorse-types.h"
 
-
-
-
-
-
-
-GType seahorse_location_get_type (void) {
+GType seahorse_location_get_type (void) 
+{
 	static GType seahorse_location_type_id = 0;
-	if (G_UNLIKELY (seahorse_location_type_id == 0)) {
-		static const GEnumValue values[] = {{SEAHORSE_LOCATION_INVALID, "SEAHORSE_LOCATION_INVALID", "invalid"}, {SEAHORSE_LOCATION_MISSING, "SEAHORSE_LOCATION_MISSING", "missing"}, {SEAHORSE_LOCATION_SEARCHING, "SEAHORSE_LOCATION_SEARCHING", "searching"}, {SEAHORSE_LOCATION_REMOTE, "SEAHORSE_LOCATION_REMOTE", "remote"}, {SEAHORSE_LOCATION_LOCAL, "SEAHORSE_LOCATION_LOCAL", "local"}, {0, NULL, NULL}};
+	if (!seahorse_location_type_id) {
+		static const GEnumValue values[] = {
+			{ SEAHORSE_LOCATION_INVALID, "SEAHORSE_LOCATION_INVALID", "invalid" }, 
+			{ SEAHORSE_LOCATION_MISSING, "SEAHORSE_LOCATION_MISSING", "missing" }, 
+			{ SEAHORSE_LOCATION_SEARCHING, "SEAHORSE_LOCATION_SEARCHING", "searching" }, 
+			{ SEAHORSE_LOCATION_REMOTE, "SEAHORSE_LOCATION_REMOTE", "remote" }, 
+			{ SEAHORSE_LOCATION_LOCAL, "SEAHORSE_LOCATION_LOCAL", "local" }, 
+			{ 0, NULL, NULL }
+		};
 		seahorse_location_type_id = g_enum_register_static ("SeahorseLocation", values);
 	}
 	return seahorse_location_type_id;
@@ -19,15 +42,21 @@
 
 
 
-GType seahorse_usage_get_type (void) {
+GType seahorse_usage_get_type (void) 
+{
 	static GType seahorse_usage_type_id = 0;
-	if (G_UNLIKELY (seahorse_usage_type_id == 0)) {
-		static const GEnumValue values[] = {{SEAHORSE_USAGE_NONE, "SEAHORSE_USAGE_NONE", "none"}, {SEAHORSE_USAGE_SYMMETRIC_KEY, "SEAHORSE_USAGE_SYMMETRIC_KEY", "symmetric-key"}, {SEAHORSE_USAGE_PUBLIC_KEY, "SEAHORSE_USAGE_PUBLIC_KEY", "public-key"}, {SEAHORSE_USAGE_PRIVATE_KEY, "SEAHORSE_USAGE_PRIVATE_KEY", "private-key"}, {SEAHORSE_USAGE_CREDENTIALS, "SEAHORSE_USAGE_CREDENTIALS", "credentials"}, {SEAHORSE_USAGE_IDENTITY, "SEAHORSE_USAGE_IDENTITY", "identity"}, {SEAHORSE_USAGE_OTHER, "SEAHORSE_USAGE_OTHER", "other"}, {0, NULL, NULL}};
+	if (!seahorse_usage_type_id) {
+		static const GEnumValue values[] = {
+			{ SEAHORSE_USAGE_NONE, "SEAHORSE_USAGE_NONE", "none" },
+			{ SEAHORSE_USAGE_SYMMETRIC_KEY, "SEAHORSE_USAGE_SYMMETRIC_KEY", "symmetric-key" }, 
+			{ SEAHORSE_USAGE_PUBLIC_KEY, "SEAHORSE_USAGE_PUBLIC_KEY", "public-key" }, 
+			{ SEAHORSE_USAGE_PRIVATE_KEY, "SEAHORSE_USAGE_PRIVATE_KEY", "private-key" }, 
+			{ SEAHORSE_USAGE_CREDENTIALS, "SEAHORSE_USAGE_CREDENTIALS", "credentials" }, 
+			{ SEAHORSE_USAGE_IDENTITY, "SEAHORSE_USAGE_IDENTITY", "identity" }, 
+			{ SEAHORSE_USAGE_OTHER, "SEAHORSE_USAGE_OTHER", "other" }, 
+			{ 0, NULL, NULL }
+		};
 		seahorse_usage_type_id = g_enum_register_static ("SeahorseUsage", values);
 	}
 	return seahorse_usage_type_id;
 }
-
-
-
-

Modified: trunk/libseahorse/seahorse-types.h
==============================================================================
--- trunk/libseahorse/seahorse-types.h	(original)
+++ trunk/libseahorse/seahorse-types.h	Sat Nov 29 17:37:20 2008
@@ -1,3 +1,23 @@
+/*
+ * Seahorse
+ *
+ * Copyright (C) 2008 Stefan Walter
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
 
 #ifndef __SEAHORSE_TYPES_H__
 #define __SEAHORSE_TYPES_H__
@@ -5,6 +25,8 @@
 #include <glib.h>
 #include <glib-object.h>
 
+#include "libcryptui/cryptui.h"
+
 G_BEGIN_DECLS
 
 
@@ -24,6 +46,8 @@
 	SEAHORSE_LOCATION_LOCAL = 100
 } SeahorseLocation;
 
+GType seahorse_location_get_type (void);
+
 /* Again, never change these values */
 typedef enum  {
 	SEAHORSE_USAGE_NONE = 0,
@@ -35,10 +59,20 @@
 	SEAHORSE_USAGE_OTHER = 10
 } SeahorseUsage;
 
-
-GType seahorse_location_get_type (void);
 GType seahorse_usage_get_type (void);
 
+typedef enum {
+	SEAHORSE_FLAG_IS_VALID =    CRYPTUI_FLAG_IS_VALID,
+	SEAHORSE_FLAG_CAN_ENCRYPT = CRYPTUI_FLAG_CAN_ENCRYPT,
+	SEAHORSE_FLAG_CAN_SIGN =    CRYPTUI_FLAG_CAN_SIGN,
+	SEAHORSE_FLAG_EXPIRED =     CRYPTUI_FLAG_EXPIRED,
+	SEAHORSE_FLAG_REVOKED =     CRYPTUI_FLAG_REVOKED,
+	SEAHORSE_FLAG_DISABLED =    CRYPTUI_FLAG_DISABLED,
+	SEAHORSE_FLAG_TRUSTED =     CRYPTUI_FLAG_TRUSTED,
+	SEAHORSE_FLAG_EXPORTABLE =  CRYPTUI_FLAG_EXPORTABLE
+} SeahorseKeyFlags;
+
+#define SEAHORSE_TAG_INVALID               0
 
 G_END_DECLS
 

Modified: trunk/libseahorse/seahorse-unknown-source.c
==============================================================================
--- trunk/libseahorse/seahorse-unknown-source.c	(original)
+++ trunk/libseahorse/seahorse-unknown-source.c	Sat Nov 29 17:37:20 2008
@@ -23,9 +23,10 @@
 
 #include <glib/gi18n.h>
 
-#include "seahorse-context.h"
 #include "seahorse-unknown-source.h"
-#include "seahorse-unknown-key.h"
+
+#include "seahorse-context.h"
+#include "seahorse-unknown.h"
 
 #include "common/seahorse-registry.h"
 
@@ -147,7 +148,7 @@
  
     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_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+                           0, G_MAXUINT, SEAHORSE_TAG_INVALID, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
     g_object_class_install_property (gobject_class, PROP_KEY_DESC,
         g_param_spec_string ("key-desc", "Key Desc", "Description for keys that originate here.",
@@ -157,7 +158,7 @@
         g_param_spec_uint ("location", "Key Location", "Where the key is stored. See SeahorseLocation", 
                            0, G_MAXUINT, SEAHORSE_LOCATION_MISSING, G_PARAM_READABLE));    
     
-	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_UNKNOWN_SOURCE, "key-source", NULL);
+	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_UNKNOWN_SOURCE, "source", NULL);
 }
 
 /* -----------------------------------------------------------------------------
@@ -180,12 +181,12 @@
 
     sobj = seahorse_context_get_object (SCTX_APP (), SEAHORSE_SOURCE (usrc), id);
     if (!sobj) {
-        sobj = SEAHORSE_OBJECT (seahorse_unknown_key_new (usrc, id));
+        sobj = SEAHORSE_OBJECT (seahorse_unknown_new (usrc, id, NULL));
         seahorse_context_add_object (SCTX_APP (), sobj);
     }
     
     if (search) {
-        sobj->_location = SEAHORSE_LOCATION_SEARCHING;
+        g_object_set (sobj, "location", SEAHORSE_LOCATION_SEARCHING, NULL);
         seahorse_operation_watch (search, (SeahorseDoneFunc) search_done, sobj, NULL, NULL);
     }
     

Copied: trunk/libseahorse/seahorse-unknown.c (from r2632, /trunk/libseahorse/seahorse-unknown-key.c)
==============================================================================
--- /trunk/libseahorse/seahorse-unknown-key.c	(original)
+++ trunk/libseahorse/seahorse-unknown.c	Sat Nov 29 17:37:20 2008
@@ -21,210 +21,43 @@
 
 #include "config.h"
 
-#include <glib/gi18n.h>
+#include "seahorse-unknown.h"
 
-#include "seahorse-unknown-key.h"
 #include "seahorse-unknown-source.h"
 
-enum {
-    PROP_0,
-    PROP_KEYID,
-    PROP_DISPLAY_NAME,
-    PROP_DISPLAY_ID,
-    PROP_SIMPLE_NAME,
-    PROP_FINGERPRINT,
-    PROP_VALIDITY,
-    PROP_TRUST,
-    PROP_EXPIRES,
-    PROP_STOCK_ID
-};
+#include <glib/gi18n.h>
 
-G_DEFINE_TYPE (SeahorseUnknownKey, seahorse_unknown_key, SEAHORSE_TYPE_KEY);
+G_DEFINE_TYPE (SeahorseUnknown, seahorse_unknown, SEAHORSE_TYPE_OBJECT);
 
 /* -----------------------------------------------------------------------------
  * OBJECT 
  */
 
 static void
-seahorse_unknown_key_init (SeahorseUnknownKey *ukey)
+seahorse_unknown_init (SeahorseUnknown *self)
 {
 
 }
 
-static GObject*  
-seahorse_unknown_key_constructor (GType type, guint n_props, GObjectConstructParam* props)
-{
-    SeahorseKey *skey;
-    SeahorseObject *sobj;
-    GObject *obj;
-    
-    obj = G_OBJECT_CLASS (seahorse_unknown_key_parent_class)->constructor (type, n_props, props);
-    skey = SEAHORSE_KEY (obj);
-    sobj = SEAHORSE_OBJECT (obj);
-    
-    if (seahorse_object_get_source (sobj))
-        sobj->_tag = seahorse_source_get_ktype (seahorse_object_get_source (sobj));
-    sobj->_location = SEAHORSE_LOCATION_MISSING;
-    skey->loaded = SKEY_INFO_NONE;
-    sobj->_usage = SEAHORSE_USAGE_NONE;
-    skey->keydesc = _("Unavailable");
-    return obj;
-}
-
-static guint 
-seahorse_unknown_key_get_num_names (SeahorseKey *key)
-{
-    return 1;
-}
-
-static gchar* 
-seahorse_unknown_key_get_name (SeahorseKey *key, guint index)
-{
-    SeahorseUnknownKey *ukey;
-    
-    g_assert (SEAHORSE_IS_UNKNOWN_KEY (key));
-    ukey = SEAHORSE_UNKNOWN_KEY (key);
-    
-    g_return_val_if_fail (index == 0, NULL);
-
-    return g_strdup_printf (_("Unknown Key: %s"), seahorse_key_get_rawid (ukey->keyid));
-}
-
-static gchar* 
-seahorse_unknown_key_get_name_cn (SeahorseKey *skey, guint index)
-{
-    g_return_val_if_fail (index == 0, NULL);
-    return NULL;
-}
-
-static SeahorseValidity
-seahorse_unknown_key_get_name_validity (SeahorseKey *skey, guint index)
-{
-    g_return_val_if_fail (index == 0, SEAHORSE_VALIDITY_UNKNOWN);
-    return SEAHORSE_VALIDITY_UNKNOWN;
-}
-
-static void
-seahorse_unknown_key_get_property (GObject *object, guint prop_id,
-                                   GValue *value, GParamSpec *pspec)
-{
-    SeahorseUnknownKey *ukey = SEAHORSE_UNKNOWN_KEY (object);
-    
-    switch (prop_id) {
-    case PROP_DISPLAY_NAME:
-        g_value_take_string (value, 
-                seahorse_unknown_key_get_name (SEAHORSE_KEY (ukey), 0));
-        break;
-    case PROP_DISPLAY_ID:
-        g_value_set_string (value, seahorse_key_get_rawid (ukey->keyid)); 
-        break;
-    case PROP_SIMPLE_NAME:
-        g_value_set_string (value, _("Unknown Key"));
-        break;
-    case PROP_FINGERPRINT:
-        g_value_set_string (value, NULL);
-        break;
-    case PROP_VALIDITY:
-        g_value_set_uint (value, SEAHORSE_VALIDITY_UNKNOWN);
-        break;
-    case PROP_TRUST:
-        g_value_set_uint (value, SEAHORSE_VALIDITY_UNKNOWN);
-        break;
-    case PROP_EXPIRES:
-        g_value_set_ulong (value, 0);
-        break;
-    case PROP_STOCK_ID:
-        g_value_set_string (value, "");
-        break;
-    }
-}
-
-static void
-seahorse_unknown_key_set_property (GObject *object, guint prop_id, 
-                                   const GValue *value, GParamSpec *pspec)
-{
-	SeahorseUnknownKey *ukey = SEAHORSE_UNKNOWN_KEY (object);
-
-	switch (prop_id) {
-	case PROP_KEYID:
-		ukey->keyid = g_value_get_uint (value);
-		SEAHORSE_OBJECT (ukey)->_id = ukey->keyid;
-		break;
-	}
-}
-
-static void
-seahorse_unknown_key_finalize (GObject *gobject)
-{
-    G_OBJECT_CLASS (seahorse_unknown_key_parent_class)->finalize (gobject);
-}
-
 static void
-seahorse_unknown_key_class_init (SeahorseUnknownKeyClass *klass)
+seahorse_unknown_class_init (SeahorseUnknownClass *klass)
 {
-    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-    SeahorseKeyClass *key_class = SEAHORSE_KEY_CLASS (klass);
-    
-    seahorse_unknown_key_parent_class = g_type_class_peek_parent (klass);
-    
-    gobject_class->constructor = seahorse_unknown_key_constructor;
-    gobject_class->finalize = seahorse_unknown_key_finalize;
-    gobject_class->set_property = seahorse_unknown_key_set_property;
-    gobject_class->get_property = seahorse_unknown_key_get_property;
-
-    key_class->get_num_names = seahorse_unknown_key_get_num_names;
-    key_class->get_name = seahorse_unknown_key_get_name;
-    key_class->get_name_cn = seahorse_unknown_key_get_name_cn;
-    key_class->get_name_validity = seahorse_unknown_key_get_name_validity;
-    
-    g_object_class_install_property (gobject_class, PROP_KEYID,
-        g_param_spec_uint ("key-id", "The Key ID", "Key identifier",
-                           0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-    g_object_class_install_property (gobject_class, PROP_DISPLAY_NAME,
-        g_param_spec_string ("display-name", "Display Name", "User Displayable name for this key",
-                             "", G_PARAM_READABLE));
-
-    g_object_class_install_property (gobject_class, PROP_DISPLAY_ID,
-        g_param_spec_string ("display-id", "Display ID", "User Displayable id for this key",
-                             "", G_PARAM_READABLE));
-                      
-    g_object_class_install_property (gobject_class, PROP_SIMPLE_NAME,
-        g_param_spec_string ("simple-name", "Simple Name", "Simple name for this key",
-                             "", G_PARAM_READABLE));
-                      
-    g_object_class_install_property (gobject_class, PROP_FINGERPRINT,
-        g_param_spec_string ("fingerprint", "Fingerprint", "Unique fingerprint for this key",
-                             "", G_PARAM_READABLE));
-
-    g_object_class_install_property (gobject_class, PROP_VALIDITY,
-        g_param_spec_uint ("validity", "Validity", "Validity of this key",
-                           0, G_MAXUINT, 0, G_PARAM_READABLE));
-
-    g_object_class_install_property (gobject_class, PROP_TRUST,
-        g_param_spec_uint ("trust", "Trust", "Trust in this key",
-                           0, G_MAXUINT, 0, G_PARAM_READABLE));
-
-    g_object_class_install_property (gobject_class, PROP_EXPIRES,
-        g_param_spec_ulong ("expires", "Expires On", "Date this key expires on",
-                           0, G_MAXULONG, 0, G_PARAM_READABLE));
-                           
-    g_object_class_install_property (gobject_class, PROP_STOCK_ID,
-        g_param_spec_string ("stock-id", "The stock icon", "The stock icon id",
-                             "", G_PARAM_READABLE));
-
+	seahorse_unknown_parent_class = g_type_class_peek_parent (klass);
 }
 
 /* -----------------------------------------------------------------------------
  * PUBLIC METHODS
  */
 
-SeahorseUnknownKey* 
-seahorse_unknown_key_new (SeahorseUnknownSource *sksrc, GQuark keyid)
+SeahorseUnknown* 
+seahorse_unknown_new (SeahorseUnknownSource *source, GQuark id, const gchar *display)
 {
-    SeahorseUnknownKey *ukey;
+	SeahorseUnknown *self;
+    
+	if (!display)
+		display = _("Unavailable");
     
-    ukey = g_object_new (SEAHORSE_TYPE_UNKNOWN_KEY, "key-source", sksrc, 
-                         "key-id", keyid, NULL);
-    return ukey;
+	self = g_object_new (SEAHORSE_TYPE_UNKNOWN, "source", source, 
+	                     "label", display, "id", id, NULL);
+	return self;
 }

Copied: trunk/libseahorse/seahorse-unknown.h (from r2632, /trunk/libseahorse/seahorse-unknown-key.h)
==============================================================================
--- /trunk/libseahorse/seahorse-unknown-key.h	(original)
+++ trunk/libseahorse/seahorse-unknown.h	Sat Nov 29 17:37:20 2008
@@ -19,54 +19,39 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/**
- * SeahorseUnknownKey: Represents an unknown key 
- * 
- * - Derived from SeahorseKey
- * 
- * Properties:
- *   display-name: (gchar*) The display name for the key.
- *   display-id: (gchar*) The display id for the key.
- *   simple-name: (gchar*) Shortened display name for the key (for use in files etc...).
- *   fingerprint: (gchar*) Displayable fingerprint for the key.
- *   validity: (SeahorseValidity) The key validity.
- *   trust: (SeahorseValidity) Trust for the key.
- *   expires: (gulong) Date this key expires or 0.
- *   stock-id: (string) The stock icon id.
- */
- 
-#ifndef __SEAHORSE_UNKNOWN_KEY_H__
-#define __SEAHORSE_UNKNOWN_KEY_H__
+#ifndef __SEAHORSE_UNKNOWN_H__
+#define __SEAHORSE_UNKNOWN_H__
 
 #include <gtk/gtk.h>
 
-#include "seahorse-key.h"
+#include "seahorse-object.h"
 #include "seahorse-unknown-source.h"
 
-#define SEAHORSE_TYPE_UNKNOWN_KEY            (seahorse_unknown_key_get_type ())
-#define SEAHORSE_UNKNOWN_KEY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_UNKNOWN_KEY, SeahorseUnknownKey))
-#define SEAHORSE_UNKNOWN_KEY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_UNKNOWN_KEY, SeahorseUnknownKeyClass))
-#define SEAHORSE_IS_UNKNOWN_KEY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_UNKNOWN_KEY))
-#define SEAHORSE_IS_UNKNOWN_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_UNKNOWN_KEY))
-#define SEAHORSE_UNKNOWN_KEY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_UNKNOWN_KEY, SeahorseUnknownKeyClass))
+#define SEAHORSE_TYPE_UNKNOWN            (seahorse_unknown_get_type ())
+#define SEAHORSE_UNKNOWN(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_UNKNOWN, SeahorseUnknown))
+#define SEAHORSE_UNKNOWN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_UNKNOWN, SeahorseUnknownClass))
+#define SEAHORSE_IS_UNKNOWN(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_UNKNOWN))
+#define SEAHORSE_IS_UNKNOWN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_UNKNOWN))
+#define SEAHORSE_UNKNOWN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_UNKNOWN, SeahorseUnknownClass))
 
-typedef struct _SeahorseUnknownKey SeahorseUnknownKey;
-typedef struct _SeahorseUnknownKeyClass SeahorseUnknownKeyClass;
+typedef struct _SeahorseUnknown SeahorseUnknown;
+typedef struct _SeahorseUnknownClass SeahorseUnknownClass;
 
-struct _SeahorseUnknownKey {
-    SeahorseKey parent;
+struct _SeahorseUnknown {
+    SeahorseObject parent;
 
     /*< public >*/
-    GQuark keyid;
+    gchar *display;
 };
 
-struct _SeahorseUnknownKeyClass {
-    SeahorseKeyClass            parent_class;
+struct _SeahorseUnknownClass {
+    SeahorseObjectClass            parent_class;
 };
 
-GType                   seahorse_unknown_key_get_type         (void);
+GType                seahorse_unknown_get_type         (void);
 
-SeahorseUnknownKey*     seahorse_unknown_key_new              (SeahorseUnknownSource *usrc, 
-                                                               GQuark keyid);
+SeahorseUnknown*     seahorse_unknown_new              (SeahorseUnknownSource *usrc,
+                                                        GQuark id, 
+                                                        const gchar *display);
 
-#endif /* __SEAHORSE_UNKNOWN_KEY_H__ */
+#endif /* __SEAHORSE_UNKNOWN_H__ */

Modified: trunk/libseahorse/seahorse-util.c
==============================================================================
--- trunk/libseahorse/seahorse-util.c	(original)
+++ trunk/libseahorse/seahorse-util.c	Sat Nov 29 17:37:20 2008
@@ -22,9 +22,9 @@
 
 #include "config.h"
 
-#include "seahorse-util.h"
-#include "seahorse-key.h"
 #include "seahorse-gconf.h"
+#include "seahorse-object.h"
+#include "seahorse-util.h"
 
 #include "pgp/seahorse-pgp-module.h"
 
@@ -424,28 +424,28 @@
 
 
 gchar*      
-seahorse_util_filename_for_keys (GList *keys)
+seahorse_util_filename_for_objects (GList *objects)
 {
-    SeahorseKey *skey;
-    gchar *t, *r;
-    
-    g_return_val_if_fail (g_list_length (keys) > 0, NULL);
-
-    if (g_list_length (keys) == 1) {
-        g_return_val_if_fail (SEAHORSE_IS_KEY (keys->data), NULL);
-        skey = SEAHORSE_KEY (keys->data);
-        t = seahorse_key_get_simple_name (skey);
-        if (t == NULL)
-            t = g_strdup (_("Key Data"));
-    } else {
-        t = g_strdup (_("Multiple Keys"));
-    }
+	SeahorseObject *object;
+	const gchar *name;
+	gchar *filename;
+    
+	g_return_val_if_fail (g_list_length (objects) > 0, NULL);
+
+	if (g_list_length (objects) == 1) {
+		g_return_val_if_fail (SEAHORSE_IS_OBJECT (objects->data), NULL);
+		object = SEAHORSE_OBJECT (objects->data);
+		name = seahorse_object_get_nickname (object);
+		if (name == NULL)
+			name = _("Key Data");
+	} else {
+		name = _("Multiple Keys");
+	}
     
-    g_strstrip (t);
-    g_strdelimit (t, bad_filename_chars, '_');
-    r = g_strconcat (t, SEAHORSE_EXT_ASC, NULL);
-    g_free (t);
-    return r;
+	filename = g_strconcat (name, SEAHORSE_EXT_ASC, NULL);
+	g_strstrip (filename);
+	g_strdelimit (filename, bad_filename_chars, '_');
+	return filename;
 }
 
 /** 
@@ -867,23 +867,23 @@
 }
 
 void
-seahorse_util_chooser_set_filename_full (GtkDialog *dialog, GList *keys)
+seahorse_util_chooser_set_filename_full (GtkDialog *dialog, GList *objects)
 {
     gchar *t = NULL;
     
-    if (g_list_length (keys) > 0) {
-        t = seahorse_util_filename_for_keys (keys);
+    if (g_list_length (objects) > 0) {
+        t = seahorse_util_filename_for_objects (objects);
         gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), t);
         g_free (t);
     }
 }
 
 void
-seahorse_util_chooser_set_filename (GtkDialog *dialog, SeahorseKey *skey)
+seahorse_util_chooser_set_filename (GtkDialog *dialog, SeahorseObject *object)
 {
-	GList *keys = g_list_append (NULL, skey);
-	seahorse_util_chooser_set_filename_full (dialog, keys);
-	g_list_free (keys);
+	GList *objects = g_list_append (NULL, object);
+	seahorse_util_chooser_set_filename_full (dialog, objects);
+	g_list_free (objects);
 }
     
 gchar*      

Modified: trunk/libseahorse/seahorse-util.h
==============================================================================
--- trunk/libseahorse/seahorse-util.h	(original)
+++ trunk/libseahorse/seahorse-util.h	Sat Nov 29 17:37:20 2008
@@ -38,7 +38,7 @@
 const AvahiPoll* seahorse_util_dns_sd_get_poll ();
 #endif
 
-struct _SeahorseKey;
+struct _SeahorseObject;
 
 typedef enum {
     SEAHORSE_CRYPT_SUFFIX,
@@ -87,7 +87,7 @@
 gboolean    seahorse_util_printf_fd         (int fd, 
                                              const char* data, ...);
                              
-gchar*      seahorse_util_filename_for_keys (GList *keys);
+gchar*      seahorse_util_filename_for_objects (GList *objects);
                                              
 gboolean    seahorse_util_uri_exists        (const gchar* uri);
 
@@ -125,10 +125,10 @@
 void        seahorse_util_chooser_show_archive_files    (GtkDialog *dialog);
 
 void        seahorse_util_chooser_set_filename_full     (GtkDialog *dialog, 
-                                                         GList *keys);
+                                                         GList *objects);
 
 void        seahorse_util_chooser_set_filename          (GtkDialog *dialog, 
-                                                         struct _SeahorseKey *skey);
+                                                         struct _SeahorseObject *object);
 
 gchar*      seahorse_util_chooser_open_prompt           (GtkDialog *dialog);
 

Modified: trunk/libseahorse/vala-build.stamp
==============================================================================
--- trunk/libseahorse/vala-build.stamp	(original)
+++ trunk/libseahorse/vala-build.stamp	Sat Nov 29 17:37:20 2008
@@ -1 +1 @@
-1220758634
+1227470261

Modified: trunk/pgp/libseahorse-pgp-c.vapi
==============================================================================
--- trunk/pgp/libseahorse-pgp-c.vapi	(original)
+++ trunk/pgp/libseahorse-pgp-c.vapi	Sat Nov 29 17:37:20 2008
@@ -49,7 +49,7 @@
         }
         
         [CCode (cheader_filename = "seahorse-pgp-key.h")]
-        public class Key : Seahorse.Key {
+        public class Key : Seahorse.Object {
         
         }
 

Modified: trunk/pgp/seahorse-hkp-source.c
==============================================================================
--- trunk/pgp/seahorse-hkp-source.c	(original)
+++ trunk/pgp/seahorse-hkp-source.c	Sat Nov 29 17:37:20 2008
@@ -514,7 +514,6 @@
     if (prev != NULL) {
         g_return_if_fail (SEAHORSE_IS_PGP_KEY (prev));
         gpgmex_combine_keys (SEAHORSE_PGP_KEY (prev)->pubkey, key);
-        seahorse_object_fire_changed (prev, SKEY_CHANGE_UIDS);
         return;
     }
 
@@ -795,7 +794,7 @@
         return seahorse_operation_new_complete (NULL);
 
     /* TODO: Does this actually work? */
-    return seahorse_hkp_source_search (src, seahorse_key_get_rawid (keyid));        
+    return seahorse_hkp_source_search (src, seahorse_pgp_key_get_rawid (keyid));
 }
 
 static SeahorseOperation* 
@@ -914,7 +913,7 @@
     for (l = keyids; l; l = g_slist_next (l)) {
 
         /* Get the key id and limit it to 8 characters */
-        fpr = (const char*)seahorse_key_get_rawid (GPOINTER_TO_UINT (l->data));
+        fpr = seahorse_pgp_key_get_rawid (GPOINTER_TO_UINT (l->data));
         len = strlen (fpr);
         if (len > 8)
             fpr += (len - 8);
@@ -965,13 +964,13 @@
 
 	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));
+	                           0, G_MAXUINT, SEAHORSE_TAG_INVALID, 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));
 	    
-	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_HKP_SOURCE, "key-source", "remote", SEAHORSE_PGP_STR, NULL);
+	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_HKP_SOURCE, "source", "remote", SEAHORSE_PGP_STR, NULL);
 	seahorse_servers_register_type ("hkp", _("HTTP Key Server"), seahorse_hkp_is_valid_uri);
 }
 

Modified: trunk/pgp/seahorse-ldap-source.c
==============================================================================
--- trunk/pgp/seahorse-ldap-source.c	(original)
+++ trunk/pgp/seahorse-ldap-source.c	Sat Nov 29 17:37:20 2008
@@ -761,7 +761,6 @@
     if (prev != NULL) {
         g_return_if_fail (SEAHORSE_IS_PGP_KEY (prev));
         gpgmex_combine_keys (SEAHORSE_PGP_KEY (prev)->pubkey, key);
-        seahorse_object_fire_changed (prev, SKEY_CHANGE_UIDS);
         return;
     }
 
@@ -1296,7 +1295,7 @@
         return seahorse_operation_new_complete (NULL);
 
     lop = start_search_operation_fpr (SEAHORSE_LDAP_SOURCE (src), 
-                                      seahorse_key_get_rawid (keyid));
+                                      seahorse_pgp_key_get_rawid (keyid));
     g_return_val_if_fail (lop != NULL, NULL);
 
     seahorse_server_source_take_operation (SEAHORSE_SERVER_SOURCE (src),
@@ -1376,7 +1375,7 @@
     
     for (l = keyids; l; l = g_slist_next (l)) 
         fingerprints = g_slist_prepend (fingerprints, 
-            g_strdup (seahorse_key_get_rawid (GPOINTER_TO_UINT (l->data))));
+            g_strdup (seahorse_pgp_key_get_rawid (GPOINTER_TO_UINT (l->data))));
     fingerprints = g_slist_reverse (fingerprints);
 
     lop = start_get_operation_multiple (lsrc, fingerprints, output);
@@ -1406,13 +1405,13 @@
     
 	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));
+	                           0, G_MAXUINT, SEAHORSE_TAG_INVALID, 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));
 	    
-	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_LDAP_SOURCE, "key-source", "remote", SEAHORSE_PGP_STR, NULL);
+	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_LDAP_SOURCE, "source", "remote", SEAHORSE_PGP_STR, NULL);
 	seahorse_servers_register_type ("ldap", _("LDAP Key Server"), seahorse_ldap_is_valid_uri);
 }
 

Modified: trunk/pgp/seahorse-pgp-add-subkey.c
==============================================================================
--- trunk/pgp/seahorse-pgp-add-subkey.c	(original)
+++ trunk/pgp/seahorse-pgp-add-subkey.c	Sat Nov 29 17:37:20 2008
@@ -25,7 +25,7 @@
 
 #include "egg-datetime.h"
  
-#include "seahorse-key-widget.h"
+#include "seahorse-object-widget.h"
 #include "seahorse-util.h"
 
 #include "seahorse-pgp-dialogs.h"
@@ -108,7 +108,7 @@
 static void
 ok_clicked (GtkButton *button, SeahorseWidget *swidget)
 {
-	SeahorseKeyWidget *skwidget;
+	SeahorseObjectWidget *skwidget;
 	SeahorseKeyEncType real_type;
 	gint type;
 	guint length;
@@ -119,7 +119,7 @@
 	GtkTreeModel *model;
     GtkTreeIter iter;
 	
-	skwidget = SEAHORSE_KEY_WIDGET (swidget);
+	skwidget = SEAHORSE_OBJECT_WIDGET (swidget);
 	
 	combo = GTK_COMBO_BOX (glade_xml_get_widget (swidget->xml, "type"));
 	gtk_combo_box_get_active_iter (combo, &iter);
@@ -158,7 +158,7 @@
 	
 	widget = glade_xml_get_widget (swidget->xml, swidget->name);
 	gtk_widget_set_sensitive (widget, FALSE);
-	err = seahorse_pgp_key_pair_op_add_subkey (SEAHORSE_PGP_KEY (skwidget->skey), 
+	err = seahorse_pgp_key_pair_op_add_subkey (SEAHORSE_PGP_KEY (skwidget->object), 
                                            real_type, length, expires);
 	gtk_widget_set_sensitive (widget, TRUE);
 	
@@ -172,20 +172,17 @@
 seahorse_pgp_add_subkey_new (SeahorsePGPKey *pkey, GtkWindow *parent)
 {
 	SeahorseWidget *swidget;
-    gchar *userid;
-    GtkComboBox* combo;
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-    GtkCellRenderer *renderer;
-    GtkWidget *widget;
+	GtkComboBox* combo;
+	GtkTreeModel *model;
+	GtkTreeIter iter;
+	GtkCellRenderer *renderer;
+	GtkWidget *widget;
 	
-	swidget = seahorse_key_widget_new ("add-subkey", parent, SEAHORSE_KEY (pkey));
+	swidget = seahorse_object_widget_new ("add-subkey", parent, SEAHORSE_OBJECT (pkey));
 	g_return_if_fail (swidget != NULL);
 	
-    userid = seahorse_key_get_name (SEAHORSE_KEY (pkey), 0);
 	gtk_window_set_title (GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)),
-		g_strdup_printf (_("Add subkey to %s"), userid));
-    g_free (userid);
+		g_strdup_printf (_("Add subkey to %s"), seahorse_object_get_label (SEAHORSE_OBJECT (pkey))));
     
     combo = GTK_COMBO_BOX (glade_xml_get_widget (swidget->xml, "type"));
     model = GTK_TREE_MODEL (gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_INT));

Modified: trunk/pgp/seahorse-pgp-add-uid.c
==============================================================================
--- trunk/pgp/seahorse-pgp-add-uid.c	(original)
+++ trunk/pgp/seahorse-pgp-add-uid.c	Sat Nov 29 17:37:20 2008
@@ -25,7 +25,7 @@
 
 #include <glib/gi18n.h>
  
-#include "seahorse-key-widget.h"
+#include "seahorse-object-widget.h"
 #include "seahorse-util.h"
 
 #include "seahorse-pgp-dialogs.h"
@@ -66,11 +66,11 @@
 static void
 ok_clicked (GtkButton *button, SeahorseWidget *swidget)
 {
-	SeahorseKey *skey;
+	SeahorseObject *object;
 	const gchar *name, *email, *comment;
 	gpgme_error_t err;
 	
-	skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
+	object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
 	
 	name = gtk_entry_get_text (GTK_ENTRY (
 		glade_xml_get_widget (swidget->xml, NAME)));
@@ -79,7 +79,7 @@
 	comment = gtk_entry_get_text (GTK_ENTRY (
 		glade_xml_get_widget (swidget->xml, "comment")));
 	
-	err = seahorse_pgp_key_pair_op_add_uid (SEAHORSE_PGP_KEY (skey),
+	err = seahorse_pgp_key_pair_op_add_uid (SEAHORSE_PGP_KEY (object),
 		                                name, email, comment);
 	if (!GPG_IS_OK (err))
 		seahorse_pgp_handle_gpgme_error (err, _("Couldn't add user id"));
@@ -97,15 +97,14 @@
 seahorse_pgp_add_uid_new (SeahorsePGPKey *pkey, GtkWindow *parent)
 {
 	SeahorseWidget *swidget;
-    gchar *userid;
+	const gchar *userid;
 	
-	swidget = seahorse_key_widget_new ("add-uid", parent, SEAHORSE_KEY (pkey));
+	swidget = seahorse_object_widget_new ("add-uid", parent, SEAHORSE_OBJECT (pkey));
 	g_return_if_fail (swidget != NULL);
 	
-    userid = seahorse_key_get_name (SEAHORSE_KEY (pkey), 0);
+	userid = seahorse_object_get_label (SEAHORSE_OBJECT (pkey));
 	gtk_window_set_title (GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)),
 		g_strdup_printf (_("Add user ID to %s"), userid));
-    g_free (userid);
   
 	glade_xml_signal_connect_data (swidget->xml, "ok_clicked",
 		G_CALLBACK (ok_clicked), swidget);

Modified: trunk/pgp/seahorse-pgp-commands.c
==============================================================================
--- trunk/pgp/seahorse-pgp-commands.c	(original)
+++ trunk/pgp/seahorse-pgp-commands.c	Sat Nov 29 17:37:20 2008
@@ -148,7 +148,7 @@
 	do {
 		char* _tmp6;
 		_tmp6 = NULL;
-		message = (_tmp6 = g_strdup_printf (_ ("Are you sure you want to permanently delete %s?"), seahorse_object_get_display_name (((SeahorseObject*) (((SeahorseObject*) (to_delete->data)))))), (message = (g_free (message), NULL)), _tmp6);
+		message = (_tmp6 = g_strdup_printf (_ ("Are you sure you want to permanently delete %s?"), seahorse_object_get_label (((SeahorseObject*) (((SeahorseObject*) (to_delete->data)))))), (message = (g_free (message), NULL)), _tmp6);
 		break;
 	} while (0); else
 	do {

Modified: trunk/pgp/seahorse-pgp-commands.vala
==============================================================================
--- trunk/pgp/seahorse-pgp-commands.vala	(original)
+++ trunk/pgp/seahorse-pgp-commands.vala	Sat Nov 29 17:37:20 2008
@@ -107,7 +107,7 @@
 			case 0:
 				return null;
 			case 1:
-				message = _("Are you sure you want to permanently delete %s?").printf(to_delete.data.display_name);
+				message = _("Are you sure you want to permanently delete %s?").printf(to_delete.data.label);
 				break;
 			default:
 				if (num_keys > 0 && num_identities > 0) 

Modified: trunk/pgp/seahorse-pgp-expires.c
==============================================================================
--- trunk/pgp/seahorse-pgp-expires.c	(original)
+++ trunk/pgp/seahorse-pgp-expires.c	Sat Nov 29 17:37:20 2008
@@ -25,7 +25,7 @@
 
 #include <glib/gi18n.h>
  
-#include "seahorse-key-widget.h"
+#include "seahorse-object-widget.h"
 #include "seahorse-libdialogs.h"
 #include "seahorse-util.h"
 
@@ -35,20 +35,19 @@
 static void
 ok_clicked (GtkButton *button, SeahorseWidget *swidget)
 {
-	SeahorseKeyWidget *skwidget;
-    SeahorsePGPKey *pkey;
+	SeahorseObjectWidget *skwidget;
+	SeahorsePGPKey *pkey;
 	GtkWidget *w; 
 	gpgme_subkey_t subkey;
 	gpgme_error_t err;
 	guint index;
-    time_t expiry = 0;
-	
-	skwidget = SEAHORSE_KEY_WIDGET (swidget);
-    pkey = SEAHORSE_PGP_KEY (skwidget->skey);
-	index = skwidget->index;	
-
+	time_t expiry = 0;
 	struct tm t;
-
+	
+	skwidget = SEAHORSE_OBJECT_WIDGET (swidget);
+	pkey = SEAHORSE_PGP_KEY (skwidget->object);
+	index = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (skwidget), "index"));
+	
 	w = glade_xml_get_widget (swidget->xml, "expire");
 	if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w))) {
 		
@@ -60,12 +59,11 @@
 		expiry = mktime (&t);
 	}
 	
-    subkey = seahorse_pgp_key_get_nth_subkey (pkey, index);    
-    g_return_if_fail (subkey != NULL);
-    
-    if (expiry != subkey->expires) {
-        err = seahorse_pgp_key_pair_op_set_expires (pkey, index, expiry);
+	subkey = seahorse_pgp_key_get_nth_subkey (pkey, index);    
+	g_return_if_fail (subkey != NULL);
     
+	if (expiry != subkey->expires) {
+		err = seahorse_pgp_key_pair_op_set_expires (pkey, index, expiry);
 		if (!GPG_IS_OK (err))
 			seahorse_pgp_handle_gpgme_error (err, _("Couldn't change expiry date"));
 	}
@@ -89,53 +87,53 @@
 seahorse_pgp_expires_new (SeahorsePGPKey *pkey, GtkWindow *parent, guint index)
 {
 	SeahorseWidget *swidget;
-    gpgme_subkey_t subkey;
-    GtkWidget *date, *expire;
+	gpgme_subkey_t subkey;
+	GtkWidget *date, *expire;
 	gchar *title;
-    gchar *userid;
+	const gchar *userid;
 	
 	g_return_if_fail (pkey != NULL && SEAHORSE_IS_PGP_KEY (pkey));
 	g_return_if_fail (index <= seahorse_pgp_key_get_num_subkeys (pkey));
 	
-	swidget = seahorse_key_widget_new_with_index ("expires", parent, SEAHORSE_KEY (pkey), index);
+	swidget = seahorse_object_widget_new ("expires", parent, SEAHORSE_OBJECT (pkey));
 	g_return_if_fail (swidget != NULL);
 	
+	g_object_set_data (G_OBJECT (swidget), "index", GUINT_TO_POINTER (index));
 	glade_xml_signal_connect_data (swidget->xml, "on_calendar_change_button_clicked",
-		G_CALLBACK (ok_clicked), swidget);
+	                               G_CALLBACK (ok_clicked), swidget);
     
-    date = glade_xml_get_widget (swidget->xml, "calendar");    
-    g_return_if_fail (date != NULL);
+	date = glade_xml_get_widget (swidget->xml, "calendar");    
+	g_return_if_fail (date != NULL);
     
-    subkey = seahorse_pgp_key_get_nth_subkey (pkey, index);
-    g_return_if_fail (subkey != NULL);
+	subkey = seahorse_pgp_key_get_nth_subkey (pkey, index);
+	g_return_if_fail (subkey != NULL);
 
 	expire = glade_xml_get_widget (swidget->xml, "expire");
 	glade_xml_signal_connect_data (swidget->xml, "on_expire_toggled",
-		G_CALLBACK (expires_toggled), swidget);
-	if (!seahorse_key_get_expires (SEAHORSE_KEY (pkey))) {
+	                               G_CALLBACK (expires_toggled), swidget);
+	if (!seahorse_pgp_key_get_expires (pkey)) {
 		gtk_toggle_button_set_active  (GTK_TOGGLE_BUTTON (expire), TRUE);
-    	gtk_widget_set_sensitive (date, FALSE);
+		gtk_widget_set_sensitive (date, FALSE);
 	} else {
 		gtk_toggle_button_set_active  (GTK_TOGGLE_BUTTON (expire), FALSE);
-    	gtk_widget_set_sensitive (date, TRUE);
+		gtk_widget_set_sensitive (date, TRUE);
 	}
     
-    if (subkey->expires) {
-        struct tm t;
-        time_t time = (time_t)subkey->expires;
-        if (gmtime_r(&time, &t)) {
-            gtk_calendar_select_month (GTK_CALENDAR (date), t.tm_mon, t.tm_year + 1900);
-            gtk_calendar_select_day (GTK_CALENDAR (date), t.tm_mday);
-        }
-    }
+	if (subkey->expires) {
+		struct tm t;
+		time_t time = (time_t)subkey->expires;
+		if (gmtime_r(&time, &t)) {
+			gtk_calendar_select_month (GTK_CALENDAR (date), t.tm_mon, t.tm_year + 1900);
+			gtk_calendar_select_day (GTK_CALENDAR (date), t.tm_mday);
+		}
+	}
 	
-    userid = seahorse_key_get_name (SEAHORSE_KEY (pkey), 0);
+	userid = seahorse_object_get_label (SEAHORSE_OBJECT (pkey));
 	if (index)
 		title = g_strdup_printf (_("Expiry for Subkey %d of %s"), index, userid);
 	else
 		title = g_strdup_printf (_("Expiry for %s"), userid);
-	g_free (userid);
    
 	gtk_window_set_title (GTK_WINDOW (glade_xml_get_widget (swidget->xml,
-		                  swidget->name)), title);
+		              swidget->name)), title);
 }

Modified: trunk/pgp/seahorse-pgp-generate.c
==============================================================================
--- trunk/pgp/seahorse-pgp-generate.c	(original)
+++ trunk/pgp/seahorse-pgp-generate.c	Sat Nov 29 17:37:20 2008
@@ -159,7 +159,7 @@
         egg_datetime_get_as_time_t (EGG_DATETIME (widget), &expires);
     }
 
-    sksrc = SEAHORSE_PGP_SOURCE (g_object_get_data (G_OBJECT (swidget), "key-source"));
+    sksrc = SEAHORSE_PGP_SOURCE (g_object_get_data (G_OBJECT (swidget), "source"));
     g_assert (SEAHORSE_IS_PGP_SOURCE (sksrc));
     
     /* Less confusing with less on the screen */
@@ -271,7 +271,7 @@
     gtk_box_pack_start (GTK_BOX (widget), egg_datetime_new_from_time_t (expires), TRUE, TRUE, 0);
     
     g_object_ref (sksrc);
-    g_object_set_data_full (G_OBJECT (swidget), "key-source", sksrc, g_object_unref);
+    g_object_set_data_full (G_OBJECT (swidget), "source", sksrc, g_object_unref);
     
     glade_xml_signal_connect_data (swidget->xml, "on_entry_changed",
                                    G_CALLBACK (entry_changed), swidget);

Modified: trunk/pgp/seahorse-pgp-key-op.c
==============================================================================
--- trunk/pgp/seahorse-pgp-key-op.c	(original)
+++ trunk/pgp/seahorse-pgp-key-op.c	Sat Nov 29 17:37:20 2008
@@ -164,7 +164,7 @@
     SeahorsePGPSource *psrc;
 	gpgme_error_t err;
     
-    psrc = SEAHORSE_PGP_SOURCE (seahorse_key_get_source (SEAHORSE_KEY (pkey)));
+    psrc = SEAHORSE_PGP_SOURCE (seahorse_object_get_source (SEAHORSE_OBJECT (pkey)));
     g_return_val_if_fail (psrc && SEAHORSE_IS_PGP_SOURCE (psrc), GPG_E (GPG_ERR_INV_KEYRING));
 	
 	err = gpgme_op_delete (psrc->gctx, pkey->pubkey, secret);
@@ -291,18 +291,18 @@
 }
 
 static gpgme_error_t
-edit_key (SeahorsePGPKey *pkey, SeahorseEditParm *parms, SeahorseKeyChange change)
+edit_key (SeahorsePGPKey *pkey, SeahorseEditParm *parms)
 {
     SeahorsePGPSource *psrc;
     gpgme_error_t err;
     
-    psrc = SEAHORSE_PGP_SOURCE (seahorse_key_get_source (SEAHORSE_KEY (pkey)));
+    psrc = SEAHORSE_PGP_SOURCE (seahorse_object_get_source (SEAHORSE_OBJECT (pkey)));
     g_return_val_if_fail (psrc && SEAHORSE_IS_PGP_SOURCE (psrc), GPG_E (GPG_ERR_INV_KEYRING));
   
     err = edit_gpgme_key (psrc, pkey->pubkey, parms);
 
-    if (GPG_IS_OK (err) && (change != 0))
-        seahorse_object_fire_changed (SEAHORSE_OBJECT (pkey), change);
+    if (GPG_IS_OK (err))
+	seahorse_pgp_key_reload (pkey);
     
     return err;
 }
@@ -509,7 +509,7 @@
                                 (options & SIGN_LOCAL) ? "l" : "");
     
     if (signer) {
-        sksrc = seahorse_key_get_source (SEAHORSE_KEY (pkey));
+        sksrc = seahorse_object_get_source (SEAHORSE_OBJECT (pkey));
         
         g_assert (SEAHORSE_IS_PGP_SOURCE (sksrc));
         g_assert (SEAHORSE_PGP_SOURCE (sksrc)->gctx);
@@ -525,7 +525,7 @@
     
     parms = seahorse_edit_parm_new (SIGN_START, sign_action, sign_transit, sign_parm);
     
-    err =  edit_key (pkey, parms, SKEY_CHANGE_SIGNERS);
+    err =  edit_key (pkey, parms);
     g_free (sign_parm->command);
  
     /* If it was already signed then it's not an error */
@@ -655,11 +655,11 @@
 	gpgme_error_t err;
 	
 	g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (pkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));    
-	g_return_val_if_fail (seahorse_key_get_usage (SEAHORSE_KEY (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
+	g_return_val_if_fail (seahorse_object_get_usage (SEAHORSE_OBJECT (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
 	
 	parms = seahorse_edit_parm_new (PASS_START, edit_pass_action, edit_pass_transit, NULL);
 	
-	err = edit_key (pkey, parms, SKEY_CHANGE_PASS);
+	err = edit_key (pkey, parms);
 	
 	return err;
 }
@@ -797,9 +797,9 @@
 	
 	g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (pkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));
 	g_return_val_if_fail (trust >= GPGME_VALIDITY_UNKNOWN, GPG_E (GPG_ERR_INV_VALUE));
-	g_return_val_if_fail (seahorse_key_get_trust (SEAHORSE_KEY (pkey)) != trust, GPG_E (GPG_ERR_INV_VALUE));
+	g_return_val_if_fail (seahorse_pgp_key_get_trust (pkey) != trust, GPG_E (GPG_ERR_INV_VALUE));
 	
-	if (seahorse_key_get_usage (SEAHORSE_KEY (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY)
+	if (seahorse_object_get_usage (SEAHORSE_OBJECT (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY)
 		g_return_val_if_fail (trust != SEAHORSE_VALIDITY_UNKNOWN, GPG_E (GPG_ERR_INV_VALUE));
 	else
 		g_return_val_if_fail (trust != SEAHORSE_VALIDITY_ULTIMATE, GPG_E (GPG_ERR_INV_VALUE));
@@ -827,7 +827,7 @@
 	parms = seahorse_edit_parm_new (TRUST_START, edit_trust_action,
 		edit_trust_transit, (gpointer)menu_choice);
 	
-	return edit_key (pkey, parms, SKEY_CHANGE_TRUST);
+	return edit_key (pkey, parms);
 }
 
 typedef enum {
@@ -925,7 +925,7 @@
 	
 	parms = seahorse_edit_parm_new (DISABLE_START, edit_disable_action, edit_disable_transit, command);
 	
-	return edit_key (pkey, parms, SKEY_CHANGE_DISABLED);
+	return edit_key (pkey, parms);
 }
 
 typedef struct
@@ -1067,7 +1067,7 @@
 	gpgme_subkey_t subkey;
 	
     g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (pkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));    
-    g_return_val_if_fail (seahorse_key_get_usage (SEAHORSE_KEY (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
+    g_return_val_if_fail (seahorse_object_get_usage (SEAHORSE_OBJECT (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
 
 	subkey = seahorse_pgp_key_get_nth_subkey (pkey, index);
 
@@ -1080,7 +1080,7 @@
 	
 	parms = seahorse_edit_parm_new (EXPIRE_START, edit_expire_action, edit_expire_transit, exp_parm);
 	
-	return edit_key (pkey, parms, SKEY_CHANGE_EXPIRES);
+	return edit_key (pkey, parms);
 }
 
 typedef enum {
@@ -1204,13 +1204,13 @@
 	
     g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (pkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));    
     g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (revoker), GPG_E (GPG_ERR_WRONG_KEY_USAGE));    
-    g_return_val_if_fail (seahorse_key_get_usage (SEAHORSE_KEY (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
-    g_return_val_if_fail (seahorse_key_get_usage (SEAHORSE_KEY (revoker)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
+    g_return_val_if_fail (seahorse_object_get_usage (SEAHORSE_OBJECT (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
+    g_return_val_if_fail (seahorse_object_get_usage (SEAHORSE_OBJECT (revoker)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
 
 	parms = seahorse_edit_parm_new (ADD_REVOKER_START, add_revoker_action,
 		add_revoker_transit, (gpointer)seahorse_pgp_key_get_id (revoker->pubkey, 0));
 	
-	return edit_key (pkey, parms, SKEY_CHANGE_REVOKERS);
+	return edit_key (pkey, parms);
 }
 
 typedef enum {
@@ -1356,7 +1356,7 @@
 	UidParm *uid_parm;
 	
     g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (pkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));    
-    g_return_val_if_fail (seahorse_key_get_usage (SEAHORSE_KEY (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
+    g_return_val_if_fail (seahorse_object_get_usage (SEAHORSE_OBJECT (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
 	g_return_val_if_fail (name != NULL && strlen (name) >= 5, GPG_E (GPG_ERR_INV_VALUE));
 	
 	uid_parm = g_new (UidParm, 1);
@@ -1366,7 +1366,7 @@
 	
 	parms = seahorse_edit_parm_new (ADD_UID_START, add_uid_action, add_uid_transit, uid_parm);
 	
-	return edit_key (pkey, parms, SKEY_CHANGE_UIDS);
+	return edit_key (pkey, parms);
 }
 
 typedef enum {
@@ -1500,7 +1500,7 @@
 	SubkeyParm *key_parm;
 	
     g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (pkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));    
-    g_return_val_if_fail (seahorse_key_get_usage (SEAHORSE_KEY (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
+    g_return_val_if_fail (seahorse_object_get_usage (SEAHORSE_OBJECT (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY, GPG_E (GPG_ERR_WRONG_KEY_USAGE));
 	
 	/* Check length range & type */
 	switch (type) {
@@ -1525,7 +1525,7 @@
 	
 	parms = seahorse_edit_parm_new (ADD_KEY_START, add_key_action, add_key_transit, key_parm);
 	
-	return edit_key (pkey, parms, SKEY_CHANGE_SUBKEYS);
+	return edit_key (pkey, parms);
 }
 
 typedef enum {
@@ -1651,7 +1651,7 @@
 	parms = seahorse_edit_parm_new (DEL_KEY_START, del_key_action,
 		del_key_transit, (gpointer)index);
 	
-	return edit_key (pkey, parms, SKEY_CHANGE_SUBKEYS);
+	return edit_key (pkey, parms);
 }
 
 typedef struct
@@ -1841,7 +1841,7 @@
 	parms = seahorse_edit_parm_new (REV_SUBKEY_START, rev_subkey_action,
 		rev_subkey_transit, rev_parm);
 	
-	return edit_key (pkey, parms, SKEY_CHANGE_SUBKEYS);
+	return edit_key (pkey, parms);
 }
 
 typedef struct {
@@ -1976,7 +1976,7 @@
     parms = seahorse_edit_parm_new (PRIMARY_START, primary_action,
                 primary_transit, pri_parm);
  
-    return edit_key (pkey, parms, SKEY_CHANGE_UIDS);    
+    return edit_key (pkey, parms);
 }
 
 
@@ -2111,7 +2111,7 @@
     SeahorsePGPUid *uid;
     guint real_index = seahorse_pgp_key_get_actual_uid(pkey, index);
  
-    g_return_val_if_fail (SEAHORSE_IS_KEY (pkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));
+    g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (pkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));
     
     /* Check index range */
     DEBUG_OPERATION(("Del UID: uid %u\n", index));
@@ -2128,7 +2128,7 @@
     parms = seahorse_edit_parm_new (DEL_UID_START, del_uid_action,
                 del_uid_transit, del_uid_parm);
  
-    return edit_key (pkey, parms, SKEY_CHANGE_UIDS);    
+    return edit_key (pkey, parms);
 }
 
 typedef struct {
@@ -2264,7 +2264,7 @@
                                     photoid_add_transit, photoid_add_parm);
 	
 	/* add photoid */
-	err = edit_key (pkey, parms, SKEY_CHANGE_PHOTOS);
+	err = edit_key (pkey, parms);
 	
     return err;
 }
@@ -2293,7 +2293,7 @@
     parms = seahorse_edit_parm_new (DEL_UID_START, del_uid_action,
                                     del_uid_transit, del_uid_parm);
  
-    return edit_key (pkey, parms, SKEY_CHANGE_PHOTOS);    
+    return edit_key (pkey, parms);
 }
 
 typedef struct {
@@ -2555,5 +2555,5 @@
     parms = seahorse_edit_parm_new (PRIMARY_START, primary_action,
                 primary_transit, pri_parm);
  
-    return edit_key (pkey, parms, SKEY_CHANGE_PHOTOS);    
+    return edit_key (pkey, parms);
 }

Modified: trunk/pgp/seahorse-pgp-key-properties.c
==============================================================================
--- trunk/pgp/seahorse-pgp-key-properties.c	(original)
+++ trunk/pgp/seahorse-pgp-key-properties.c	Sat Nov 29 17:37:20 2008
@@ -31,23 +31,23 @@
 
 #include "seahorse-gconf.h"
 #include "seahorse-gtkstock.h"
-#include "seahorse-key.h"
-#include "seahorse-key-model.h"
-#include "seahorse-key-widget.h"
+#include "seahorse-object.h"
+#include "seahorse-object-model.h"
+#include "seahorse-object-widget.h"
 #include "seahorse-util.h"
 
 #include "seahorse-pgp-dialogs.h"
 #include "seahorse-pgp-key.h"
 #include "seahorse-pgp-key-op.h"
 
+#include "common/seahorse-bind.h"
+
 #include <time.h>
 
 #define NOTEBOOK "notebook"
 
 /* Forward declarations */
 static void properties_response (GtkDialog *dialog, int response, SeahorseWidget *swidget);
-static void properties_destroyed (GtkObject *object, SeahorseWidget *swidget);
-
 
 static void 
 show_glade_widget (SeahorseWidget *swidget, const gchar *name, gboolean show)
@@ -135,23 +135,22 @@
 signature_row_activated(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *arg2, 
                         SeahorseWidget *swidget)
 {
-    SeahorseKey *skey = NULL;
-    GtkTreeModel *model;
-    GtkTreeIter iter;
+	SeahorseObject *object = NULL;
+	GtkTreeModel *model;
+	GtkTreeIter iter;
     
-    model = gtk_tree_view_get_model (treeview);
+	model = gtk_tree_view_get_model (treeview);
     
-    if (GTK_IS_TREE_MODEL_FILTER (model)) 
-        model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
+	if (GTK_IS_TREE_MODEL_FILTER (model)) 
+		model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
         
-    g_return_if_fail (gtk_tree_model_get_iter (model, &iter, path));
+	g_return_if_fail (gtk_tree_model_get_iter (model, &iter, path));
     
-    skey = seahorse_key_model_get_row_key (SEAHORSE_KEY_MODEL (model), &iter);
-    
-	if (skey != NULL) {
-	   if (SEAHORSE_IS_PGP_KEY (skey))
-	       seahorse_pgp_key_properties_show (SEAHORSE_PGP_KEY (skey), GTK_WINDOW (gtk_widget_get_parent (seahorse_widget_get_toplevel (swidget))));
-    }
+	object = seahorse_object_model_get_row_key (SEAHORSE_OBJECT_MODEL (model), &iter);
+	if (object != NULL && SEAHORSE_IS_PGP_KEY (object)) {
+		seahorse_pgp_key_properties_show (SEAHORSE_PGP_KEY (object), 
+		                                  GTK_WINDOW (gtk_widget_get_parent (seahorse_widget_get_toplevel (swidget))));
+	}
 }
 
 static GSList*
@@ -197,25 +196,22 @@
 static void
 names_add_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-	SeahorseKey *skey;
-    
-	skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-	seahorse_pgp_add_uid_new (SEAHORSE_PGP_KEY (skey), 
+	seahorse_pgp_add_uid_new (SEAHORSE_PGP_KEY (SEAHORSE_OBJECT_WIDGET (swidget)->object), 
 	                          GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)));
 }
 
 static void 
 names_primary_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     gpgme_error_t err;
     gint index;
     
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
     index = names_get_selected_uid (swidget);
     
     if (index > 0) {
-        err = seahorse_pgp_key_op_primary_uid (SEAHORSE_PGP_KEY (skey), index);
+        err = seahorse_pgp_key_op_primary_uid (SEAHORSE_PGP_KEY (object), index);
         if (!GPG_IS_OK (err)) 
             seahorse_pgp_handle_gpgme_error (err, _("Couldn't change primary user ID"));
     }
@@ -224,21 +220,23 @@
 static void 
 names_delete_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-	SeahorseKey *skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-	SeahorsePGPKey *pkey = SEAHORSE_PGP_KEY (skey);
+	SeahorseObject *object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+	SeahorsePGPKey *pkey = SEAHORSE_PGP_KEY (object);
+	SeahorsePGPUid *uid;
 	gint index = names_get_selected_uid (swidget);
 	gboolean ret;
-	gchar *userid, *message; 
+	gchar *message; 
 	gpgme_error_t gerr;
     
 	if (index < 1)
 		return;
 	
 	/* TODO: This whole index thing is messed up */
-	userid = seahorse_key_get_name (skey, index - 1);
-	message = g_strdup_printf (_("Are you sure you want to permanently delete the '%s' user ID?"), userid);
-	g_free (userid);
+	uid = SEAHORSE_PGP_UID (seahorse_object_get_nth_child (object, index));
+	g_return_if_fail (uid);
 	
+	message = g_strdup_printf (_("Are you sure you want to permanently delete the '%s' user ID?"), 
+	                           seahorse_object_get_label (SEAHORSE_OBJECT (uid)));
 	ret = seahorse_util_prompt_delete (message, seahorse_widget_get_toplevel (swidget));
 	g_free (message);
 	
@@ -253,22 +251,22 @@
 static void 
 names_sign_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-	SeahorseKey *skey;
+	SeahorseObject *object;
 	gint index;
 	GList *keys = NULL;
 
-	skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
+	object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
 	index = names_get_selected_uid (swidget);
 
 	if (index >= 1) {
-		seahorse_pgp_sign_prompt (SEAHORSE_PGP_KEY (skey), 
+		seahorse_pgp_sign_prompt (SEAHORSE_PGP_KEY (object), 
 		                          index - 1,
 		                          GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)));
 
 
 #ifdef WITH_KEYSERVER
 		if (seahorse_gconf_get_boolean(AUTOSYNC_KEY) == TRUE) {
-			keys = g_list_append (keys, skey);
+			keys = g_list_append (keys, object);
 			/* TODO: This cross module dependency needs to be fixed */
 			/* seahorse_keyserver_sync (keys); */
 			g_list_free(keys);
@@ -281,11 +279,11 @@
 names_revoke_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
     /* TODO: */
-/*    SeahorseKey *skey;
+/*    SeahorseObject *skey;
     gint index;
     Glist *keys = NULL;
 
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
+    skey = SEAHORSE_OBJECT_WIDGET (swidget)->skey;
     index = names_get_selected_uid (swidget);
 
     if (index >= 1) {
@@ -314,103 +312,104 @@
 
 /* Is called whenever a signature key changes, to update row */
 static void
-names_update_row (SeahorseKeyModel *skmodel, SeahorseKey *skey, 
+names_update_row (SeahorseObjectModel *skmodel, SeahorseObject *object, 
                   GtkTreeIter *iter, SeahorseWidget *swidget)
 {
 	SeahorseObject *preferred;
 	const gchar *icon;
-	gchar *name;
+	const gchar *name, *id;
     
 	/* Always use the most preferred key for this keyid */
-	preferred = seahorse_object_get_preferred (SEAHORSE_OBJECT (skey));
+	preferred = seahorse_object_get_preferred (object);
 	if (preferred) {
-		while (SEAHORSE_IS_KEY (preferred)) {
-			skey = SEAHORSE_KEY (preferred);
+		while (SEAHORSE_IS_OBJECT (preferred)) {
+			object = SEAHORSE_OBJECT (preferred);
 			preferred = seahorse_object_get_preferred (preferred);
 		}
-		seahorse_key_model_set_row_key (skmodel, iter, skey);
+		seahorse_object_model_set_row_object (skmodel, iter, object);
 	}
 
-    icon = seahorse_key_get_location (skey) < SEAHORSE_LOCATION_LOCAL ? 
-                GTK_STOCK_DIALOG_QUESTION : SEAHORSE_STOCK_SIGN;
-    name = seahorse_key_get_name_markup (skey, 0);
-    
-    gtk_tree_store_set (GTK_TREE_STORE (skmodel), iter,
-                        UIDSIG_INDEX, -1,
-                        UIDSIG_ICON, icon,
-                        UIDSIG_NAME, name ? name : _("[Unknown]"),
-                        UIDSIG_KEYID, seahorse_key_get_short_keyid (skey), -1);
-            
-    g_free (name);
+	icon = seahorse_object_get_location (object) < SEAHORSE_LOCATION_LOCAL ? 
+	                 GTK_STOCK_DIALOG_QUESTION : SEAHORSE_STOCK_SIGN;
+	name = seahorse_object_get_markup (object);
+	id = seahorse_object_get_identifier (object);
+	
+	gtk_tree_store_set (GTK_TREE_STORE (skmodel), iter,
+	                    UIDSIG_INDEX, -1,
+	                    UIDSIG_ICON, icon,
+	                    UIDSIG_NAME, name ? name : _("[Unknown]"),
+	                    UIDSIG_KEYID, id, -1);
 }
 
 static void
 names_populate (SeahorseWidget *swidget, GtkTreeStore *store, SeahorsePGPKey *pkey)
 {
-    SeahorseKey *skey;
-    gpgme_user_id_t uid;
-    gpgme_key_sig_t sig;
-    GtkTreeIter uiditer, sigiter;
-    gchar *name;
-    const gchar *keyid;
-    GSList *rawids = NULL;
-    int i, j;
-    GList *keys, *l;
+	SeahorseObject *object;
+	gpgme_key_sig_t sig;
+	GtkTreeIter uiditer, sigiter;
+	const gchar *keyid;
+	GSList *rawids = NULL;
+	int j;
+	GList *keys, *l;
+	GList *uids, *u;
+	SeahorsePGPUid *uid;
 
-    keyid = seahorse_pgp_key_get_id (pkey->pubkey, 0);
+	keyid = seahorse_pgp_key_get_id (pkey->pubkey, 0);
     
-    /* Insert all the fun-ness */
-    for (i = 1, uid = pkey->pubkey->uids; uid; uid = uid->next, i++) {
-
-        name = seahorse_key_get_name_markup (SEAHORSE_KEY (pkey), i - 1);
+	/* Insert all the fun-ness */
+	uids = seahorse_object_get_children (SEAHORSE_OBJECT (pkey));
+	
+	for (u = uids; u; u = g_list_next (u)) {
 
-        gtk_tree_store_append (store, &uiditer, NULL);
-        gtk_tree_store_set (store, &uiditer,  
-                            UIDSIG_INDEX, i,
-                            UIDSIG_ICON, SEAHORSE_STOCK_PERSON,
-                            UIDSIG_NAME, name,
-                            -1);
-        
-        g_free (name);
-        
-        
-        /* Build a list of all the keyids */
-        for (j = 1, sig = uid->signatures; sig; sig = sig->next, j++) {
-            /* Never show self signatures, they're implied */
-            if (strcmp (sig->keyid, keyid) == 0)
-                continue;
-            rawids = g_slist_prepend (rawids, sig->keyid);
-        }
-        
-        /* Pass it to 'DiscoverKeys' for resolution/download */
-        keys = seahorse_context_discover_objects (SCTX_APP (), SEAHORSE_PGP, rawids);
-        g_slist_free (rawids);
-        rawids = NULL;
+		g_return_if_fail (SEAHORSE_IS_PGP_UID (u->data));
+		uid = SEAHORSE_PGP_UID (u->data);
+		g_return_if_fail (uid->userid);
+
+		gtk_tree_store_append (store, &uiditer, NULL);
+		gtk_tree_store_set (store, &uiditer,  
+		                    UIDSIG_INDEX, seahorse_pgp_uid_get_index (uid),
+		                    UIDSIG_ICON, SEAHORSE_STOCK_PERSON,
+		                    UIDSIG_NAME, seahorse_object_get_markup (SEAHORSE_OBJECT (uid)),
+		                    -1);
+        
+        
+		/* Build a list of all the keyids */
+		for (j = 1, sig = uid->userid->signatures; sig; sig = sig->next, j++) {
+			/* Never show self signatures, they're implied */
+			if (strcmp (sig->keyid, keyid) == 0)
+				continue;
+			rawids = g_slist_prepend (rawids, sig->keyid);
+		}
         
-        /* Add the keys to the store */
-        for (l = keys; l; l = g_list_next (l)) {
-            skey = SEAHORSE_KEY (l->data);
-            gtk_tree_store_append (store, &sigiter, &uiditer);
+		/* Pass it to 'DiscoverKeys' for resolution/download */
+		keys = seahorse_context_discover_objects (SCTX_APP (), SEAHORSE_PGP, rawids);
+		g_slist_free (rawids);
+		rawids = NULL;
+        
+		/* Add the keys to the store */
+		for (l = keys; l; l = g_list_next (l)) {
+			object = SEAHORSE_OBJECT (l->data);
+			gtk_tree_store_append (store, &sigiter, &uiditer);
             
-            /* This calls the 'update-row' callback, to set the values for the key */
-            seahorse_key_model_set_row_key (SEAHORSE_KEY_MODEL (store), &sigiter, skey);
-        }
-    } 
+			/* This calls the 'update-row' callback, to set the values for the key */
+			seahorse_object_model_set_row_object (SEAHORSE_OBJECT_MODEL (store), &sigiter, object);
+		}
+	} 
 }
 
 static void
 do_names (SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorsePGPKey *pkey;
     GtkWidget *widget;
     GtkTreeStore *store;
     GtkCellRenderer *renderer;
     
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    pkey = SEAHORSE_PGP_KEY (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    pkey = SEAHORSE_PGP_KEY (object);
     
-    if (seahorse_key_get_usage (skey) != SEAHORSE_USAGE_PRIVATE_KEY)
+    if (seahorse_object_get_usage (object) != SEAHORSE_USAGE_PRIVATE_KEY)
         return;
 
     /* Clear/create table store */
@@ -424,7 +423,7 @@
     } else {
         
         /* This is our first time so create a store */
-        store = GTK_TREE_STORE (seahorse_key_model_new (UIDSIG_N_COLUMNS, (GType*)uidsig_columns));
+        store = GTK_TREE_STORE (seahorse_object_model_new (UIDSIG_N_COLUMNS, (GType*)uidsig_columns));
         g_signal_connect (store, "update-row", G_CALLBACK (names_update_row), swidget);
         
         /* Icon column */
@@ -456,13 +455,13 @@
 static void
 do_names_signals (SeahorseWidget *swidget)
 { 
-    SeahorseKey *skey;
+    SeahorseObject *object;
     GtkTreeSelection *selection;
     GtkWidget *widget;
     
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
     
-    if (seahorse_key_get_usage (skey) != SEAHORSE_USAGE_PRIVATE_KEY)
+    if (seahorse_object_get_usage (object) != SEAHORSE_USAGE_PRIVATE_KEY)
         return;
 
     glade_xml_signal_connect_data (swidget->xml, "on_names_add",
@@ -509,7 +508,7 @@
     gint len = 0;
     gchar *uri;
     
-    pkey = SEAHORSE_PGP_KEY (SEAHORSE_KEY_WIDGET (swidget)->skey);
+    pkey = SEAHORSE_PGP_KEY (SEAHORSE_OBJECT_WIDGET (swidget)->object);
     g_assert (SEAHORSE_IS_PGP_KEY (pkey)); 
     
     /* 
@@ -548,7 +547,7 @@
 {
     SeahorsePGPKey *pkey;
 
-    pkey = SEAHORSE_PGP_KEY (SEAHORSE_KEY_WIDGET (swidget)->skey);
+    pkey = SEAHORSE_PGP_KEY (SEAHORSE_OBJECT_WIDGET (swidget)->object);
     g_assert (SEAHORSE_IS_PGP_KEY (pkey));
     
     if (seahorse_pgp_photo_add (pkey, GTK_WINDOW (seahorse_widget_get_toplevel (swidget)), NULL))
@@ -565,7 +564,7 @@
                                                     "current-photoid");
     g_return_if_fail (photoid != NULL);
 
-    pkey = SEAHORSE_PGP_KEY (SEAHORSE_KEY_WIDGET (swidget)->skey);
+    pkey = SEAHORSE_PGP_KEY (SEAHORSE_OBJECT_WIDGET (swidget)->object);
     g_assert (SEAHORSE_IS_PGP_KEY (pkey));
     
     if (seahorse_pgp_photo_delete (pkey, GTK_WINDOW (seahorse_widget_get_toplevel (swidget)),
@@ -576,7 +575,7 @@
 static void
 owner_photo_primary_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorsePGPKey *pkey;
     gpgme_error_t gerr;
     gint uid;
@@ -586,8 +585,8 @@
                                                     "current-photoid");
     g_return_if_fail (photoid != NULL);
         
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    pkey = SEAHORSE_PGP_KEY (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    pkey = SEAHORSE_PGP_KEY (object);
     
     uid = photoid->uid;
     
@@ -604,7 +603,7 @@
 
     gpgmex_photo_id_t photoid;
 
-    etype = seahorse_key_get_usage (SEAHORSE_KEY(pkey));
+    etype = seahorse_object_get_usage (SEAHORSE_OBJECT (pkey));
     photoid = (gpgmex_photo_id_t)g_object_get_data (G_OBJECT (swidget), 
                                                     "current-photoid");
 
@@ -648,11 +647,11 @@
 static void
 do_photo_id (SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorsePGPKey *pkey;
 
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    pkey = SEAHORSE_PGP_KEY (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    pkey = SEAHORSE_PGP_KEY (object);
 
     g_object_set_data (G_OBJECT (swidget), "current-photoid", pkey->photoids);
     
@@ -662,12 +661,12 @@
 static void
 photoid_next_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorsePGPKey *pkey;
     gpgmex_photo_id_t photoid;
 
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    pkey = SEAHORSE_PGP_KEY (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    pkey = SEAHORSE_PGP_KEY (object);
 
     photoid = (gpgmex_photo_id_t)g_object_get_data (G_OBJECT (swidget), "current-photoid");
 
@@ -680,12 +679,12 @@
 static void
 photoid_prev_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorsePGPKey *pkey;
     gpgmex_photo_id_t itter, photoid;
 
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    pkey = SEAHORSE_PGP_KEY (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    pkey = SEAHORSE_PGP_KEY (object);
 
     photoid = (gpgmex_photo_id_t)g_object_get_data (G_OBJECT (swidget), "current-photoid");
 
@@ -745,14 +744,14 @@
 static void 
 owner_sign_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-	SeahorseKey *skey;
+	SeahorseObject *object;
 	gint index;
 
-	skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
+	object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
 	index = owner_get_selected_uid (swidget);
 
 	if (index >= 1) 
-		seahorse_pgp_sign_prompt (SEAHORSE_PGP_KEY (skey),
+		seahorse_pgp_sign_prompt (SEAHORSE_PGP_KEY (object),
 		                          index - 1,
 		                          GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name))); 
 }
@@ -760,22 +759,22 @@
 static void
 owner_passphrase_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
+    SeahorseObject *object;
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
     
-    if (seahorse_key_get_usage (skey) == SEAHORSE_USAGE_PRIVATE_KEY)
-        seahorse_pgp_key_pair_op_change_pass (SEAHORSE_PGP_KEY (skey));
+    if (seahorse_object_get_usage (object) == SEAHORSE_USAGE_PRIVATE_KEY)
+        seahorse_pgp_key_pair_op_change_pass (SEAHORSE_PGP_KEY (object));
 }
 
 static void
 do_owner_signals (SeahorseWidget *swidget)
 { 
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorseUsage etype;
     GtkWidget *frame;
     
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    etype = seahorse_key_get_usage (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    etype = seahorse_object_get_usage (object);
     
     glade_xml_signal_connect_data (swidget->xml, "on_owner_sign_button_clicked",
                                 G_CALLBACK (owner_sign_button_clicked), swidget);
@@ -811,7 +810,7 @@
 static void
 do_owner (SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorsePGPKey *pkey;
     SeahorsePGPUid *uid;
     GtkWidget *widget;
@@ -821,25 +820,26 @@
     gchar *text, *t;
     gulong expires_date;
     guint flags;
-    gchar *markup;
+    const gchar *markup;
+    const gchar *label;
     int i;
 
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    pkey = SEAHORSE_PGP_KEY (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    pkey = SEAHORSE_PGP_KEY (object);
 
-    flags = seahorse_key_get_flags (skey);
+    flags = seahorse_object_get_flags (object);
     
     /* Display appropriate warnings */    
-    show_glade_widget (swidget, "expired-area", flags & SKEY_FLAG_EXPIRED);
-    show_glade_widget (swidget, "revoked-area", flags & SKEY_FLAG_REVOKED);
-    show_glade_widget (swidget, "disabled-area", flags & SKEY_FLAG_DISABLED);
+    show_glade_widget (swidget, "expired-area", flags & SEAHORSE_FLAG_EXPIRED);
+    show_glade_widget (swidget, "revoked-area", flags & SEAHORSE_FLAG_REVOKED);
+    show_glade_widget (swidget, "disabled-area", flags & SEAHORSE_FLAG_DISABLED);
     
     /* Update the expired message */
-    if (flags & SKEY_FLAG_EXPIRED) {
+    if (flags & SEAHORSE_FLAG_EXPIRED) {
         widget = glade_xml_get_widget (swidget->xml, "expired-message");
         if (widget) {
             
-            expires_date = seahorse_key_get_expires (skey);
+            expires_date = seahorse_pgp_key_get_expires (pkey);
             if (expires_date == 0) 
                 t = g_strdup (_("(unknown)"));
             else
@@ -854,8 +854,8 @@
     }
         
     /* Hide trust page when above */
-    show_glade_widget (swidget, "trust-page", !((flags & SKEY_FLAG_EXPIRED) ||
-                       (flags & SKEY_FLAG_REVOKED) || (flags & SKEY_FLAG_DISABLED)));
+    show_glade_widget (swidget, "trust-page", !((flags & SEAHORSE_FLAG_EXPIRED) ||
+                       (flags & SEAHORSE_FLAG_REVOKED) || (flags & SEAHORSE_FLAG_DISABLED)));
 
     /* Hide or show the uids area */
     show_glade_widget (swidget, "uids-area", seahorse_pgp_key_get_num_uids (pkey) > 1);
@@ -882,9 +882,11 @@
         g_free (text);
     }
     
-    widget = glade_xml_get_widget (swidget->xml, "owner-keyid-label");
-    if (widget)
-        gtk_label_set_text (GTK_LABEL (widget), seahorse_key_get_short_keyid (skey)); 
+	widget = glade_xml_get_widget (swidget->xml, "owner-keyid-label");
+	if (widget) {
+		label = seahorse_object_get_identifier (object); 
+		gtk_label_set_text (GTK_LABEL (widget), label);
+	}
     
     /* Clear/create table store */
     widget = glade_xml_get_widget (swidget->xml, "owner-userid-tree");
@@ -911,17 +913,16 @@
                                                          "markup", UID_MARKUP, NULL);
         }
     
-        for (i = 1; i <= seahorse_pgp_key_get_num_uids (pkey); i++) {
-    
-            markup = seahorse_key_get_name_markup (SEAHORSE_KEY (pkey), i - 1);
+        for (i = 0; i < seahorse_pgp_key_get_num_uids (pkey); i++) {
     
-            gtk_list_store_append (store, &iter);
-            gtk_list_store_set (store, &iter,  
-                                UID_INDEX, i,
-                                UID_ICON, SEAHORSE_STOCK_PERSON,
-                                UID_MARKUP, markup, -1);
-            
-            g_free (markup);
+        	uid = seahorse_pgp_key_get_uid (pkey, i);
+        	markup = seahorse_object_get_markup (SEAHORSE_OBJECT (uid));
+        	
+        	gtk_list_store_append (store, &iter);
+        	gtk_list_store_set (store, &iter,  
+        	                    UID_INDEX, i + 1,
+        	                    UID_ICON, SEAHORSE_STOCK_PERSON,
+        	                    UID_MARKUP, markup, -1);
         } 
         
         gtk_tree_view_set_model (GTK_TREE_VIEW (widget), GTK_TREE_MODEL(store));
@@ -977,11 +978,11 @@
 static void
 details_add_subkey_button_clicked (GtkButton *button, SeahorseWidget *swidget)
 {
-	SeahorseKey *skey;
+	SeahorseObject *object;
 	SeahorsePGPKey *pkey;
 	
-	skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-	pkey = SEAHORSE_PGP_KEY (skey);
+	object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+	pkey = SEAHORSE_PGP_KEY (object);
 	
 	seahorse_pgp_add_subkey_new (pkey, 
 	                             GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)));
@@ -990,17 +991,17 @@
 static void
 details_del_subkey_button_clicked (GtkButton *button, SeahorseWidget *swidget)
 {
-	SeahorseKey *skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-	SeahorsePGPKey *pkey = SEAHORSE_PGP_KEY (skey);
+	SeahorseObject *object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+	SeahorsePGPKey *pkey = SEAHORSE_PGP_KEY (object);
 	guint index = get_selected_subkey (swidget);
 	gboolean ret;
-	gchar *userid, *message; 
+	const gchar *userid;
+	gchar *message; 
 	gpgme_error_t err;
 
-	userid = seahorse_key_get_name (SEAHORSE_KEY (pkey), 0);
+	userid = seahorse_object_get_label (object);
 	message = g_strdup_printf (_("Are you sure you want to permanently delete subkey %d of %s?"),
 	                           index, userid);
-	g_free (userid);
 	
 	ret = seahorse_util_prompt_delete (message, seahorse_widget_get_toplevel (swidget));
 	g_free (message);
@@ -1016,9 +1017,8 @@
 static void
 details_revoke_subkey_button_clicked (GtkButton *button, SeahorseWidget *swidget)
 {
-	SeahorseKey *skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-
-	seahorse_pgp_revoke_new (SEAHORSE_PGP_KEY (skey), 
+	SeahorseObject *object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+	seahorse_pgp_revoke_new (SEAHORSE_PGP_KEY (object), 
 	                         GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)), 
 	                         get_selected_subkey (swidget));
 }
@@ -1026,30 +1026,27 @@
 static void
 trust_changed (GtkComboBox *selection, SeahorseWidget *swidget)
 {
-	SeahorseKey *skey;
+	SeahorseObject *object;
 	gint trust;
 	GtkTreeModel *model;
 	GtkTreeIter iter;
 	gpgme_error_t err;
 	gboolean set;
 	
-    set = gtk_combo_box_get_active_iter (selection, &iter);
+	set = gtk_combo_box_get_active_iter (selection, &iter);
+	if (!set) 
+		return;
 	
-    if (set) {
-    	skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
+	object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
     	
-    	model = gtk_combo_box_get_model (selection);
-    	gtk_tree_model_get (model, &iter,
-                            TRUST_VALIDITY, &trust,
-                            -1);
+	model = gtk_combo_box_get_model (selection);
+	gtk_tree_model_get (model, &iter, TRUST_VALIDITY, &trust, -1);
                                   
-    	if (seahorse_key_get_trust (skey) != trust) {
-    		err = seahorse_pgp_key_op_set_trust (SEAHORSE_PGP_KEY (skey), trust);
-    		if (err) {
+	if (seahorse_pgp_key_get_trust (SEAHORSE_PGP_KEY (object)) != trust) {
+		err = seahorse_pgp_key_op_set_trust (SEAHORSE_PGP_KEY (object), trust);
+		if (err)
     			seahorse_pgp_handle_gpgme_error (err, _("Unable to change trust"));
-    		}
-    	}
-    }
+	}
 }
 
 static void
@@ -1058,7 +1055,7 @@
 	GError *err = NULL;
 	gchar *uri;
 	
-	free (contents);
+	g_free (contents);
 
 	if (!g_file_replace_contents_finish (file, result, NULL, &err)) {
 		uri = g_file_get_uri (file);
@@ -1072,7 +1069,7 @@
 static void
 details_export_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-	SeahorseKey *skey;
+	SeahorseObject *object;
 	SeahorsePGPKey *pkey;
 	GtkDialog *dialog;
 	gchar* uri = NULL;
@@ -1084,13 +1081,13 @@
 	gchar *results;
 	gsize n_results;
     
-	skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-	pkey = SEAHORSE_PGP_KEY (skey);
+	object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+	pkey = SEAHORSE_PGP_KEY (object);
 	
 	dialog = seahorse_util_chooser_save_new (_("Export Complete Key"), 
 	                                         GTK_WINDOW (seahorse_widget_get_toplevel (swidget)));
 	seahorse_util_chooser_show_key_files (dialog);
-	seahorse_util_chooser_set_filename (dialog, skey);
+	seahorse_util_chooser_set_filename (dialog, object);
     
 	uri = seahorse_util_chooser_save_prompt (dialog);
 	if (!uri) 
@@ -1127,18 +1124,18 @@
 static void
 details_calendar_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-	SeahorseKey *skey;
+	SeahorseObject *object;
 	gint index;
 	
-	g_return_if_fail (SEAHORSE_IS_KEY_WIDGET (swidget));
-	skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
+	g_return_if_fail (SEAHORSE_IS_OBJECT_WIDGET (swidget));
+	object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
 
 	index = get_selected_subkey (swidget);
 	
 	if (-1 == index) {
 		index = 0;
 	}
-	seahorse_pgp_expires_new (SEAHORSE_PGP_KEY (skey), 
+	seahorse_pgp_expires_new (SEAHORSE_PGP_KEY (object), 
 	                          GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)), 
 	                          index);	
 }
@@ -1146,7 +1143,7 @@
 static void
 setup_details_trust (SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorseUsage etype;
     GtkWidget *widget;
     GtkListStore *model;
@@ -1155,8 +1152,8 @@
 
     DBG_PRINT(("KeyProperties: Setting up Trust Combo Box Store\n"));
     
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    etype = seahorse_key_get_usage (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    etype = seahorse_object_get_usage (object);
     
     widget = glade_xml_get_widget (swidget->xml, "details-trust-combobox");
     
@@ -1211,11 +1208,11 @@
 static void
 do_details_signals (SeahorseWidget *swidget) 
 { 
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorseUsage etype;
     
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    etype = seahorse_key_get_usage (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    etype = seahorse_object_get_usage (object);
     
     /* 
      * if not the key owner, disable most everything
@@ -1251,7 +1248,7 @@
 static void 
 do_details (SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorsePGPKey *pkey;
     gpgme_subkey_t subkey;
     GtkWidget *widget;
@@ -1267,20 +1264,20 @@
     guint keyloc;
     gboolean valid;
 
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    pkey = SEAHORSE_PGP_KEY (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    pkey = SEAHORSE_PGP_KEY (object);
     subkey = pkey->pubkey->subkeys;
-    keyloc = seahorse_key_get_location (skey);
+    keyloc = seahorse_object_get_location (object);
 
     widget = glade_xml_get_widget (swidget->xml, "details-id-label");
     if (widget) {
-        label = seahorse_key_get_short_keyid (skey); 
+        label = seahorse_object_get_label (object); 
         gtk_label_set_text (GTK_LABEL (widget), label);
     }
 
     widget = glade_xml_get_widget (swidget->xml, "details-fingerprint-label");
     if (widget) {
-        fp_label = seahorse_key_get_fingerprint (skey);  
+        fp_label = seahorse_pgp_key_get_fingerprint (pkey); 
         if (strlen (fp_label) > 24)
             fp_label[24] = '\n';
         gtk_label_set_text (GTK_LABEL (widget), fp_label);
@@ -1308,7 +1305,7 @@
 
     widget = glade_xml_get_widget (swidget->xml, "details-expires-label");
     if (widget) {
-        if (seahorse_key_get_location (skey) == SEAHORSE_LOCATION_REMOTE)
+        if (seahorse_object_get_location (object) == SEAHORSE_LOCATION_REMOTE)
             fp_label = NULL;
         else if (subkey->expires == 0)
             fp_label = g_strdup (C_("Expires", "Never"));
@@ -1332,7 +1329,7 @@
                                 TRUST_VALIDITY, &trust,
                                 -1);
             
-            if (trust == seahorse_key_get_trust (skey)) {
+            if (trust == seahorse_pgp_key_get_trust (pkey)) {
                 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (widget),  &iter);
                 break;
             }
@@ -1452,17 +1449,17 @@
 static void
 trust_marginal_toggled (GtkToggleButton *toggle, SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     guint trust;
     gpgme_error_t err;
     
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
     
     trust = gtk_toggle_button_get_active (toggle) ?
             SEAHORSE_VALIDITY_MARGINAL : SEAHORSE_VALIDITY_UNKNOWN;
     
-    if (seahorse_key_get_trust (skey) != trust) {
-        err = seahorse_pgp_key_op_set_trust (SEAHORSE_PGP_KEY (skey), trust);
+    if (seahorse_pgp_key_get_trust (SEAHORSE_PGP_KEY (object)) != trust) {
+        err = seahorse_pgp_key_op_set_trust (SEAHORSE_PGP_KEY (object), trust);
         if (err)
         	seahorse_pgp_handle_gpgme_error (err, _("Unable to change trust"));
     }
@@ -1470,48 +1467,47 @@
 
 /* Is called whenever a signature key changes */
 static void
-trust_update_row (SeahorseKeyModel *skmodel, SeahorseKey *skey, 
+trust_update_row (SeahorseObjectModel *skmodel, SeahorseObject *object, 
                   GtkTreeIter *iter, SeahorseWidget *swidget)
 {
 	SeahorseObject *preferred;
 	gboolean trusted = FALSE;
 	const gchar *icon;
-	gchar *name;    
+	const gchar *name, *id;
     
     	/* Always use the most preferred key for this keyid */
-	preferred = seahorse_object_get_preferred (SEAHORSE_OBJECT (skey));
-	if (SEAHORSE_IS_KEY (preferred)) {
-		while (SEAHORSE_IS_KEY (preferred)) {
-			skey = SEAHORSE_KEY (preferred);
+	preferred = seahorse_object_get_preferred (object);
+	if (SEAHORSE_IS_OBJECT (preferred)) {
+		while (SEAHORSE_IS_OBJECT (preferred)) {
+			object = SEAHORSE_OBJECT (preferred);
 			preferred = seahorse_object_get_preferred (preferred);
 		}
-		seahorse_key_model_set_row_key (skmodel, iter, skey);
+		seahorse_object_model_set_row_object (skmodel, iter, object);
 	}
 
 
-    if (seahorse_key_get_usage (skey) == SEAHORSE_USAGE_PRIVATE_KEY) 
-        trusted = TRUE;
-    else if (seahorse_key_get_flags (skey) & SKEY_FLAG_TRUSTED)
-        trusted = TRUE;
-    
-    icon = seahorse_key_get_location (skey) < SEAHORSE_LOCATION_LOCAL ? 
-                GTK_STOCK_DIALOG_QUESTION : SEAHORSE_STOCK_SIGN;
-    name = seahorse_key_get_display_name (skey);
-    
-    gtk_tree_store_set (GTK_TREE_STORE (skmodel), iter,
-                        SIGN_ICON, icon,
-                        SIGN_NAME, name ? name : _("[Unknown]"),
-                        SIGN_KEYID, seahorse_key_get_short_keyid (skey),
-                        SIGN_TRUSTED, trusted,
+	if (seahorse_object_get_usage (object) == SEAHORSE_USAGE_PRIVATE_KEY) 
+		trusted = TRUE;
+	else if (seahorse_object_get_flags (object) & SEAHORSE_FLAG_TRUSTED)
+		trusted = TRUE;
+    
+	icon = seahorse_object_get_location (object) < SEAHORSE_LOCATION_LOCAL ? 
+	                GTK_STOCK_DIALOG_QUESTION : SEAHORSE_STOCK_SIGN;
+	name = seahorse_object_get_label (object);
+	id = seahorse_object_get_identifier (object);
+	
+	gtk_tree_store_set (GTK_TREE_STORE (skmodel), iter,
+	                    SIGN_ICON, icon,
+	                    SIGN_NAME, name ? name : _("[Unknown]"),
+	                    SIGN_KEYID, id,
+	                    SIGN_TRUSTED, trusted,
                         -1);
-            
-    g_free (name);
 }
 
 static void
-signatures_populate_model (SeahorseWidget *swidget, SeahorseKeyModel *skmodel)
+signatures_populate_model (SeahorseWidget *swidget, SeahorseObjectModel *skmodel)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorsePGPKey *pkey;
     GtkTreeIter iter;
     GtkWidget *widget;
@@ -1522,7 +1518,7 @@
     GSList *rawids = NULL;
     GList *keys, *l;
 
-    pkey = SEAHORSE_PGP_KEY (SEAHORSE_KEY_WIDGET (swidget)->skey);
+    pkey = SEAHORSE_PGP_KEY (SEAHORSE_OBJECT_WIDGET (swidget)->object);
     widget = glade_xml_get_widget (swidget->xml, "signatures-tree");
     
     keyid = seahorse_pgp_key_get_id (pkey->pubkey, 0);
@@ -1553,11 +1549,11 @@
         
         /* Add the keys to the store */
         for (l = keys; l; l = g_list_next (l)) {
-            skey = SEAHORSE_KEY (l->data);
+            object = SEAHORSE_OBJECT (l->data);
             gtk_tree_store_append (GTK_TREE_STORE (skmodel), &iter, NULL);
             
             /* This calls the 'update-row' callback, to set the values for the key */
-            seahorse_key_model_set_row_key (SEAHORSE_KEY_MODEL (skmodel), &iter, skey);
+            seahorse_object_model_set_row_object (SEAHORSE_OBJECT_MODEL (skmodel), &iter, object);
         }
     }
 }
@@ -1577,20 +1573,20 @@
 static void 
 trust_sign_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
-	g_return_if_fail (SEAHORSE_IS_PGP_KEY (SEAHORSE_KEY_WIDGET (swidget)->skey));
-	seahorse_pgp_sign_prompt (SEAHORSE_PGP_KEY (SEAHORSE_KEY_WIDGET (swidget)->skey), 
+	g_return_if_fail (SEAHORSE_IS_PGP_KEY (SEAHORSE_OBJECT_WIDGET (swidget)->object));
+	seahorse_pgp_sign_prompt (SEAHORSE_PGP_KEY (SEAHORSE_OBJECT_WIDGET (swidget)->object), 
 	                          0, GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)));
 }
 
 static void
 do_trust_signals (SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorseUsage etype;
-    gchar *user;
+    const gchar *user;
     
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    etype = seahorse_key_get_usage (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    etype = seahorse_object_get_usage (object);
     
     if (etype != SEAHORSE_USAGE_PUBLIC_KEY)
         return;
@@ -1609,11 +1605,10 @@
         show_glade_widget (swidget, "signatures-empty-label", FALSE);
         
         /* Fill in trust labels with name .This only happens once, so it sits here. */
-        user = seahorse_key_get_name (skey, 0);
+        user = seahorse_object_get_label (object);
         printf_glade_widget (swidget, "trust-marginal-check", user);
         printf_glade_widget (swidget, "trust-sign-label", user);
         printf_glade_widget (swidget, "trust-revoke-label", user);
-        g_free (user);
         
     } else {
         
@@ -1644,7 +1639,7 @@
 static void 
 do_trust (SeahorseWidget *swidget)
 {
-    SeahorseKey *skey;
+    SeahorseObject *object;
     SeahorsePGPKey *pkey;
     GtkWidget *widget;
     GtkTreeStore *store;
@@ -1653,11 +1648,11 @@
     GtkCellRenderer *renderer;
     guint keyloc;
     
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    pkey = SEAHORSE_PGP_KEY (skey);
-    keyloc = seahorse_key_get_location (skey);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    pkey = SEAHORSE_PGP_KEY (object);
+    keyloc = seahorse_object_get_location (object);
     
-    if (seahorse_key_get_usage (skey) != SEAHORSE_USAGE_PUBLIC_KEY)
+    if (seahorse_object_get_usage (object) != SEAHORSE_USAGE_PUBLIC_KEY)
         return;
     
     /* Remote keys */
@@ -1676,7 +1671,7 @@
         gboolean trusted, managed;
         const gchar *icon = NULL;
         
-        trust = seahorse_key_get_trust (skey);
+        trust = seahorse_pgp_key_get_trust (pkey);
     
         trusted = FALSE;
         managed = FALSE;
@@ -1760,8 +1755,8 @@
     /* First time create the store */
     } else {
         
-        /* Create a new SeahorseKeyModel store.... */
-        store = GTK_TREE_STORE (seahorse_key_model_new (SIGN_N_COLUMNS, (GType*)sign_columns));
+        /* Create a new SeahorseObjectModel store.... */
+        store = GTK_TREE_STORE (seahorse_object_model_new (SIGN_N_COLUMNS, (GType*)sign_columns));
         g_signal_connect (store, "update-row", G_CALLBACK (trust_update_row), swidget);
         
         /* .... and a filter to go ontop of it */
@@ -1791,7 +1786,7 @@
         trusted_toggled (GTK_TOGGLE_BUTTON (widget), filter);
     } 
 
-    signatures_populate_model (swidget, SEAHORSE_KEY_MODEL (store));
+    signatures_populate_model (swidget, SEAHORSE_OBJECT_MODEL (store));
 }
 
 /* -----------------------------------------------------------------------------
@@ -1799,48 +1794,12 @@
  */
 
 static void
-key_changed (SeahorseKey *skey, SeahorseKeyChange change, SeahorseWidget *swidget)
+key_notify (SeahorseObject *object, SeahorseWidget *swidget)
 {
-    switch (change) {
-    case SKEY_CHANGE_PHOTOS:
-        do_owner (swidget);
-        break;
-    
-    case SKEY_CHANGE_UIDS:
-    case SKEY_CHANGE_SIGNERS:
-        do_owner (swidget);
-        do_names (swidget);
-        do_trust (swidget);
-        break;
-        
-    case SKEY_CHANGE_SUBKEYS: 
-        do_details (swidget);
-        break;
-    
-    case SKEY_CHANGE_EXPIRES:
-        do_details (swidget);
-        break;
-    
-    case SKEY_CHANGE_TRUST:
-        do_trust (swidget);
-        do_details (swidget);
-        break;
-    
-    default:
-        do_owner (swidget);
+	do_owner (swidget);
         do_names (swidget);
         do_trust (swidget);
         do_details (swidget);
-        break;
-    }
-}
-
-static void
-key_destroyed (GtkObject *object, SeahorseWidget *swidget)
-{
-	GtkWidget *widget = seahorse_widget_get_toplevel(swidget);
-	g_signal_handlers_disconnect_by_func (widget, properties_destroyed, swidget); 
-	g_signal_handlers_disconnect_by_func (widget, properties_response, swidget);
 }
 
 static void
@@ -1854,33 +1813,18 @@
     seahorse_widget_destroy (swidget);
 }
 
-static void
-properties_destroyed (GtkObject *object, SeahorseWidget *swidget)
-{
-    g_signal_handlers_disconnect_by_func (SEAHORSE_KEY_WIDGET (swidget)->skey,
-                                          key_changed, swidget);
-    g_signal_handlers_disconnect_by_func (SEAHORSE_KEY_WIDGET (swidget)->skey,
-                                          key_destroyed, swidget);
-}
-
 static SeahorseWidget*
 setup_public_properties (SeahorsePGPKey *pkey, GtkWindow *parent)
 {
     SeahorseWidget *swidget;
     GtkWidget *widget;
 
-    swidget = seahorse_key_widget_new ("pgp-public-key-properties", parent, SEAHORSE_KEY (pkey));    
+    swidget = seahorse_object_widget_new ("pgp-public-key-properties", parent, SEAHORSE_OBJECT (pkey));    
     
     /* This happens if the window is already open */
     if (swidget == NULL)
         return NULL;
 
-    widget = seahorse_widget_get_toplevel(swidget);
-    g_signal_connect (widget, "response", G_CALLBACK (properties_response), swidget);
-    g_signal_connect (widget, "destroy", G_CALLBACK (properties_destroyed), swidget);
-    g_signal_connect_after (pkey, "changed", G_CALLBACK (key_changed), swidget);
-    g_signal_connect_after (pkey, "destroy", G_CALLBACK (key_destroyed), swidget);
-
     /* 
      * The signals don't need to keep getting connected. Everytime a key changes the
      * do_* functions get called. Therefore, seperate functions connect the signals
@@ -1897,6 +1841,10 @@
     do_trust (swidget);
     do_trust_signals (swidget);        
 
+    widget = seahorse_widget_get_toplevel(swidget);
+    g_signal_connect (widget, "response", G_CALLBACK (properties_response), swidget);
+    seahorse_bind_objects (NULL, pkey, (SeahorseTransfer)key_notify, swidget);
+
     return swidget;
 }
 
@@ -1906,18 +1854,12 @@
     SeahorseWidget *swidget;
     GtkWidget *widget;
 
-    swidget = seahorse_key_widget_new ("pgp-private-key-properties", parent, SEAHORSE_KEY (pkey));
+    swidget = seahorse_object_widget_new ("pgp-private-key-properties", parent, SEAHORSE_OBJECT (pkey));
 
     /* This happens if the window is already open */
     if (swidget == NULL)
         return NULL;
 
-    widget = glade_xml_get_widget (swidget->xml, swidget->name);
-    g_signal_connect (widget, "response", G_CALLBACK (properties_response), swidget);
-    g_signal_connect (widget, "destroy", G_CALLBACK (properties_destroyed), swidget);
-    g_signal_connect_after (pkey, "changed", G_CALLBACK (key_changed), swidget);
-    g_signal_connect_after (pkey, "destroy", G_CALLBACK (key_destroyed), swidget);
-
     /* 
      * The signals don't need to keep getting connected. Everytime a key changes the
      * do_* functions get called. Therefore, seperate functions connect the signals
@@ -1934,6 +1876,10 @@
     do_details (swidget);
     do_details_signals (swidget);
 
+    widget = glade_xml_get_widget (swidget->xml, swidget->name);
+    g_signal_connect (widget, "response", G_CALLBACK (properties_response), swidget);
+    seahorse_bind_objects (NULL, pkey, (SeahorseTransfer)key_notify, swidget);
+    
     return swidget;
 }
 

Modified: trunk/pgp/seahorse-pgp-key.c
==============================================================================
--- trunk/pgp/seahorse-pgp-key.c	(original)
+++ trunk/pgp/seahorse-pgp-key.c	Sat Nov 29 17:37:20 2008
@@ -36,8 +36,6 @@
     PROP_0,
     PROP_PUBKEY,
     PROP_SECKEY,
-    PROP_DISPLAY_NAME,
-    PROP_DISPLAY_ID,
     PROP_SIMPLE_NAME,
     PROP_FINGERPRINT,
     PROP_VALIDITY,
@@ -46,11 +44,10 @@
     PROP_TRUST_STR,
     PROP_EXPIRES,
     PROP_EXPIRES_STR,
-    PROP_LENGTH,
-    PROP_STOCK_ID
+    PROP_LENGTH
 };
 
-G_DEFINE_TYPE (SeahorsePGPKey, seahorse_pgp_key, SEAHORSE_TYPE_KEY);
+G_DEFINE_TYPE (SeahorsePGPKey, seahorse_pgp_key, SEAHORSE_TYPE_OBJECT);
 
 /* -----------------------------------------------------------------------------
  * INTERNAL HELPERS
@@ -138,6 +135,25 @@
 	return uid ? seahorse_pgp_uid_get_name (uid) : NULL;
 }
 
+static gchar* 
+calc_name (SeahorsePGPKey *self)
+{
+	SeahorsePGPUid *uid;
+	g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (self), NULL);
+	uid = g_list_nth_data (self->uids, 0);
+	return uid ? seahorse_pgp_uid_get_display_name (uid) : NULL;
+}
+
+static gchar* 
+calc_markup (SeahorsePGPKey *self)
+{
+	SeahorsePGPUid *uid;
+	g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (self), NULL);
+	uid = g_list_nth_data (self->uids, 0);
+	return uid ? seahorse_pgp_uid_get_markup (uid, seahorse_object_get_flags (SEAHORSE_OBJECT (self))) : NULL;
+}
+
+
 static void 
 update_uids (SeahorsePGPKey *pkey)
 {
@@ -192,91 +208,111 @@
 }
 
 static void
-changed_key (SeahorsePGPKey *pkey)
+changed_key (SeahorsePGPKey *self)
 {
-    SeahorseKey *skey = SEAHORSE_KEY (pkey);
-    SeahorseObject *obj = SEAHORSE_OBJECT (pkey);
-    
-    obj->_id = 0;
-    obj->_tag = SEAHORSE_PGP;
-    
-    if (!pkey->pubkey) {
-        
-        obj->_location = SEAHORSE_LOCATION_INVALID;
-        obj->_usage = SEAHORSE_USAGE_NONE;
-        skey->loaded = SKEY_INFO_NONE;
-        obj->_flags = SKEY_FLAG_DISABLED;
-        skey->keydesc = _("Invalid");
-        skey->rawid = NULL;
-        
-    } else {
-    
-        /* Update the sub UIDs */
-        update_uids (pkey);
+	SeahorseObject *obj = SEAHORSE_OBJECT (self);
+	SeahorseLocation loc;
+	SeahorseUsage usage;
+	const gchar *description, *icon, *identifier;
+	gchar *name, *markup, *nickname;
+	GQuark id;
+	guint flags;
 	
-        /* The key id */
-        if (pkey->pubkey->subkeys) {
-            obj->_id = seahorse_pgp_key_get_cannonical_id (pkey->pubkey->subkeys->keyid);
-            skey->rawid = pkey->pubkey->subkeys->keyid;
-        }
-        
-        /* The location */
-        if (pkey->pubkey->keylist_mode & GPGME_KEYLIST_MODE_EXTERN && 
-            obj->_location <= SEAHORSE_LOCATION_REMOTE)
-            obj->_location = SEAHORSE_LOCATION_REMOTE;
-        
-        else if (obj->_location <= SEAHORSE_LOCATION_LOCAL)
-            obj->_location = SEAHORSE_LOCATION_LOCAL;
-        
-        /* The type */
-        if (pkey->seckey) {
-            obj->_usage = SEAHORSE_USAGE_PRIVATE_KEY;
-            skey->keydesc = _("Private PGP Key");
-        } else {
-            obj->_usage = SEAHORSE_USAGE_PUBLIC_KEY;
-            skey->keydesc = _("Public PGP Key");
-        }
+	if (!self->pubkey) {
+		
+		self->loaded = SKEY_INFO_NONE;
+		g_object_set (obj,
+		              "id", 0,
+		              "label", "",
+		              "icon", NULL,
+		              "usage", SEAHORSE_USAGE_NONE,
+		              "markup", "",
+		              "idenitfier", "",
+		              "nickname", "",
+		              "description", _("Invalid"),
+		              "location", SEAHORSE_LOCATION_INVALID,
+		              "flags", SEAHORSE_FLAG_DISABLED,
+		              NULL);
+		return;
+	}
 
-        /* The info loaded */
-        if (pkey->pubkey->keylist_mode & GPGME_KEYLIST_MODE_SIGS && 
-            skey->loaded < SKEY_INFO_COMPLETE)
-            skey->loaded = SKEY_INFO_COMPLETE;
-        else if (skey->loaded < SKEY_INFO_BASIC)
-            skey->loaded = SKEY_INFO_BASIC;
-        
-        /* The flags */
-        obj->_flags = SKEY_FLAG_EXPORTABLE;
-    
-        if (!pkey->pubkey->disabled && !pkey->pubkey->expired && 
-            !pkey->pubkey->revoked && !pkey->pubkey->invalid)
-        {
-            if (calc_validity (pkey) >= SEAHORSE_VALIDITY_MARGINAL)
-                obj->_flags |= SKEY_FLAG_IS_VALID;
-            if (pkey->pubkey->can_encrypt)
-                obj->_flags |= SKEY_FLAG_CAN_ENCRYPT;
-            if (pkey->seckey && pkey->pubkey->can_sign)
-                obj->_flags |= SKEY_FLAG_CAN_SIGN;
-        }
-        
-        if (pkey->pubkey->expired)
-            obj->_flags |= SKEY_FLAG_EXPIRED;
-        
-        if (pkey->pubkey->revoked)
-            obj->_flags |= SKEY_FLAG_REVOKED;
-        
-        if (pkey->pubkey->disabled)
-            obj->_flags |= SKEY_FLAG_DISABLED;
-        
-        if (calc_trust (pkey) >= SEAHORSE_VALIDITY_MARGINAL && 
-            !pkey->pubkey->revoked && !pkey->pubkey->disabled && 
-            !pkey->pubkey->expired)
-            obj->_flags |= SKEY_FLAG_TRUSTED;
-    }
-    
-    if (!obj->_id)
-	    obj->_id = g_quark_from_string (SEAHORSE_PGP_STR ":UNKNOWN UNKNOWN ");
-    
-    seahorse_object_fire_changed (obj, SEAHORSE_OBJECT_CHANGE_ALL);
+	/* Update the sub UIDs */
+	update_uids (self);
+
+	/* The key id */
+	id = 0;
+	identifier = NULL;
+	if (self->pubkey->subkeys) {
+		id = seahorse_pgp_key_get_cannonical_id (self->pubkey->subkeys->keyid);
+		identifier = self->pubkey->subkeys->keyid;
+	}
+
+	/* The location */
+	loc = seahorse_object_get_location (obj);
+	if (self->pubkey->keylist_mode & GPGME_KEYLIST_MODE_EXTERN && 
+	    loc <= SEAHORSE_LOCATION_REMOTE)
+		loc = SEAHORSE_LOCATION_REMOTE;
+	else if (loc <= SEAHORSE_LOCATION_LOCAL)
+		loc = SEAHORSE_LOCATION_LOCAL;
+
+	/* The type */
+	if (self->seckey) {
+		usage = SEAHORSE_USAGE_PRIVATE_KEY;
+		description = _("Private PGP Key");
+		icon = SEAHORSE_STOCK_SECRET;
+	} else {
+		usage = SEAHORSE_USAGE_PUBLIC_KEY;
+		description = _("Public PGP Key");
+		icon = SEAHORSE_STOCK_KEY;
+	}
+
+	/* The flags */
+	flags = SEAHORSE_FLAG_EXPORTABLE;
+
+	if (!self->pubkey->disabled && !self->pubkey->expired && 
+	    !self->pubkey->revoked && !self->pubkey->invalid) {
+		if (calc_validity (self) >= SEAHORSE_VALIDITY_MARGINAL)
+			flags |= SEAHORSE_FLAG_IS_VALID;
+		if (self->pubkey->can_encrypt)
+			flags |= SEAHORSE_FLAG_CAN_ENCRYPT;
+		if (self->seckey && self->pubkey->can_sign)
+			flags |= SEAHORSE_FLAG_CAN_SIGN;
+	}
+
+	if (self->pubkey->expired)
+		flags |= SEAHORSE_FLAG_EXPIRED;
+
+	if (self->pubkey->revoked)
+		flags |= SEAHORSE_FLAG_REVOKED;
+
+	if (self->pubkey->disabled)
+		flags |= SEAHORSE_FLAG_DISABLED;
+
+	if (calc_trust (self) >= SEAHORSE_VALIDITY_MARGINAL && 
+	    !self->pubkey->revoked && !self->pubkey->disabled && 
+	    !self->pubkey->expired)
+		flags |= SEAHORSE_FLAG_TRUSTED;
+	
+	name = calc_name (self);
+	markup = calc_markup (self);
+	nickname = calc_short_name (self);
+	
+	g_object_set (obj,
+		      "id", id,
+		      "label", name,
+		      "icon", icon,
+		      "usage", usage,
+		      "markup", markup,
+		      "nickname", nickname,
+		      "identifier", identifier,
+		      "description", description,
+		      "location", loc,
+		      "flags", flags,
+		      NULL);
+	
+	g_free (name);
+	g_free (markup);
+	g_free (nickname);
 }
 
 
@@ -287,131 +323,59 @@
 static void
 seahorse_pgp_key_init (SeahorsePGPKey *pkey)
 {
-    
-}
-
-static guint 
-seahorse_pgp_key_get_num_names (SeahorseKey *skey)
-{
-	SeahorsePGPKey *pkey;
-    	g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (skey), 0);
-    	pkey = SEAHORSE_PGP_KEY (skey);
-    	return g_list_length (pkey->uids);
-}
-
-static gchar* 
-seahorse_pgp_key_get_name (SeahorseKey *skey, guint index)
-{
-	SeahorsePGPKey *pkey;
-	SeahorsePGPUid *uid;
-	g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (skey), NULL);
-	pkey = SEAHORSE_PGP_KEY (skey);
-	uid = g_list_nth_data (pkey->uids, index);
-	return uid ? seahorse_pgp_uid_get_display_name (uid) : NULL;
-}
-
-static gchar* 
-seahorse_pgp_key_get_name_markup (SeahorseKey *skey, guint index)
-{
-	SeahorsePGPKey *pkey;
-	SeahorsePGPUid *uid;
-	g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (skey), NULL);
-	pkey = SEAHORSE_PGP_KEY (skey);
-	uid = g_list_nth_data (pkey->uids, index);
-	return uid ? seahorse_pgp_uid_get_markup (uid, seahorse_key_get_flags (skey)) : NULL;
-}
 
-static gchar* 
-seahorse_pgp_key_get_name_cn (SeahorseKey *skey, guint index)
-{
-	SeahorsePGPKey *pkey;
-	SeahorsePGPUid *uid;
-	g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (skey), NULL);
-	pkey = SEAHORSE_PGP_KEY (skey);
-	uid = g_list_nth_data (pkey->uids, index);
-	return uid ? seahorse_pgp_uid_get_email (uid) : NULL;
 }
 
-static SeahorseValidity  
-seahorse_pgp_key_get_name_validity  (SeahorseKey *skey, guint index)
-{
-	SeahorsePGPKey *pkey;
-	SeahorsePGPUid *uid;
-	g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (skey), SEAHORSE_VALIDITY_UNKNOWN);
-	pkey = SEAHORSE_PGP_KEY (skey);
-	uid = g_list_nth_data (pkey->uids, index);
-
-	if (pkey->pubkey->revoked)
-		return SEAHORSE_VALIDITY_REVOKED;
-	if (pkey->pubkey->disabled)
-		return SEAHORSE_VALIDITY_DISABLED;
-    
-	return uid ? seahorse_pgp_uid_get_validity (uid) : SEAHORSE_VALIDITY_UNKNOWN;
-}
 
 static void
 seahorse_pgp_key_get_property (GObject *object, guint prop_id,
                                GValue *value, GParamSpec *pspec)
 {
-    SeahorsePGPKey *pkey = SEAHORSE_PGP_KEY (object);
-    SeahorseKey *skey = SEAHORSE_KEY (object);
-    gchar *expires;
+	SeahorsePGPKey *self = SEAHORSE_PGP_KEY (object);
+	gchar *expires;
     
-    switch (prop_id) {
-    case PROP_PUBKEY:
-        g_value_set_pointer (value, pkey->pubkey);
-        break;
-    case PROP_SECKEY:
-        g_value_set_pointer (value, pkey->seckey);
-        break;
-    case PROP_DISPLAY_NAME:
-        g_value_take_string (value, seahorse_pgp_key_get_name (SEAHORSE_KEY (pkey), 0));
-        break;
-    case PROP_DISPLAY_ID:
-        g_value_set_string (value, seahorse_key_get_short_keyid (SEAHORSE_KEY (pkey)));
-        break;
-    case PROP_SIMPLE_NAME:        
-        g_value_take_string (value, calc_short_name(pkey));
-        break;
-    case PROP_FINGERPRINT:
-        g_value_take_string (value, calc_fingerprint(pkey));
-        break;
-    case PROP_VALIDITY:
-        g_value_set_uint (value, calc_validity (pkey));
-        break;
-    case PROP_VALIDITY_STR:
-	g_value_set_string (value, seahorse_validity_get_string (calc_validity (pkey)));
-	break;
-    case PROP_TRUST:
-        g_value_set_uint (value, calc_trust (pkey));
-        break;
-    case PROP_TRUST_STR:
-	g_value_set_string (value, seahorse_validity_get_string (calc_trust (pkey)));
-	break;
-    case PROP_EXPIRES:
-        if (pkey->pubkey)
-            g_value_set_ulong (value, pkey->pubkey->subkeys->expires);
-        break;
-    case PROP_EXPIRES_STR:
-	if (seahorse_key_get_flags (skey) & SKEY_FLAG_EXPIRED) {
-		expires = g_strdup (_("Expired"));
-	} else {
-		if (pkey->pubkey->subkeys->expires == 0)
-	                expires = g_strdup ("");
-		else 
-			expires = seahorse_util_get_date_string (pkey->pubkey->subkeys->expires);
+	switch (prop_id) {
+	case PROP_PUBKEY:
+		g_value_set_pointer (value, self->pubkey);
+		break;
+	case PROP_SECKEY:
+		g_value_set_pointer (value, self->seckey);
+		break;
+	case PROP_FINGERPRINT:
+		g_value_take_string (value, calc_fingerprint (self));
+		break;
+	case PROP_VALIDITY:
+		g_value_set_uint (value, calc_validity (self));
+		break;
+	case PROP_VALIDITY_STR:
+		g_value_set_string (value, seahorse_validity_get_string (calc_validity (self)));
+		break;
+	case PROP_TRUST:
+		g_value_set_uint (value, calc_trust (self));
+		break;
+	case PROP_TRUST_STR:
+		g_value_set_string (value, seahorse_validity_get_string (calc_trust (self)));
+		break;
+	case PROP_EXPIRES:
+		if (self->pubkey)
+			g_value_set_ulong (value, self->pubkey->subkeys->expires);
+		break;
+	case PROP_EXPIRES_STR:
+		if (seahorse_object_get_flags (SEAHORSE_OBJECT (self)) & SEAHORSE_FLAG_EXPIRED) {
+			expires = g_strdup (_("Expired"));
+		} else {
+			if (self->pubkey->subkeys->expires == 0)
+				expires = g_strdup ("");
+			else 
+				expires = seahorse_util_get_date_string (self->pubkey->subkeys->expires);
+		}
+		g_value_take_string (value, expires);
+		break;
+	case PROP_LENGTH:
+		if (self->pubkey)
+			g_value_set_uint (value, self->pubkey->subkeys->length);
+		break;
 	}
-	g_value_take_string (value, expires);
-	break;
-    case PROP_LENGTH:
-        if (pkey->pubkey)
-            g_value_set_uint (value, pkey->pubkey->subkeys->length);
-        break;
-    case PROP_STOCK_ID:
-        g_value_set_string (value, 
-            SEAHORSE_OBJECT (skey)->_usage == SEAHORSE_USAGE_PRIVATE_KEY ? SEAHORSE_STOCK_SECRET : SEAHORSE_STOCK_KEY);
-        break;
-    }
 }
 
 static void
@@ -482,7 +446,6 @@
 seahorse_pgp_key_class_init (SeahorsePGPKeyClass *klass)
 {
     GObjectClass *gobject_class;
-    SeahorseKeyClass *key_class;
     
     seahorse_pgp_key_parent_class = g_type_class_peek_parent (klass);
     gobject_class = G_OBJECT_CLASS (klass);
@@ -492,14 +455,6 @@
     gobject_class->set_property = seahorse_pgp_key_set_property;
     gobject_class->get_property = seahorse_pgp_key_get_property;
     
-    key_class = SEAHORSE_KEY_CLASS (klass);
-    
-    key_class->get_num_names = seahorse_pgp_key_get_num_names;
-    key_class->get_name = seahorse_pgp_key_get_name;
-    key_class->get_name_cn = seahorse_pgp_key_get_name_cn;
-    key_class->get_name_markup = seahorse_pgp_key_get_name_markup;
-    key_class->get_name_validity = seahorse_pgp_key_get_name_validity;
-    
     g_object_class_install_property (gobject_class, PROP_PUBKEY,
         g_param_spec_pointer ("pubkey", "Gpgme Public Key", "Gpgme Public Key that this object represents",
                               G_PARAM_READWRITE));
@@ -508,18 +463,6 @@
         g_param_spec_pointer ("seckey", "Gpgme Secret Key", "Gpgme Secret Key that this object represents",
                               G_PARAM_READWRITE));
                       
-    g_object_class_install_property (gobject_class, PROP_DISPLAY_NAME,
-        g_param_spec_string ("display-name", "Display Name", "User Displayable name for this key",
-                             "", G_PARAM_READABLE));
-                      
-    g_object_class_install_property (gobject_class, PROP_DISPLAY_ID,
-        g_param_spec_string ("display-id", "Display ID", "User Displayable id for this key",
-                             "", G_PARAM_READABLE));
-                      
-    g_object_class_install_property (gobject_class, PROP_SIMPLE_NAME,
-        g_param_spec_string ("simple-name", "Simple Name", "Simple name for this key",
-                             "", G_PARAM_READABLE));
-                      
     g_object_class_install_property (gobject_class, PROP_FINGERPRINT,
         g_param_spec_string ("fingerprint", "Fingerprint", "Unique fingerprint for this key",
                              "", G_PARAM_READABLE));
@@ -551,11 +494,6 @@
     g_object_class_install_property (gobject_class, PROP_LENGTH,
         g_param_spec_uint ("length", "Length", "The length of this key.",
                            0, G_MAXUINT, 0, G_PARAM_READABLE));
-                           
-    g_object_class_install_property (gobject_class, PROP_STOCK_ID,
-        g_param_spec_string ("stock-id", "The stock icon", "The stock icon id",
-                             NULL, G_PARAM_READABLE));
-
 }
 
 
@@ -577,7 +515,7 @@
                       gpgme_key_t seckey)
 {
     SeahorsePGPKey *pkey;
-    pkey = g_object_new (SEAHORSE_TYPE_PGP_KEY, "key-source", sksrc,
+    pkey = g_object_new (SEAHORSE_TYPE_PGP_KEY, "source", sksrc,
                          "pubkey", pubkey, "seckey", seckey, NULL);
     return pkey;
 }
@@ -811,7 +749,7 @@
     if (sobj) {
         if (seahorse_object_get_usage (sobj) == SEAHORSE_USAGE_PRIVATE_KEY) 
             return SKEY_PGPSIG_TRUSTED | SKEY_PGPSIG_PERSONAL;
-        if (seahorse_object_get_flags (sobj) & SKEY_FLAG_TRUSTED)
+        if (seahorse_object_get_flags (sobj) & SEAHORSE_FLAG_TRUSTED)
             return SKEY_PGPSIG_TRUSTED;
     }
 
@@ -855,3 +793,58 @@
     
     return keyid;
 }
+
+const gchar* 
+seahorse_pgp_key_get_rawid (GQuark keyid)
+{
+	const gchar* id, *rawid;
+	
+	id = g_quark_to_string (keyid);
+	g_return_val_if_fail (id != NULL, NULL);
+	
+	rawid = strchr (id, ':');
+	return rawid ? rawid + 1 : id;
+}
+
+void
+seahorse_pgp_key_reload (SeahorsePGPKey *pkey)
+{
+	SeahorseSource *src;
+	
+	g_return_if_fail (SEAHORSE_IS_PGP_KEY (pkey));
+	src = seahorse_object_get_source (SEAHORSE_OBJECT (pkey));
+	g_return_if_fail (SEAHORSE_IS_PGP_SOURCE (src));
+	seahorse_source_load_async (src, seahorse_object_get_id (SEAHORSE_OBJECT (pkey)));
+}
+
+gulong
+seahorse_pgp_key_get_expires (SeahorsePGPKey *self)
+{
+	gulong expires;
+	g_object_get (self, "expires", &expires, NULL);
+	return expires;
+}
+
+gchar*
+seahorse_pgp_key_get_expires_str (SeahorsePGPKey *self)
+{
+	gchar *expires;
+	g_object_get (self, "expires-str", &expires, NULL);
+	return expires;
+}
+
+gchar*
+seahorse_pgp_key_get_fingerprint (SeahorsePGPKey *self)
+{
+	gchar *fpr;
+	g_object_get (self, "fingerprint", &fpr, NULL);
+	return fpr;	
+}
+
+SeahorseValidity
+seahorse_pgp_key_get_trust (SeahorsePGPKey *self)
+{
+    guint validity;
+    g_object_get (self, "trust", &validity, NULL);
+    return validity;
+}

Modified: trunk/pgp/seahorse-pgp-key.h
==============================================================================
--- trunk/pgp/seahorse-pgp-key.h	(original)
+++ trunk/pgp/seahorse-pgp-key.h	Sat Nov 29 17:37:20 2008
@@ -19,31 +19,13 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/**
- * SeahorsePGPKey: Represents a PGP key loaded via GPGME.
- * 
- * - Derived from SeahorseKey
- * - Stuff from seahorse-key-op.c should eventually be merged in here.
- * 
- * Properties:
- *   display-name: (gchar*) The display name for the key.
- *   display-id: (gchar*) The keyid to display.
- *   simple-name: (gchar*) Shortened display name for the key (for use in files etc...).
- *   fingerprint: (gchar*) Displayable fingerprint for the key.
- *   validity: (SeahorseValidity) The key validity.
- *   trust: (SeahorseValidity) Trust for the key.
- *   expires: (gulong) Date this key expires or 0.
- *   length: (gint) The length of the key in bits.
- *   stock-id: (string) The stock icon id.
- */
- 
 #ifndef __SEAHORSE_PGP_KEY_H__
 #define __SEAHORSE_PGP_KEY_H__
 
 #include <gtk/gtk.h>
 #include <gpgme.h>
 
-#include "seahorse-key.h"
+#include "seahorse-object.h"
 
 #include "pgp/seahorse-gpgmex.h"
 #include "pgp/seahorse-pgp-module.h"
@@ -55,6 +37,12 @@
     SKEY_PGPSIG_PERSONAL = 0x0002
 };
 
+typedef enum {
+    SKEY_INFO_NONE,     /* We have no information on this key */
+    SKEY_INFO_BASIC,    /* We have the usual basic quick info loaded */
+    SKEY_INFO_COMPLETE  /* All info */
+} SeahorseKeyInfo;
+
 #define SEAHORSE_TYPE_PGP_KEY            (seahorse_pgp_key_get_type ())
 
 /* For vala's sake */
@@ -71,23 +59,27 @@
 typedef struct _SeahorsePGPKeyClass SeahorsePGPKeyClass;
 
 struct _SeahorsePGPKey {
-    SeahorseKey	                parent;
+    SeahorseObject              parent;
 
     /*< public >*/
     gpgme_key_t                 pubkey;         /* The public key */
     gpgme_key_t                 seckey;         /* The secret key */
     gpgmex_photo_id_t           photoids;       /* List of photos */
     GList                       *uids;		/* All the UID objects */
+    SeahorseKeyInfo		loaded;		/* What's loaded */
+    
 };
 
 struct _SeahorsePGPKeyClass {
-    SeahorseKeyClass            parent_class;
+    SeahorseObjectClass         parent_class;
 };
 
 SeahorsePGPKey* seahorse_pgp_key_new                  (SeahorseSource *sksrc,
                                                        gpgme_key_t        pubkey,
                                                        gpgme_key_t        seckey);
 
+void            seahorse_pgp_key_reload               (SeahorsePGPKey *pkey);
+
 GType           seahorse_pgp_key_get_type             (void);
 
 guint           seahorse_pgp_key_get_num_subkeys      (SeahorsePGPKey   *pkey);
@@ -100,13 +92,22 @@
 SeahorsePGPUid* seahorse_pgp_key_get_uid              (SeahorsePGPKey *pkey, 
                                                        guint index);
 
-                                                       
+gulong          seahorse_pgp_key_get_expires          (SeahorsePGPKey *self);
+
+gchar*          seahorse_pgp_key_get_expires_str      (SeahorsePGPKey *self);
+
+gchar*          seahorse_pgp_key_get_fingerprint      (SeahorsePGPKey *self);
+
+SeahorseValidity seahorse_pgp_key_get_trust           (SeahorsePGPKey *self);
+
 const gchar*    seahorse_pgp_key_get_algo             (SeahorsePGPKey   *pkey,
                                                        guint            index);
 
 const gchar*    seahorse_pgp_key_get_id               (gpgme_key_t      key,
                                                        guint            index);
 
+const gchar*    seahorse_pgp_key_get_rawid            (GQuark keyid);
+
 guint           seahorse_pgp_key_get_num_photoids     (SeahorsePGPKey   *pkey);
  
 gpgmex_photo_id_t seahorse_pgp_key_get_nth_photoid    (SeahorsePGPKey   *pkey,

Modified: trunk/pgp/seahorse-pgp-keysets.c
==============================================================================
--- trunk/pgp/seahorse-pgp-keysets.c	(original)
+++ trunk/pgp/seahorse-pgp-keysets.c	Sat Nov 29 17:37:20 2008
@@ -22,7 +22,7 @@
 #include "config.h"
 
 #include "seahorse-gconf.h"
-#include "seahorse-key.h"
+#include "seahorse-object.h"
 
 #include "seahorse-pgp-module.h"
 #include "seahorse-pgp-keysets.h"
@@ -42,16 +42,15 @@
 static gboolean 
 pgp_signers_match (SeahorseObject *obj, gpointer data)
 {
-    SeahorseKey *key, *defkey;
+    SeahorseObject *defkey;
     
-    if (!SEAHORSE_IS_KEY (obj))
+    if (!SEAHORSE_IS_OBJECT (obj))
 	    return FALSE;
     
-    key = SEAHORSE_KEY (obj);
     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))
+    if (defkey && seahorse_object_get_id (obj) != seahorse_object_get_id (defkey))
         return FALSE;
     
     return TRUE;
@@ -60,14 +59,14 @@
 SeahorseSet*     
 seahorse_keyset_pgp_signers_new ()
 {
-    SeahorseObjectPredicate *pred = g_new0(SeahorseObjectPredicate, 1);
+    SeahorseObjectPredicate *pred = g_new0 (SeahorseObjectPredicate, 1);
     SeahorseSet *skset;
     
     pred->location = SEAHORSE_LOCATION_LOCAL;
     pred->tag = SEAHORSE_PGP;
     pred->usage = SEAHORSE_USAGE_PRIVATE_KEY;
-    pred->flags = SKEY_FLAG_CAN_SIGN;
-    pred->nflags = SKEY_FLAG_EXPIRED | SKEY_FLAG_REVOKED | SKEY_FLAG_DISABLED;
+    pred->flags = SEAHORSE_FLAG_CAN_SIGN;
+    pred->nflags = SEAHORSE_FLAG_EXPIRED | SEAHORSE_FLAG_REVOKED | SEAHORSE_FLAG_DISABLED;
     pred->custom = pgp_signers_match;
     
     skset = seahorse_set_new_full (pred);

Modified: trunk/pgp/seahorse-pgp-revoke.c
==============================================================================
--- trunk/pgp/seahorse-pgp-revoke.c	(original)
+++ trunk/pgp/seahorse-pgp-revoke.c	Sat Nov 29 17:37:20 2008
@@ -25,7 +25,7 @@
  
 #include <glib/gi18n.h>
  
-#include "seahorse-key-widget.h"
+#include "seahorse-object-widget.h"
 #include "seahorse-libdialogs.h"
 #include "seahorse-util.h"
 
@@ -42,7 +42,7 @@
 static void
 ok_clicked (GtkButton *button, SeahorseWidget *swidget)
 {
-	SeahorseKeyWidget *skwidget;
+	SeahorseObjectWidget *skwidget;
 	guint index;
 	SeahorseRevokeReason reason;
 	const gchar *description;
@@ -52,25 +52,23 @@
 	GtkTreeIter iter;
 	GValue value;
 	
-	skwidget = SEAHORSE_KEY_WIDGET (swidget);
-	
-	index = skwidget->index;
+	skwidget = SEAHORSE_OBJECT_WIDGET (swidget);
+	index = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (skwidget), "index"));
 	
 	widget = glade_xml_get_widget (swidget->xml, "reason");
 	model = gtk_combo_box_get_model (GTK_COMBO_BOX (widget));
 	gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter);
 	
-    memset(&value, 0, sizeof(value));
+	memset(&value, 0, sizeof(value));
 	gtk_tree_model_get_value (model, &iter, COLUMN_INT, &value);
-    reason = g_value_get_int (&value);
-    g_value_unset (&value);
+	reason = g_value_get_int (&value);
+	g_value_unset (&value);
 	
-	description = gtk_entry_get_text (GTK_ENTRY (
-		glade_xml_get_widget (swidget->xml, "description")));
+	description = gtk_entry_get_text (GTK_ENTRY (glade_xml_get_widget (swidget->xml, "description")));
 	
-	if (skwidget->index != 0) {
-		err = seahorse_pgp_key_op_revoke_subkey (SEAHORSE_PGP_KEY (skwidget->skey), 
-                                             skwidget->index, reason, description);
+	if (index != 0) {
+		err = seahorse_pgp_key_op_revoke_subkey (SEAHORSE_PGP_KEY (skwidget->object), 
+		                                         index, reason, description);
 		if (!GPG_IS_OK (err))
 			seahorse_pgp_handle_gpgme_error (err, _("Couldn't revoke subkey"));
 	}
@@ -82,30 +80,30 @@
 {
 	SeahorseWidget *swidget;
 	gchar *title;
-    gchar *userid;
-    GtkWidget *widget;
-    GtkListStore *store;
-    GtkTreeIter iter;
+	const gchar *userid;
+	GtkWidget *widget;
+	GtkListStore *store;
+	GtkTreeIter iter;
 	GtkCellRenderer *renderer;
 	
 	g_return_if_fail (pkey != NULL && SEAHORSE_IS_PGP_KEY (pkey));
 	g_return_if_fail (index <= seahorse_pgp_key_get_num_subkeys (pkey));
 	
-	swidget = seahorse_key_widget_new_with_index ("revoke", parent, SEAHORSE_KEY (pkey), index);
+	swidget = seahorse_object_widget_new ("revoke", parent, SEAHORSE_OBJECT (pkey));
 	g_return_if_fail (swidget != NULL);
 	
 	glade_xml_signal_connect_data (swidget->xml, "ok_clicked",
 		G_CALLBACK (ok_clicked), swidget);
 	
-    userid = seahorse_key_get_name (SEAHORSE_KEY (pkey), 0);
+	userid = seahorse_object_get_label (SEAHORSE_OBJECT (pkey));
 	if (index)
 		title = g_strdup_printf (_("Revoke Subkey %d of %s"), index, userid);
 	else
 		title = g_strdup_printf (_("Revoke %s"), userid);
-	g_free (userid);
    
+	g_object_set_data (G_OBJECT (swidget), "index", GUINT_TO_POINTER (index));
 	gtk_window_set_title (GTK_WINDOW (glade_xml_get_widget (swidget->xml,
-		                  swidget->name)), title);
+		              swidget->name)), title);
 
     /* Initialize List Store for the Combo Box */
     store = gtk_list_store_new(N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT);
@@ -159,26 +157,22 @@
 	GtkWidget *dialog;
 	gint response;
 	gpgme_error_t err;
-    gchar *userid1, *userid2;
+	const gchar *userid1, *userid2;
 	
 	g_return_if_fail (pkey != NULL && SEAHORSE_IS_PGP_KEY (pkey));
 
-    /* TODO: Limit to selecting only PGP keys */
-    revoker = SEAHORSE_PGP_KEY (seahorse_signer_get (parent));
-    if (revoker == NULL)
-        return;
+	revoker = SEAHORSE_PGP_KEY (seahorse_signer_get (parent));
+	if (revoker == NULL)
+		return;
 	
-    userid1 = seahorse_key_get_name (SEAHORSE_KEY (revoker), 0);
-    userid2 = seahorse_key_get_name (SEAHORSE_KEY (pkey), 0);
+	userid1 = seahorse_object_get_label (SEAHORSE_OBJECT (revoker));
+	userid2 = seahorse_object_get_label (SEAHORSE_OBJECT (pkey));
 
 	dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL,
 		GTK_MESSAGE_WARNING, GTK_BUTTONS_YES_NO,
 		_("You are about to add %s as a revoker for %s."
 		" This operation cannot be undone! Are you sure you want to continue?"),
 		userid1, userid2);
-	
-    g_free (userid1);
-    g_free (userid2);
     
 	response = gtk_dialog_run (GTK_DIALOG (dialog));
 	gtk_widget_destroy (dialog);

Modified: trunk/pgp/seahorse-pgp-sign.c
==============================================================================
--- trunk/pgp/seahorse-pgp-sign.c	(original)
+++ trunk/pgp/seahorse-pgp-sign.c	Sat Nov 29 17:37:20 2008
@@ -22,33 +22,34 @@
 
 #include "config.h"
 
-#include <glib/gi18n.h>
-
-#include "seahorse-key-widget.h"
-#include "seahorse-util.h"
-#include "seahorse-set.h"
-#include "seahorse-gtkstock.h"
 #include "seahorse-combo-keys.h"
 #include "seahorse-gconf.h"
+#include "seahorse-gtkstock.h"
+#include "seahorse-object-widget.h"
+#include "seahorse-set.h"
+#include "seahorse-util.h"
 
 #include "pgp/seahorse-pgp-dialogs.h"
 #include "pgp/seahorse-pgp-key-op.h"
 #include "pgp/seahorse-pgp-keysets.h"
 
+#include <glib/gi18n.h>
+
 static gboolean
 ok_clicked (SeahorseWidget *swidget)
 {
-    SeahorseKeyWidget *skwidget;
+    SeahorseObjectWidget *skwidget;
     SeahorseSignCheck check;
     SeahorseSignOptions options = 0;
-    SeahorseKey *signer;
+    SeahorseObject *signer;
     GtkWidget *w;
     gpgme_error_t err;
-    SeahorseKey *skey;
+    SeahorseObject *object;
     GList *keys;
+    guint index;
     
-    skwidget = SEAHORSE_KEY_WIDGET (swidget);
-    skey = skwidget->skey;
+    skwidget = SEAHORSE_OBJECT_WIDGET (swidget);
+    object = skwidget->object;
     
     /* Figure out choice */
     check = SIGN_CHECK_NO_ANSWER;
@@ -87,11 +88,12 @@
     signer = seahorse_combo_keys_get_active (GTK_COMBO_BOX (w));
     
     g_assert (!signer || (SEAHORSE_IS_PGP_KEY (signer) && 
-                          seahorse_key_get_usage (signer) == SEAHORSE_USAGE_PRIVATE_KEY));
+                          seahorse_object_get_usage (SEAHORSE_OBJECT (signer)) == SEAHORSE_USAGE_PRIVATE_KEY));
     
-    err = seahorse_pgp_key_op_sign (SEAHORSE_PGP_KEY (skey), 
+    index = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (swidget), "index"));
+    err = seahorse_pgp_key_op_sign (SEAHORSE_PGP_KEY (object), 
                                     SEAHORSE_PGP_KEY (signer), 
-                                    skwidget->index + 1, check, options);
+                                    index + 1, check, options);
     if (!GPG_IS_OK (err))
         seahorse_pgp_handle_gpgme_error (err, _("Couldn't sign key"));
     
@@ -99,7 +101,7 @@
     
 #ifdef WITH_KEYSERVER
     if (GPG_IS_OK (err) && seahorse_gconf_get_boolean (AUTOSYNC_KEY)) {
-        keys = g_list_append (NULL, skey);
+        keys = g_list_append (NULL, object);
         /* TODO: This cross module dependency needs to be fixed */
         /* seahorse_keyserver_sync (keys); */
         g_list_free (keys);
@@ -139,14 +141,14 @@
 }
 
 void
-seahorse_pgp_sign_prompt (SeahorsePGPKey *pkey, guint uid, GtkWindow *parent)
+seahorse_pgp_sign_prompt (SeahorsePGPKey *pkey, guint index, GtkWindow *parent)
 {
     SeahorseSet *skset;
     GtkWidget *w;
     gint response;
     SeahorseWidget *swidget;
     gboolean do_sign = TRUE;
-    gchar *t;
+    SeahorsePGPUid *uid;
     gchar *userid;
 
     /* Some initial checks */
@@ -161,19 +163,19 @@
         return;
     }
 
-    swidget = seahorse_key_widget_new_with_index ("sign", parent, SEAHORSE_KEY (pkey), uid);
+    swidget = seahorse_object_widget_new ("sign", parent, SEAHORSE_OBJECT (pkey));
     g_return_if_fail (swidget != NULL);
+    
+    g_object_set_data (G_OBJECT (swidget), "index", GUINT_TO_POINTER (index));
 
     /* ... Except for when calling this, which is messed up */
     w = glade_xml_get_widget (swidget->xml, "sign-uid-text");
     g_return_if_fail (w != NULL);
-    t = seahorse_key_get_name (SEAHORSE_KEY (pkey), uid);
-    userid = g_markup_escape_text (t, -1);
-    g_free (t);
-    t = g_strdup_printf ("<i>%s</i>", userid);
+    uid = seahorse_pgp_key_get_uid (pkey, index);
+    g_return_if_fail (uid);
+    userid = g_markup_printf_escaped("<i>%s</i>", seahorse_object_get_label (SEAHORSE_OBJECT (uid)));
+    gtk_label_set_markup (GTK_LABEL (w), userid);
     g_free (userid);
-    gtk_label_set_markup (GTK_LABEL (w), t);
-    g_free (t);
     
     /* Uncheck all selections */
     w = glade_xml_get_widget (swidget->xml, "sign-choice-not");

Modified: trunk/pgp/seahorse-pgp-source.c
==============================================================================
--- trunk/pgp/seahorse-pgp-source.c	(original)
+++ trunk/pgp/seahorse-pgp-source.c	Sat Nov 29 17:37:20 2008
@@ -312,7 +312,7 @@
  
     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));
+                           0, G_MAXUINT, SEAHORSE_TAG_INVALID, 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.",
@@ -322,7 +322,7 @@
         g_param_spec_uint ("location", "Key Location", "Where the key is stored. See SeahorseLocation", 
                            0, G_MAXUINT, SEAHORSE_LOCATION_INVALID, G_PARAM_READABLE));    
     
-	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_PGP_SOURCE, "key-source", "local", SEAHORSE_PGP_STR, NULL);
+	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_PGP_SOURCE, "source", "local", SEAHORSE_PGP_STR, NULL);
 
 }
 
@@ -452,67 +452,9 @@
  * HELPERS 
  */
 
-
-static void
-key_changed (SeahorseKey *skey, SeahorseKeyChange change, SeahorseSource *sksrc)
-{
-    SeahorsePGPKey *pkey;
-    SeahorsePGPSource *psrc;
-    SeahorseUsage etype;
-    SeahorseLoadOperation *lop;
-    const gchar *patterns[2];
-    guint parts;
-    
-    /* TODO: We need to fix these key change flags. Currently the only thing
-     * that sets 'ALL' is when we replace a key in an skey. We don't 
-     * need to reload in that case */
-    
-    if (change == SKEY_CHANGE_ALL)
-        return;
-    
-    etype = seahorse_key_get_usage (skey);
-    
-    g_return_if_fail (SEAHORSE_IS_PGP_KEY (skey));
-    pkey = SEAHORSE_PGP_KEY (skey);
-    g_return_if_fail (pkey->pubkey);
-    
-    psrc = SEAHORSE_PGP_SOURCE (seahorse_key_get_source (skey));
-    g_assert (SEAHORSE_IS_PGP_SOURCE (psrc));
-    
-    patterns[0] = seahorse_pgp_key_get_id (pkey->pubkey, 0);
-    patterns[1] = NULL;
-    
-    parts = 0;
-    if (seahorse_key_get_loaded (skey) == SKEY_INFO_COMPLETE) {
-        parts |= LOAD_FULL;
-        if (change == SKEY_CHANGE_PHOTOS || change == SKEY_CHANGE_UIDS)
-            parts |= LOAD_PHOTOS;
-    }
-    
-    /* Schedule a dummy refresh. This blocks all monitoring for a while */
-    cancel_scheduled_refresh (psrc);
-    psrc->pv->scheduled_refresh = g_timeout_add (500, scheduled_dummy, psrc);
-    DEBUG_REFRESH ("scheduled a dummy refresh\n");
-    
-    lop = seahorse_load_operation_start (psrc, patterns, parts, FALSE);
-    seahorse_multi_operation_take (psrc->pv->operations, SEAHORSE_OPERATION (lop));
-
-    if (etype == SEAHORSE_USAGE_PRIVATE_KEY) {
-        lop = seahorse_load_operation_start (psrc, patterns, parts, TRUE);
-        seahorse_multi_operation_take (psrc->pv->operations, SEAHORSE_OPERATION (lop));
-    }
-}
-
-static void
-key_destroyed (SeahorseKey *skey, SeahorseSource *sksrc)
-{
-    g_signal_handlers_disconnect_by_func (skey, key_changed, sksrc);
-    g_signal_handlers_disconnect_by_func (skey, key_destroyed, sksrc);
-}
-
 /* Remove the given key from the context */
 static void
-remove_key_from_context (gpointer kt, SeahorseKey *dummy, SeahorsePGPSource *psrc)
+remove_key_from_context (gpointer kt, SeahorseObject *dummy, SeahorsePGPSource *psrc)
 {
     /* This function gets called as a GHRFunc on the lctx->checks hashtable. */
     GQuark keyid = GPOINTER_TO_UINT (kt);
@@ -590,10 +532,6 @@
     if (pkey == NULL)
         pkey = seahorse_pgp_key_new (SEAHORSE_SOURCE (psrc), key, NULL);
     
-    /* We listen in to get notified of changes on this key */
-    g_signal_connect (pkey, "changed", G_CALLBACK (key_changed), SEAHORSE_SOURCE (psrc));
-    g_signal_connect (pkey, "destroy", G_CALLBACK (key_destroyed), SEAHORSE_SOURCE (psrc));
-
     /* Add to context */ 
     seahorse_context_take_object (SCTX_APP (), SEAHORSE_OBJECT (pkey));
 
@@ -963,7 +901,7 @@
     DEBUG_REFRESH ("scheduled a dummy refresh\n");
  
     if (keyid)
-        match = seahorse_key_get_rawid (keyid);
+        match = seahorse_pgp_key_get_rawid (keyid);
     
     patterns[0] = match;
     patterns[1] = NULL;
@@ -1022,7 +960,7 @@
 	SeahorsePGPOperation *pop;
 	SeahorsePGPSource *psrc;
 	SeahorsePGPKey *pkey;
-	SeahorseKey *skey;
+	SeahorseObject *object;
 	ExportContext *ctx;
 	gpgme_data_t data;
 	const gchar *keyid;
@@ -1062,8 +1000,8 @@
         	g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (l->data), NULL);
         	pkey = SEAHORSE_PGP_KEY (l->data);
         
-        	skey = SEAHORSE_KEY (l->data);       
-        	g_return_val_if_fail (seahorse_object_get_source (SEAHORSE_OBJECT (skey)) == sksrc, NULL);
+        	object = SEAHORSE_OBJECT (l->data);
+        	g_return_val_if_fail (seahorse_object_get_source (object) == sksrc, NULL);
         
         	/* Building list */
         	keyid = seahorse_pgp_key_get_id (pkey->pubkey, 0);

Modified: trunk/pgp/seahorse-pgp-uid.c
==============================================================================
--- trunk/pgp/seahorse-pgp-uid.c	(original)
+++ trunk/pgp/seahorse-pgp-uid.c	Sat Nov 29 17:37:20 2008
@@ -34,12 +34,8 @@
 	PROP_PUBKEY,
 	PROP_USERID,
 	PROP_INDEX,
-	PROP_DISPLAY_NAME,
-	PROP_MARKUP,
-	PROP_SIMPLE_NAME,
 	PROP_VALIDITY,
-	PROP_VALIDITY_STR,
-	PROP_STOCK_ID
+	PROP_VALIDITY_STR
 };
 
 G_DEFINE_TYPE (SeahorsePGPUid, seahorse_pgp_uid, SEAHORSE_TYPE_OBJECT);
@@ -75,43 +71,53 @@
 }
 
 static void
-changed_uid (SeahorsePGPUid *uid)
+changed_uid (SeahorsePGPUid *self)
 {
-	SeahorseObject *obj = SEAHORSE_OBJECT (uid);
-    
-	obj->_id = 0;
-	obj->_tag = SEAHORSE_PGP;
-    
-	if (!uid->userid || !uid->pubkey) {
-        
-		obj->_usage = SEAHORSE_USAGE_NONE;
-		obj->_flags = SKEY_FLAG_DISABLED;
+	SeahorseObject *obj = SEAHORSE_OBJECT (self);
+	SeahorseLocation loc;
+	GQuark id = 0;
+	gchar *name, *markup;
+	
+	if (!self->userid || !self->pubkey) {
         
-	} else {
+		g_object_set (self,
+		              "id", id,
+		              "label", "",
+		              "usage", SEAHORSE_USAGE_NONE,
+		              "markup", "",
+		              "location", SEAHORSE_LOCATION_INVALID,
+		              "flags", SEAHORSE_FLAG_DISABLED,
+		              NULL);
+		return;
 		
-		/* The key id */
-		if (uid->pubkey->subkeys)
-			obj->_id = seahorse_pgp_key_get_cannonical_id (uid->pubkey->subkeys->keyid);
-        
-		/* The location */
-		if (uid->pubkey->keylist_mode & GPGME_KEYLIST_MODE_EXTERN && 
-		    obj->_location <= SEAHORSE_LOCATION_REMOTE)
-			obj->_location = SEAHORSE_LOCATION_REMOTE;
-        
-		else if (obj->_location <= SEAHORSE_LOCATION_LOCAL)
-			obj->_location = SEAHORSE_LOCATION_LOCAL;
-        
-		/* The type */
-		obj->_usage = SEAHORSE_USAGE_IDENTITY;
+	} 
+		
+	/* The key id */
+	if (self->pubkey->subkeys)
+		id = seahorse_pgp_key_get_cannonical_id (self->pubkey->subkeys->keyid);
+
+	/* The location */
+	loc = seahorse_object_get_location (obj);
+	if (self->pubkey->keylist_mode & GPGME_KEYLIST_MODE_EXTERN && 
+	    loc <= SEAHORSE_LOCATION_REMOTE)
+		loc = SEAHORSE_LOCATION_REMOTE;
 
-		/* The flags */
-		obj->_flags = 0;
-	}
-    
-	if (!obj->_id)
-		obj->_id = g_quark_from_string (SEAHORSE_PGP_STR ":UNKNOWN UNKNOWN ");
-    
-	seahorse_object_fire_changed (obj, SEAHORSE_OBJECT_CHANGE_ALL);
+	else if (loc <= SEAHORSE_LOCATION_LOCAL)
+		loc = SEAHORSE_LOCATION_LOCAL;
+
+	name = seahorse_pgp_uid_get_display_name (self);
+	markup = seahorse_pgp_uid_get_markup (self, 0);
+	
+	g_object_set (self,
+		      "id", id,
+		      "label", name,
+		      "markup", markup,
+		      "usage", SEAHORSE_USAGE_IDENTITY,
+		      "flags", 0,
+		      NULL);
+	
+	g_free (name);
+	g_free (markup);
 }
 
 /* -----------------------------------------------------------------------------
@@ -121,7 +127,9 @@
 static void
 seahorse_pgp_uid_init (SeahorsePGPUid *uid)
 {
-    
+	g_object_set (uid, 
+	              "icon", "",
+	              NULL);
 }
 
 static void
@@ -140,24 +148,12 @@
 	case PROP_INDEX:
 		g_value_set_uint (value, uid->index);
 		break;
-	case PROP_DISPLAY_NAME:
-		g_value_take_string (value, seahorse_pgp_uid_get_display_name (uid));
-		break;
-	case PROP_MARKUP:
-		g_value_take_string (value, seahorse_pgp_uid_get_markup (uid, 0));
-		break;
-	case PROP_SIMPLE_NAME:        
-		g_value_take_string (value, seahorse_pgp_uid_get_name (uid));
-		break;
 	case PROP_VALIDITY:
 		g_value_set_uint (value, seahorse_pgp_uid_get_validity (uid));
 		break;
 	case PROP_VALIDITY_STR:
 		g_value_set_string (value, seahorse_validity_get_string (seahorse_pgp_uid_get_validity (uid)));
 		break;
-	case PROP_STOCK_ID:
-		g_value_set_string (value, ""); 
-		break;
 	}
 }
 
@@ -219,18 +215,6 @@
 	g_object_class_install_property (gobject_class, PROP_INDEX,
 	        g_param_spec_uint ("index", "Index", "Gpgme User ID Index",
 	                           0, G_MAXUINT, 0, G_PARAM_READWRITE));
-
-	g_object_class_install_property (gobject_class, PROP_DISPLAY_NAME,
-	        g_param_spec_string ("display-name", "Display Name", "User Displayable name for this uid",
-	                             "", G_PARAM_READABLE));
-
-	g_object_class_install_property (gobject_class, PROP_MARKUP,
-	        g_param_spec_string ("markup", "Display Markup", "GLib Markup",
-	                             "", G_PARAM_READABLE));
-                      
-	g_object_class_install_property (gobject_class, PROP_SIMPLE_NAME,
-	        g_param_spec_string ("simple-name", "Simple Name", "Simple name for this user id",
-	                             "", G_PARAM_READABLE));
          
 	g_object_class_install_property (gobject_class, PROP_VALIDITY,
 	        g_param_spec_uint ("validity", "Validity", "Validity of this identity",
@@ -239,10 +223,6 @@
         g_object_class_install_property (gobject_class, PROP_VALIDITY_STR,
                 g_param_spec_string ("validity-str", "Validity String", "Validity of this identity as a string",
                                      "", G_PARAM_READABLE));
-
-        g_object_class_install_property (gobject_class, PROP_STOCK_ID,
-                g_param_spec_string ("stock-id", "The stock icon", "The stock icon id",
-                                     NULL, G_PARAM_READABLE));
 }
 
 /* -----------------------------------------------------------------------------

Modified: trunk/pgp/seahorse-pgp-uid.h
==============================================================================
--- trunk/pgp/seahorse-pgp-uid.h	(original)
+++ trunk/pgp/seahorse-pgp-uid.h	Sat Nov 29 17:37:20 2008
@@ -19,26 +19,13 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/**
- * SeahorsePGPUid: Represents a PGP UID loaded via GPGME.
- * 
- * - Derived from SeahorseKey
- * 
- * Properties:
- *   label: (gchar*) The display name for the UID.
- *   markup: 
- *   simple-name: 
- *   validity: (SeahorseValidity) The key validity.
- *   stock-id: 
- */
- 
 #ifndef __SEAHORSE_PGP_UID_H__
 #define __SEAHORSE_PGP_UID_H__
 
 #include <gtk/gtk.h>
 #include <gpgme.h>
 
-#include "seahorse-key.h"
+#include "seahorse-object.h"
 
 #include "pgp/seahorse-pgp-module.h"
 #include "pgp/seahorse-gpgmex.h"

Modified: trunk/pgp/seahorse-server-source.c
==============================================================================
--- trunk/pgp/seahorse-server-source.c	(original)
+++ trunk/pgp/seahorse-server-source.c	Sat Nov 29 17:37:20 2008
@@ -90,7 +90,7 @@
     
     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));
+                           0, G_MAXUINT, SEAHORSE_TAG_INVALID, 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.",
@@ -285,7 +285,6 @@
     if (prev != NULL) {
         g_return_if_fail (SEAHORSE_IS_PGP_KEY (prev));
         combine_keys (ssrc, SEAHORSE_PGP_KEY (prev)->pubkey, key);
-        seahorse_object_fire_changed (prev, SKEY_CHANGE_UIDS);
         return;
     }
 

Modified: trunk/pgp/seahorse-signer.c
==============================================================================
--- trunk/pgp/seahorse-signer.c	(original)
+++ trunk/pgp/seahorse-signer.c	Sat Nov 29 17:37:20 2008
@@ -42,7 +42,7 @@
 {
     SeahorseWidget *swidget;
     SeahorseSet *skset;
-    SeahorseKey *skey = NULL;
+    SeahorseObject *object = NULL;
     GtkWidget *combo;
     GtkWidget *widget;
     gint response;
@@ -66,13 +66,13 @@
     /* If only one key (probably default) then return it immediately */
     if (nkeys == 1) {
         GList *keys = seahorse_set_get_objects (skset);
-        skey = SEAHORSE_KEY (keys->data);
+        object = SEAHORSE_OBJECT (keys->data);
         
         g_list_free (keys);
         g_object_unref (skset);
 
-        g_assert (SEAHORSE_IS_PGP_KEY (skey));
-        return SEAHORSE_PGP_KEY (skey);
+        g_assert (SEAHORSE_IS_PGP_KEY (object));
+        return SEAHORSE_PGP_KEY (object);
     }
     
     swidget = seahorse_widget_new ("signer", parent);
@@ -105,14 +105,14 @@
     }
 
     if (ok) {
-        skey = seahorse_combo_keys_get_active (GTK_COMBO_BOX (combo));
-        g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (skey), NULL);
+        object = seahorse_combo_keys_get_active (GTK_COMBO_BOX (combo));
+        g_return_val_if_fail (SEAHORSE_IS_PGP_KEY (object), NULL);
 
         /* Save this as the last key signed with */
-        seahorse_gconf_set_string (SEAHORSE_LASTSIGNER_KEY, skey == NULL ? 
-                        "" : g_quark_to_string (seahorse_key_get_keyid (skey)));
+        seahorse_gconf_set_string (SEAHORSE_LASTSIGNER_KEY, object == NULL ? 
+                        "" : g_quark_to_string (seahorse_object_get_id (object)));
     }
     
     seahorse_widget_destroy (swidget);
-    return SEAHORSE_PGP_KEY (skey);
+    return SEAHORSE_PGP_KEY (object);
 }

Modified: trunk/pgp/vala-build.stamp
==============================================================================
--- trunk/pgp/vala-build.stamp	(original)
+++ trunk/pgp/vala-build.stamp	Sat Nov 29 17:37:20 2008
@@ -1 +1 @@
-1221605122
+1227980068

Modified: trunk/pkcs11/seahorse-pkcs11-certificate.c
==============================================================================
--- trunk/pkcs11/seahorse-pkcs11-certificate.c	(original)
+++ trunk/pkcs11/seahorse-pkcs11-certificate.c	Sat Nov 29 17:37:20 2008
@@ -23,9 +23,10 @@
 
 #include "seahorse-pkcs11-certificate.h"
 
-#include "seahorse-key.h"
+#include "seahorse-object.h"
 #include "seahorse-pkcs11.h"
 #include "seahorse-util.h"
+#include "seahorse-validity.h"
 
 #include "libcryptui/crui-x509-cert.h"
 
@@ -38,18 +39,13 @@
 	PROP_0,
 	PROP_PKCS11_OBJECT,
 	PROP_PKCS11_ATTRIBUTES,
-	PROP_DISPLAY_NAME,
-	PROP_DISPLAY_ID,
-	PROP_MARKUP,
-	PROP_SIMPLE_NAME,
 	PROP_FINGERPRINT,
 	PROP_VALIDITY,
 	PROP_VALIDITY_STR,
 	PROP_TRUST,
 	PROP_TRUST_STR,
 	PROP_EXPIRES,
-	PROP_EXPIRES_STR,
-	PROP_STOCK_ID
+	PROP_EXPIRES_STR
 };
 
 struct _SeahorsePkcs11CertificatePrivate {
@@ -70,43 +66,92 @@
  * INTERNAL 
  */
 
+static gchar* 
+calc_display_name (SeahorsePkcs11Certificate *self) 
+{
+	SeahorsePkcs11CertificatePrivate *pv = SEAHORSE_PKCS11_CERTIFICATE_GET_PRIVATE (self);
+	gchar *label = NULL;
+	
+	if (pv->pkcs11_attributes != NULL) {
+		if (gp11_attributes_find_string (pv->pkcs11_attributes, CKA_LABEL, &label))
+			return label;
+	}
+	
+	/* TODO: Calculate something from the subject? */
+	return g_strdup (_("Certificate"));
+}
+
+static gchar* 
+calc_display_id (SeahorsePkcs11Certificate* self) 
+{
+	gsize len;
+	gchar *id, *ret;
+	
+	g_return_val_if_fail (SEAHORSE_PKCS11_IS_CERTIFICATE (self), NULL);
+	
+	id = seahorse_pkcs11_certificate_get_fingerprint (self);
+	g_return_val_if_fail (id, NULL);
+	
+	len = strlen (id);
+	if (len <= 8)
+		return id;
+
+	ret = g_strndup (id + (len - 8), 8);
+	g_free (id);
+	return ret;
+}
+
 static void 
 certificate_rebuild (SeahorsePkcs11Certificate* self) 
 {
 	SeahorsePkcs11CertificatePrivate *pv;
-	SeahorseObject *obj;
 	gboolean exportable;
+	gchar *name, *identifier;
+	guint flags;
 	
 	g_assert (SEAHORSE_PKCS11_IS_CERTIFICATE (self));
 	pv = SEAHORSE_PKCS11_CERTIFICATE_GET_PRIVATE (self);
-	obj = SEAHORSE_OBJECT (self);
-	
-	obj->_id = 0;
-	obj->_tag = SEAHORSE_PKCS11_TYPE;
 	
 	if (pv->pkcs11_attributes == NULL) {
-		obj->_location = SEAHORSE_LOCATION_INVALID;
-		obj->_usage = SEAHORSE_USAGE_NONE;
-		obj->_flags = SKEY_FLAG_DISABLED;
-	} else {
-		obj->_id = seahorse_pkcs11_id_from_attributes (pv->pkcs11_attributes);
-		obj->_location = SEAHORSE_LOCATION_LOCAL;
-		obj->_usage = SEAHORSE_USAGE_PUBLIC_KEY;
 		
-		exportable = FALSE;
-		if (!gp11_attributes_find_boolean (pv->pkcs11_attributes, CKA_EXTRACTABLE, &exportable))
-			exportable = FALSE;
-
-		obj->_flags = 0;
-		if (exportable)
-			obj->_flags |= SKEY_FLAG_EXPORTABLE;
+		g_object_set (self,
+		              "id", 0,
+		              "label", "",
+		              "icon", NULL,
+		              "usage", SEAHORSE_USAGE_NONE,
+		              "description", "",
+		              "identifier", "",
+		              "location", SEAHORSE_LOCATION_INVALID,
+		              "flags", SEAHORSE_FLAG_DISABLED,
+		              NULL);
+		return;
 		
-		/* TODO: Expiry, revoked, disabled etc... */
-		if (seahorse_pkcs11_certificate_get_trust (self) >= SEAHORSE_VALIDITY_MARGINAL)
-			obj->_flags |= SKEY_FLAG_TRUSTED;
-	}
-	
-	seahorse_object_fire_changed (obj, SEAHORSE_OBJECT_CHANGE_ALL);
+	} 
+
+	flags = 0;
+	if (gp11_attributes_find_boolean (pv->pkcs11_attributes, CKA_EXTRACTABLE, &exportable) && exportable)
+		flags |= SEAHORSE_FLAG_EXPORTABLE;
+
+	/* TODO: Expiry, revoked, disabled etc... */
+	if (seahorse_pkcs11_certificate_get_trust (self) >= SEAHORSE_VALIDITY_MARGINAL)
+		flags |= SEAHORSE_FLAG_TRUSTED;
+
+	name = calc_display_name (self);
+	identifier = calc_display_id (self);
+	
+	g_object_set (self,
+		      "id", seahorse_pkcs11_id_from_attributes (pv->pkcs11_attributes),
+		      "label", name,
+		      "icon", "",
+		      "usage", SEAHORSE_USAGE_PUBLIC_KEY,
+		      "description", _("Certificate"),
+		      "identifier", identifier,
+		      "location", SEAHORSE_LOCATION_LOCAL,
+		      "flags", 0,
+		      NULL);
+
+	g_free (name);
+	g_free (identifier);
 }
 
 
@@ -164,18 +209,6 @@
 	case PROP_PKCS11_ATTRIBUTES:
 		g_value_set_boxed (value, seahorse_pkcs11_certificate_get_pkcs11_attributes (self));
 		break;
-	case PROP_DISPLAY_NAME:
-		g_value_take_string (value, seahorse_object_get_display_name (SEAHORSE_OBJECT (self)));
-		break;
-	case PROP_DISPLAY_ID:
-		g_value_take_string (value, seahorse_pkcs11_certificate_get_display_id (self));
-		break;
-	case PROP_MARKUP:
-		g_value_take_string (value, seahorse_object_get_markup (SEAHORSE_OBJECT (self)));
-		break;
-	case PROP_SIMPLE_NAME:
-		g_value_take_string (value, seahorse_pkcs11_certificate_get_simple_name (self));
-		break;
 	case PROP_FINGERPRINT:
 		g_value_take_string (value, seahorse_pkcs11_certificate_get_fingerprint (self));
 		break;
@@ -197,9 +230,6 @@
 	case PROP_EXPIRES_STR:
 		g_value_take_string (value, seahorse_pkcs11_certificate_get_expires_str (self));
 		break;
-	case PROP_STOCK_ID:
-		g_value_take_string (value, seahorse_object_get_stock_id (SEAHORSE_OBJECT (self)));
-		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
 		break;
@@ -225,45 +255,10 @@
 	}
 }
 
-
-static gchar* 
-seahorse_pkcs11_certificate_get_display_name (SeahorseObject* base) 
-{
-	SeahorsePkcs11Certificate* self = SEAHORSE_PKCS11_CERTIFICATE (base);
-	SeahorsePkcs11CertificatePrivate *pv = SEAHORSE_PKCS11_CERTIFICATE_GET_PRIVATE (self);
-	gchar *label = NULL;
-	
-	if (pv->pkcs11_attributes != NULL) {
-		if (gp11_attributes_find_string (pv->pkcs11_attributes, CKA_LABEL, &label))
-			return label;
-	}
-	
-	/* TODO: Calculate something from the subject? */
-	return g_strdup (_("Certificate"));
-}
-
-static char* 
-seahorse_pkcs11_certificate_get_markup (SeahorseObject* base) 
-{
-	SeahorsePkcs11Certificate* self = SEAHORSE_PKCS11_CERTIFICATE (base);
-	gchar *display = seahorse_object_get_display_name (SEAHORSE_OBJECT (self));
-	gchar *markup = g_markup_escape_text (display, -1);
-	g_free (display);
-	return markup;
-}
-
-static char*
-seahorse_pkcs11_certificate_get_stock_id (SeahorseObject* base) 
-{
-	/* TODO: A certificate icon */
-	return g_strdup ("");
-}
-
 static void
 seahorse_pkcs11_certificate_class_init (SeahorsePkcs11CertificateClass *klass)
 {
 	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-	SeahorseObjectClass *sobj_class = SEAHORSE_OBJECT_CLASS (klass);
 	
 	seahorse_pkcs11_certificate_parent_class = g_type_class_peek_parent (klass);
 	g_type_class_add_private (klass, sizeof (SeahorsePkcs11CertificatePrivate));
@@ -273,10 +268,6 @@
 	gobject_class->set_property = seahorse_pkcs11_certificate_set_property;
 	gobject_class->get_property = seahorse_pkcs11_certificate_get_property;
 
-	sobj_class->get_display_name = seahorse_pkcs11_certificate_get_display_name;
-	sobj_class->get_markup = seahorse_pkcs11_certificate_get_markup;
-	sobj_class->get_stock_id = seahorse_pkcs11_certificate_get_stock_id;
-
 	g_object_class_install_property (gobject_class, PROP_PKCS11_OBJECT, 
 	         g_param_spec_object ("pkcs11-object", "pkcs11-object", "pkcs11-object", GP11_TYPE_OBJECT, 
 	                              G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
@@ -285,14 +276,6 @@
 	         g_param_spec_boxed ("pkcs11-attributes", "pkcs11-attributes", "pkcs11-attributes", GP11_TYPE_ATTRIBUTES, 
 	                             G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
 	
-	g_object_class_install_property (gobject_class, PROP_DISPLAY_ID, 
-	         g_param_spec_string ("display-id", "display-id", "display-id", NULL, 
-	                              G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	
-	g_object_class_install_property (gobject_class, PROP_SIMPLE_NAME, 
-	         g_param_spec_string ("simple-name", "simple-name", "simple-name", NULL, 
-	                              G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	
 	g_object_class_install_property (gobject_class, PROP_FINGERPRINT, 
 	         g_param_spec_string ("fingerprint", "fingerprint", "fingerprint", NULL, 
 	                              G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
@@ -320,12 +303,6 @@
 	g_object_class_install_property (gobject_class, PROP_EXPIRES_STR, 
 	         g_param_spec_string ("expires-str", "expires-str", "expires-str", NULL, 
 	                              G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	
-	g_object_class_override_property (gobject_class, PROP_MARKUP, "markup");
-	
-	g_object_class_override_property (gobject_class, PROP_DISPLAY_NAME, "display-name");
-	
-	g_object_class_override_property (gobject_class, PROP_STOCK_ID, "stock-id");
 }
 
 const guchar*
@@ -419,33 +396,6 @@
 	g_object_notify (G_OBJECT (self), "pkcs11-attributes");
 }
 
-gchar* 
-seahorse_pkcs11_certificate_get_display_id (SeahorsePkcs11Certificate* self) 
-{
-	gsize len;
-	gchar *id, *ret;
-	
-	g_return_val_if_fail (SEAHORSE_PKCS11_IS_CERTIFICATE (self), NULL);
-	
-	id = seahorse_pkcs11_certificate_get_fingerprint (self);
-	g_return_val_if_fail (id, NULL);
-	
-	len = strlen (id);
-	if (len <= 8)
-		return id;
-
-	ret = g_strndup (id + (len - 8), 8);
-	g_free (id);
-	return ret;
-}
-
-char* 
-seahorse_pkcs11_certificate_get_simple_name (SeahorsePkcs11Certificate* self) 
-{
-	g_return_val_if_fail (SEAHORSE_PKCS11_IS_CERTIFICATE (self), NULL);
-	return seahorse_object_get_display_name (SEAHORSE_OBJECT (self));
-}
-
 char* 
 seahorse_pkcs11_certificate_get_fingerprint (SeahorsePkcs11Certificate* self) 
 {

Modified: trunk/pkcs11/seahorse-pkcs11-certificate.h
==============================================================================
--- trunk/pkcs11/seahorse-pkcs11-certificate.h	(original)
+++ trunk/pkcs11/seahorse-pkcs11-certificate.h	Sat Nov 29 17:37:20 2008
@@ -62,10 +62,6 @@
 void                        seahorse_pkcs11_certificate_set_pkcs11_attributes  (SeahorsePkcs11Certificate* self, 
                                                                                 GP11Attributes* value);
 
-gchar*                      seahorse_pkcs11_certificate_get_display_id         (SeahorsePkcs11Certificate* self);
-
-gchar*                      seahorse_pkcs11_certificate_get_simple_name        (SeahorsePkcs11Certificate* self);
-
 gchar*                      seahorse_pkcs11_certificate_get_fingerprint        (SeahorsePkcs11Certificate* self);
 
 guint                       seahorse_pkcs11_certificate_get_validity           (SeahorsePkcs11Certificate* self);

Modified: trunk/pkcs11/seahorse-pkcs11-commands.c
==============================================================================
--- trunk/pkcs11/seahorse-pkcs11-commands.c	(original)
+++ trunk/pkcs11/seahorse-pkcs11-commands.c	Sat Nov 29 17:37:20 2008
@@ -106,7 +106,7 @@
 	num = g_list_length (objects);
 	
 	if (num == 1) {
-		display = seahorse_object_get_display_name (SEAHORSE_OBJECT (objects->data));
+		display = seahorse_object_get_label (SEAHORSE_OBJECT (objects->data));
 		prompt = g_strdup_printf (_("Are you sure you want to delete the certificate '%s'?"), display);
 		g_free (display);
 	} else {
@@ -233,7 +233,8 @@
 	slot_certificate_window = g_quark_from_static_string ("seahorse-pkcs11-commands-window");
 
 	/* Register this as a source of commands */
-	seahorse_registry_register_type (seahorse_registry_get (), SEAHORSE_PKCS11_TYPE_COMMANDS, "commands", NULL);
+	seahorse_registry_register_type (seahorse_registry_get (), SEAHORSE_PKCS11_TYPE_COMMANDS, 
+	                                 SEAHORSE_PKCS11_TYPE_STR, "commands", NULL);
 }
 
 /* -----------------------------------------------------------------------------

Modified: trunk/pkcs11/vala-build.stamp
==============================================================================
--- trunk/pkcs11/vala-build.stamp	(original)
+++ trunk/pkcs11/vala-build.stamp	Sat Nov 29 17:37:20 2008
@@ -1 +1 @@
-1227394203
+1227979999

Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in	(original)
+++ trunk/po/POTFILES.in	Sat Nov 29 17:37:20 2008
@@ -24,13 +24,14 @@
 libseahorse/seahorse-context.c
 libseahorse/seahorse-notification.c
 libseahorse/seahorse-notify.glade
+libseahorse/seahorse-object.c
 libseahorse/seahorse-passphrase.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-unknown-key.c
+libseahorse/seahorse-unknown.c
 libseahorse/seahorse-unknown-source.c
 libseahorse/seahorse-util.c
 libseahorse/seahorse-validity.c

Modified: trunk/src/seahorse-key-manager-store.c
==============================================================================
--- trunk/src/seahorse-key-manager-store.c	(original)
+++ trunk/src/seahorse-key-manager-store.c	Sat Nov 29 17:37:20 2008
@@ -60,9 +60,9 @@
 
 static const SeahorseSetModelColumn column_info[] = {
 	{ "usage", G_TYPE_UINT, "usage" },
-	{ "stock-id", G_TYPE_STRING, NULL },
-	{ "markup", G_TYPE_STRING, "name" },
-	{ "display-id", G_TYPE_STRING, "id" },
+	{ "icon", G_TYPE_STRING, NULL },
+	{ "markup", G_TYPE_STRING, "label" },
+	{ "identifier", G_TYPE_STRING, "id" },
 	{ "validity-str", G_TYPE_STRING, "validity" },
 	{ "trust-str", G_TYPE_STRING, "trust" },
 	{ "type", G_TYPE_STRING, "type" },
@@ -630,7 +630,7 @@
 	if (skstore->priv->drag_destination && !skstore->priv->drag_error) {
 		g_return_if_fail (skstore->priv->drag_objects);
 	
-		name = seahorse_util_filename_for_keys (skstore->priv->drag_objects);
+		name = seahorse_util_filename_for_objects (skstore->priv->drag_objects);
 		g_return_if_fail (name);
 	
 		filename = g_build_filename (skstore->priv->drag_destination, name, NULL);

Modified: trunk/src/seahorse-key-manager.c
==============================================================================
--- trunk/src/seahorse-key-manager.c	(original)
+++ trunk/src/seahorse-key-manager.c	Sat Nov 29 17:37:20 2008
@@ -21,7 +21,6 @@
 
 #include "seahorse-key-manager.h"
 #include <seahorse-types.h>
-#include <seahorse-key.h>
 #include <glib/gi18n-lib.h>
 #include <stdlib.h>
 #include <string.h>
@@ -164,8 +163,8 @@
 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
 static int _vala_strcmp0 (const char * str1, const char * str2);
 
-static const SeahorseObjectPredicate SEAHORSE_KEY_MANAGER_PRED_PUBLIC = {((GQuark) (0)), ((GQuark) (0)), SEAHORSE_LOCATION_LOCAL, SEAHORSE_USAGE_PUBLIC_KEY, ((guint) (0)), ((guint) (SKEY_FLAG_TRUSTED | SKEY_FLAG_IS_VALID)), NULL};
-static const SeahorseObjectPredicate SEAHORSE_KEY_MANAGER_PRED_TRUSTED = {((GQuark) (0)), ((GQuark) (0)), SEAHORSE_LOCATION_LOCAL, SEAHORSE_USAGE_PUBLIC_KEY, ((guint) (SKEY_FLAG_TRUSTED | SKEY_FLAG_IS_VALID)), ((guint) (0)), NULL};
+static const SeahorseObjectPredicate SEAHORSE_KEY_MANAGER_PRED_PUBLIC = {((GQuark) (0)), ((GQuark) (0)), SEAHORSE_LOCATION_LOCAL, SEAHORSE_USAGE_PUBLIC_KEY, ((guint) (0)), ((guint) (SEAHORSE_FLAG_TRUSTED | SEAHORSE_FLAG_IS_VALID)), NULL};
+static const SeahorseObjectPredicate SEAHORSE_KEY_MANAGER_PRED_TRUSTED = {((GQuark) (0)), ((GQuark) (0)), SEAHORSE_LOCATION_LOCAL, SEAHORSE_USAGE_PUBLIC_KEY, ((guint) (SEAHORSE_FLAG_TRUSTED | SEAHORSE_FLAG_IS_VALID)), ((guint) (0)), NULL};
 static const SeahorseObjectPredicate SEAHORSE_KEY_MANAGER_PRED_PRIVATE = {((GQuark) (0)), ((GQuark) (0)), SEAHORSE_LOCATION_LOCAL, SEAHORSE_USAGE_PRIVATE_KEY, ((guint) (0)), ((guint) (0)), NULL};
 static const SeahorseObjectPredicate SEAHORSE_KEY_MANAGER_PRED_PASSWORD = {((GQuark) (0)), ((GQuark) (0)), SEAHORSE_LOCATION_LOCAL, SEAHORSE_USAGE_CREDENTIALS, ((guint) (0)), ((guint) (0)), NULL};
 static const GtkActionEntry SEAHORSE_KEY_MANAGER_GENERAL_ENTRIES[] = {{"remote-menu", NULL, N_ ("_Remote")}, {"app-quit", GTK_STOCK_QUIT, N_ ("_Quit"), "<control>Q", N_ ("Close this program"), ((GCallback) (NULL))}, {"key-generate", GTK_STOCK_NEW, N_ ("_Create New Key..."), "<control>N", N_ ("Create a new personal key"), ((GCallback) (NULL))}, {"key-import-file", GTK_STOCK_OPEN, N_ ("_Import..."), "<control>I", N_ ("Import keys into your key ring from a file"), ((GCallback) (NULL))}, {"key-import-clipboard", GTK_STOCK_PASTE, N_ ("Paste _Keys"), "<control>V", N_ ("Import keys from the clipboard"), ((GCallback) (NULL))}};
@@ -995,7 +994,7 @@
 	if (self->priv->_loaded_gnome_keyring) {
 		return;
 	}
-	type = seahorse_registry_find_type (seahorse_registry_get (), "gnome-keyring", "local", "key-source", NULL, NULL);
+	type = seahorse_registry_find_type (seahorse_registry_get (), "gnome-keyring", "local", "source", NULL, NULL);
 	g_return_if_fail (type != 0);
 	sksrc = SEAHORSE_SOURCE (g_object_new (type, NULL, NULL));
 	seahorse_context_add_source (seahorse_context_for_app (), sksrc);

Modified: trunk/src/seahorse-key-manager.vala
==============================================================================
--- trunk/src/seahorse-key-manager.vala	(original)
+++ trunk/src/seahorse-key-manager.vala	Sat Nov 29 17:37:20 2008
@@ -67,7 +67,7 @@
 			Location.LOCAL,                         /* location */
 			Usage.PUBLIC_KEY,                       /* usage */
 			0,                                      /* flags */
-			Key.Flag.TRUSTED | Key.Flag.IS_VALID,   /* nflags */
+			Object.Flag.TRUSTED | Object.Flag.IS_VALID,   /* nflags */
 			null                                    /* sksrc */
 		};
 		
@@ -76,7 +76,7 @@
 			0,                                      /* id */
 			Location.LOCAL,                         /* location */
 			Usage.PUBLIC_KEY,                       /* usage */
-			Key.Flag.TRUSTED | Key.Flag.IS_VALID,   /* flags */
+			Object.Flag.TRUSTED | Object.Flag.IS_VALID,   /* flags */
 			0,                                      /* nflags */
 			null                                    /* sksrc */
 		};
@@ -719,7 +719,7 @@
 			if (_loaded_gnome_keyring)
 				return;
 			
-			GLib.Type type = Registry.get().find_type ("gnome-keyring", "local", "key-source", null);
+			GLib.Type type = Registry.get().find_type ("gnome-keyring", "local", "source", null);
 			return_if_fail (type != 0);
 
 			var sksrc = (Source)GLib.Object.new (type, null);

Modified: trunk/src/seahorse-keyserver-results.c
==============================================================================
--- trunk/src/seahorse-keyserver-results.c	(original)
+++ trunk/src/seahorse-keyserver-results.c	Sat Nov 29 17:37:20 2008
@@ -25,7 +25,6 @@
 #include <glib/gi18n-lib.h>
 #include <seahorse-widget.h>
 #include <seahorse-progress.h>
-#include <seahorse-key.h>
 #include <gdk/gdk.h>
 #include <seahorse-context.h>
 #include <seahorse-source.h>
@@ -162,7 +161,7 @@
 		return TRUE;
 	}
 	_tmp1 = NULL;
-	name = (_tmp1 = seahorse_key_get_display_name ((SEAHORSE_KEY (obj))), (_tmp1 == NULL ? NULL : g_strdup (_tmp1)));
+	name = (_tmp1 = seahorse_object_get_label (obj), (_tmp1 == NULL ? NULL : g_strdup (_tmp1)));
 	_tmp2 = NULL;
 	return (_tmp4 = (_tmp3 = ((name != NULL) && (strstr ((_tmp2 = g_utf8_casefold (name, -1)), self->priv->_search_string) != NULL)), (_tmp2 = (g_free (_tmp2), NULL)), _tmp3), (name = (g_free (name), NULL)), _tmp4);
 }

Modified: trunk/src/seahorse-keyserver-results.vala
==============================================================================
--- trunk/src/seahorse-keyserver-results.vala	(original)
+++ trunk/src/seahorse-keyserver-results.vala	Sat Nov 29 17:37:20 2008
@@ -163,7 +163,7 @@
 		private bool on_filter_objects (Object obj) {
 			if (_search_string.len() == 0)
 				return true;
-			string name = ((Key)obj).display_name;
+			string name = obj.label;
 			return ((name != null) && (name.casefold().str(_search_string) != null)); 
 		}
 

Modified: trunk/src/seahorse-keyserver-sync.c
==============================================================================
--- trunk/src/seahorse-keyserver-sync.c	(original)
+++ trunk/src/seahorse-keyserver-sync.c	Sat Nov 29 17:37:20 2008
@@ -25,8 +25,8 @@
 
 #include "seahorse-context.h"
 #include "seahorse-gconf.h"
-#include "seahorse-key.h"
 #include "seahorse-keyserver-sync.h"
+#include "seahorse-object.h"
 #include "seahorse-progress.h"
 #include "seahorse-preferences.h"
 #include "seahorse-servers.h"
@@ -167,7 +167,7 @@
                       GINT_TO_POINTER (notify_id));
 
     keys = g_list_copy (keys);
-    g_return_val_if_fail (!keys || SEAHORSE_IS_KEY (keys->data), win);
+    g_return_val_if_fail (!keys || SEAHORSE_IS_OBJECT (keys->data), win);
     g_object_set_data_full (G_OBJECT (swidget), "publish-keys", keys, 
                             (GDestroyNotify)g_list_free);
     
@@ -194,12 +194,12 @@
     if (!keys)
         return;
     
-    g_assert (SEAHORSE_IS_KEY (keys->data));
+    g_assert (SEAHORSE_IS_OBJECT (keys->data));
     
     /* Build a keyid list */
     for (k = keys; k; k = g_list_next (k)) 
         keyids = g_slist_prepend (keyids, 
-                    GUINT_TO_POINTER (seahorse_key_get_keyid (SEAHORSE_KEY (k->data))));
+                    GUINT_TO_POINTER (seahorse_object_get_id (SEAHORSE_OBJECT (k->data))));
 
     mop = seahorse_multi_operation_new ();
 

Modified: trunk/src/seahorse-viewer.c
==============================================================================
--- trunk/src/seahorse-viewer.c	(original)
+++ trunk/src/seahorse-viewer.c	Sat Nov 29 17:37:20 2008
@@ -22,7 +22,7 @@
 #include "config.h"
 
 #include "seahorse-commands.h"
-#include "seahorse-key.h"
+#include "seahorse-object.h"
 #include "seahorse-preferences.h"
 #include "seahorse-progress.h"
 #include "seahorse-util.h"
@@ -184,7 +184,7 @@
 	GList *l;
 	
 	for (l = objects; l; l = g_list_next (l)) {
-		if (seahorse_object_get_flags (l->data) & SKEY_FLAG_EXPORTABLE)
+		if (seahorse_object_get_flags (l->data) & SEAHORSE_FLAG_EXPORTABLE)
 			exportable = g_list_append (exportable, l->data);
 	}
 	
@@ -390,7 +390,7 @@
 			gchar* prompt = NULL;
 			if (num == 1)
 				prompt = g_strdup_printf (_("%s is a private key. Are you sure you want to proceed?"), 
-				                          seahorse_object_get_display_name (object));
+				                          seahorse_object_get_label (object));
 			else
 				prompt = g_strdup (_("One or more of the deleted keys are private keys. Are you sure you want to proceed?"));
 						

Modified: trunk/src/vala-build.stamp
==============================================================================
--- trunk/src/vala-build.stamp	(original)
+++ trunk/src/vala-build.stamp	Sat Nov 29 17:37:20 2008
@@ -1 +1 @@
-1224345310
+1227980124

Modified: trunk/ssh/libseahorse-ssh-c.vapi
==============================================================================
--- trunk/ssh/libseahorse-ssh-c.vapi	(original)
+++ trunk/ssh/libseahorse-ssh-c.vapi	Sat Nov 29 17:37:20 2008
@@ -42,7 +42,7 @@
         }
         
         [CCode (cheader_filename = "seahorse-ssh-key.h")]
-        public class Key : Seahorse.Key {
+        public class Key : Seahorse.Object {
         
         }
 }

Modified: trunk/ssh/seahorse-ssh-commands.c
==============================================================================
--- trunk/ssh/seahorse-ssh-commands.c	(original)
+++ trunk/ssh/seahorse-ssh-commands.c	Sat Nov 29 17:37:20 2008
@@ -83,7 +83,7 @@
 	if (num == 1) {
 		char* _tmp1;
 		_tmp1 = NULL;
-		prompt = (_tmp1 = g_strdup_printf (_ ("Are you sure you want to delete the secure shell key '%s'?"), seahorse_object_get_display_name (((SeahorseObject*) (((SeahorseObject*) (keys->data)))))), (prompt = (g_free (prompt), NULL)), _tmp1);
+		prompt = (_tmp1 = g_strdup_printf (_ ("Are you sure you want to delete the secure shell key '%s'?"), seahorse_object_get_label (((SeahorseObject*) (((SeahorseObject*) (keys->data)))))), (prompt = (g_free (prompt), NULL)), _tmp1);
 	} else {
 		char* _tmp2;
 		_tmp2 = NULL;

Modified: trunk/ssh/seahorse-ssh-commands.vala
==============================================================================
--- trunk/ssh/seahorse-ssh-commands.vala	(original)
+++ trunk/ssh/seahorse-ssh-commands.vala	Sat Nov 29 17:37:20 2008
@@ -74,7 +74,7 @@
 			
 			string prompt;
 			if (num == 1)
-				prompt = _("Are you sure you want to delete the secure shell key '%s'?").printf(keys.data.display_name);
+				prompt = _("Are you sure you want to delete the secure shell key '%s'?").printf(keys.data.label);
 			else
 				prompt = _("Are you sure you want to delete %d secure shell keys?").printf(num);
 			

Modified: trunk/ssh/seahorse-ssh-generate.c
==============================================================================
--- trunk/ssh/seahorse-ssh-generate.c	(original)
+++ trunk/ssh/seahorse-ssh-generate.c	Sat Nov 29 17:37:20 2008
@@ -135,7 +135,7 @@
         bits = 2048;
     }
     
-    src = SEAHORSE_SSH_SOURCE (g_object_get_data (G_OBJECT (swidget), "key-source"));
+    src = SEAHORSE_SSH_SOURCE (g_object_get_data (G_OBJECT (swidget), "source"));
     g_return_if_fail (SEAHORSE_IS_SSH_SOURCE (src));
     
     /* We start creation */
@@ -176,7 +176,7 @@
     gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
     
     g_object_ref (src);
-    g_object_set_data_full (G_OBJECT (swidget), "key-source", src, g_object_unref);
+    g_object_set_data_full (G_OBJECT (swidget), "source", src, g_object_unref);
     
     g_signal_connect (G_OBJECT (seahorse_widget_get_widget (swidget, "algorithm-choice")), "changed", 
                     G_CALLBACK (on_change), swidget);

Modified: trunk/ssh/seahorse-ssh-key-properties.c
==============================================================================
--- trunk/ssh/seahorse-ssh-key-properties.c	(original)
+++ trunk/ssh/seahorse-ssh-key-properties.c	Sat Nov 29 17:37:20 2008
@@ -20,30 +20,33 @@
  */
 #include "config.h"
 
-#include <glib/gi18n.h>
-
-#include "seahorse-key-widget.h"
-
 #include "seahorse-gtkstock.h"
-#include "seahorse-key.h"
+#include "seahorse-object.h"
+#include "seahorse-object-widget.h"
 #include "seahorse-util.h"
+#include "seahorse-validity.h"
+
+#include "common/seahorse-bind.h"
 
 #include "ssh/seahorse-ssh-key.h"
 #include "ssh/seahorse-ssh-operation.h"
 
+#include <glib/gi18n.h>
+
 #define NOTEBOOK "notebook"
 
 static void
 do_main (SeahorseWidget *swidget)
 {
-    SeahorseKey *key;
+    SeahorseObject *object;
     SeahorseSSHKey *skey;
     GtkWidget *widget;
     gchar *text;
+    const gchar *label;
     const gchar *template;
 
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    skey = SEAHORSE_SSH_KEY (key);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    skey = SEAHORSE_SSH_KEY (object);
 
     /* Image */
     widget = seahorse_widget_get_widget (swidget, "key-image");
@@ -51,20 +54,18 @@
         gtk_image_set_from_stock (GTK_IMAGE (widget), SEAHORSE_STOCK_KEY_SSH, GTK_ICON_SIZE_DIALOG);
 
     /* Name and title */
-    text = seahorse_key_get_display_name (key);
+    label = seahorse_object_get_label (object);
     widget = seahorse_widget_get_widget (swidget, "comment-entry");
     if (widget)
-        gtk_entry_set_text (GTK_ENTRY (widget), text);
+        gtk_entry_set_text (GTK_ENTRY (widget), label);
     widget = seahorse_widget_get_toplevel (swidget);
-    gtk_window_set_title (GTK_WINDOW (widget), text);
-    g_free (text);
+    gtk_window_set_title (GTK_WINDOW (widget), label);
 
     /* Key id */
     widget = glade_xml_get_widget (swidget->xml, "id-label");
     if (widget) {
-        text = seahorse_key_get_display_id (key);
-        gtk_label_set_text (GTK_LABEL (widget), text);
-        g_free (text);
+        label = seahorse_object_get_identifier (object);
+        gtk_label_set_text (GTK_LABEL (widget), label);
     }
     
     /* Put in message */
@@ -79,13 +80,13 @@
     widget = seahorse_widget_get_widget (swidget, "trust-check");
     g_return_if_fail (widget != NULL);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), 
-                                  seahorse_key_get_trust (key) >= SEAHORSE_VALIDITY_FULL);
+                                  seahorse_ssh_key_get_trust (skey) >= SEAHORSE_VALIDITY_FULL);
 }
 
 static void
 comment_activate (GtkWidget *entry, SeahorseWidget *swidget)
 {
-    SeahorseKey *key;
+    SeahorseObject *object;
     SeahorseSSHKey *skey;
     SeahorseSource *sksrc;
     SeahorseOperation *op;
@@ -93,9 +94,9 @@
     gchar *comment;
     GError *err = NULL;
     
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    skey = SEAHORSE_SSH_KEY (key);
-    sksrc = seahorse_key_get_source (key);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    skey = SEAHORSE_SSH_KEY (object);
+    sksrc = seahorse_object_get_source (object);
     g_return_if_fail (SEAHORSE_IS_SSH_SOURCE (sksrc));
     
     text = gtk_entry_get_text (GTK_ENTRY (entry));
@@ -135,14 +136,14 @@
 {
     SeahorseSource *sksrc;
     SeahorseOperation *op;
-    SeahorseKey *key;
+    SeahorseObject *object;
     SeahorseSSHKey *skey;
     gboolean authorize;
     GError *err = NULL;
 
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    skey = SEAHORSE_SSH_KEY (key);
-    sksrc = seahorse_key_get_source (key);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    skey = SEAHORSE_SSH_KEY (object);
+    sksrc = seahorse_object_get_source (object);
     g_return_if_fail (SEAHORSE_IS_SSH_SOURCE (sksrc));
     
     authorize = gtk_toggle_button_get_active (button);
@@ -184,17 +185,17 @@
 passphrase_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
     SeahorseOperation *op;
-    SeahorseKey *skey;
+    SeahorseObject *object;
     GtkWidget *w;
     
-    skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    g_assert (SEAHORSE_IS_SSH_KEY (skey));
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    g_assert (SEAHORSE_IS_SSH_KEY (object));
 
     w = glade_xml_get_widget (swidget->xml, "passphrase-button");
     g_return_if_fail (w != NULL);
     gtk_widget_set_sensitive (w, FALSE);
     
-    op = seahorse_ssh_operation_change_passphrase (SEAHORSE_SSH_KEY (skey));
+    op = seahorse_ssh_operation_change_passphrase (SEAHORSE_SSH_KEY (object));
     seahorse_operation_watch (op, (SeahorseDoneFunc)passphrase_done, swidget, NULL, NULL);
 
     /* Running operations ref themselves */
@@ -222,7 +223,7 @@
 export_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
 {
 	SeahorseSource *sksrc;
-	SeahorseKey *skey;
+	SeahorseObject *object;
 	GFile *file;
 	GtkDialog *dialog;
 	guchar *results;
@@ -230,22 +231,22 @@
 	gchar* uri = NULL;
 	GError *err = NULL;
 
-	skey = SEAHORSE_KEY_WIDGET (swidget)->skey;
-	g_return_if_fail (SEAHORSE_IS_SSH_KEY (skey));
-	sksrc = seahorse_object_get_source (SEAHORSE_OBJECT (skey));
+	object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+	g_return_if_fail (SEAHORSE_IS_SSH_KEY (object));
+	sksrc = seahorse_object_get_source (object);
 	g_return_if_fail (SEAHORSE_IS_SSH_SOURCE (sksrc));
 	
 	dialog = seahorse_util_chooser_save_new (_("Export Complete Key"), 
 	                                         GTK_WINDOW (seahorse_widget_get_toplevel (swidget)));
 	seahorse_util_chooser_show_key_files (dialog);
-	seahorse_util_chooser_set_filename (dialog, skey);
+	seahorse_util_chooser_set_filename (dialog, object);
 
 	uri = seahorse_util_chooser_save_prompt (dialog);
 	if (!uri) 
 		return;
 	
 	results = seahorse_ssh_source_export_private (SEAHORSE_SSH_SOURCE (sksrc), 
-	                                              SEAHORSE_SSH_KEY (skey),
+	                                              SEAHORSE_SSH_KEY (object),
 	                                              &n_results, &err);
 	
 	if (results) {
@@ -267,18 +268,18 @@
 static void 
 do_details (SeahorseWidget *swidget)
 {
-    SeahorseKey *key;
+    SeahorseObject *object;
     SeahorseSSHKey *skey;
     GtkWidget *widget;
     const gchar *label;
     gchar *text;
 
-    key = SEAHORSE_KEY_WIDGET (swidget)->skey;
-    skey = SEAHORSE_SSH_KEY (key);
+    object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+    skey = SEAHORSE_SSH_KEY (object);
 
     widget = glade_xml_get_widget (swidget->xml, "fingerprint-label");
     if (widget) {
-        text = seahorse_key_get_fingerprint (key); 
+        text = seahorse_ssh_key_get_fingerprint (skey);
         gtk_label_set_text (GTK_LABEL (widget), text);
         g_free (text);
     }
@@ -301,32 +302,16 @@
         gtk_label_set_text (GTK_LABEL (widget), text);
         g_free (text);
     }
-
 }
 
 static void
-key_changed (SeahorseKey *skey, SeahorseKeyChange change, SeahorseWidget *swidget)
+key_notify (SeahorseObject *object, SeahorseWidget *swidget)
 {
     do_main (swidget);
     do_details (swidget);
 }
 
 static void
-key_destroyed (GtkObject *object, SeahorseWidget *swidget)
-{
-    seahorse_widget_destroy (swidget);
-}
-
-static void
-properties_destroyed (GtkObject *object, SeahorseWidget *swidget)
-{
-    g_signal_handlers_disconnect_by_func (SEAHORSE_KEY_WIDGET (swidget)->skey,
-                                          key_changed, swidget);
-    g_signal_handlers_disconnect_by_func (SEAHORSE_KEY_WIDGET (swidget)->skey,
-                                          key_destroyed, swidget);
-}
-
-static void
 properties_response (GtkDialog *dialog, int response, SeahorseWidget *swidget)
 {
     if (response == GTK_RESPONSE_HELP) {
@@ -340,24 +325,16 @@
 void
 seahorse_ssh_key_properties_show (SeahorseSSHKey *skey, GtkWindow *parent)
 {
-    SeahorseKey *key = SEAHORSE_KEY (skey);
+    SeahorseObject *object = SEAHORSE_OBJECT (skey);
     SeahorseWidget *swidget = NULL;
     GtkWidget *widget;
 
-    swidget = seahorse_key_widget_new ("ssh-key-properties",
-                                       parent,
-                                       key);    
+    swidget = seahorse_object_widget_new ("ssh-key-properties", parent, object);
     
     /* This happens if the window is already open */
     if (swidget == NULL)
         return;
 
-    widget = glade_xml_get_widget (swidget->xml, swidget->name);
-    g_signal_connect (widget, "response", G_CALLBACK (properties_response), swidget);
-    g_signal_connect (widget, "destroy", G_CALLBACK (properties_destroyed), swidget);
-    g_signal_connect_after (skey, "changed", G_CALLBACK (key_changed), swidget);
-    g_signal_connect_after (skey, "destroy", G_CALLBACK (key_destroyed), swidget);
-
     /* 
      * The signals don't need to keep getting connected. Everytime a key changes the
      * do_* functions get called. Therefore, seperate functions connect the signals
@@ -375,7 +352,7 @@
     g_signal_connect (widget, "activate", G_CALLBACK (comment_activate), swidget);
     g_signal_connect (widget, "focus-out-event", G_CALLBACK (comment_focus_out), swidget);
 
-    if (seahorse_key_get_usage (key) == SEAHORSE_USAGE_PRIVATE_KEY) {
+    if (seahorse_object_get_usage (object) == SEAHORSE_USAGE_PRIVATE_KEY) {
         glade_xml_signal_connect_data (swidget->xml, "export_button_clicked",
                                        G_CALLBACK (export_button_clicked), swidget);
         glade_xml_signal_connect_data (swidget->xml, "passphrase_button_clicked",
@@ -387,6 +364,9 @@
         seahorse_widget_set_visible (swidget, "export-button", FALSE);
     }
 
-    if (swidget)
-        seahorse_widget_show (swidget);
+    widget = glade_xml_get_widget (swidget->xml, swidget->name);
+    g_signal_connect (widget, "response", G_CALLBACK (properties_response), swidget);
+    seahorse_bind_objects (NULL, skey, (SeahorseTransfer)key_notify, swidget);
+
+    seahorse_widget_show (swidget);
 }

Modified: trunk/ssh/seahorse-ssh-key.c
==============================================================================
--- trunk/ssh/seahorse-ssh-key.c	(original)
+++ trunk/ssh/seahorse-ssh-key.c	Sat Nov 29 17:37:20 2008
@@ -32,27 +32,19 @@
 #include "seahorse-ssh-key.h"
 #include "seahorse-ssh-operation.h"
 #include "seahorse-gtkstock.h"
+#include "seahorse-validity.h"
 
 enum {
     PROP_0,
     PROP_KEY_DATA,
-    PROP_DISPLAY_NAME,
-    PROP_DISPLAY_ID,
-    PROP_SIMPLE_NAME,
     PROP_FINGERPRINT,
     PROP_VALIDITY,
     PROP_TRUST,
     PROP_EXPIRES,
-    PROP_LENGTH,
-    PROP_STOCK_ID
+    PROP_LENGTH
 };
 
-struct _SeahorseSSHKeyPrivate {
-    gchar *displayname;
-    gchar *simplename;
-};
-
-G_DEFINE_TYPE (SeahorseSSHKey, seahorse_ssh_key, SEAHORSE_TYPE_KEY);
+G_DEFINE_TYPE (SeahorseSSHKey, seahorse_ssh_key, SEAHORSE_TYPE_OBJECT);
 
 /* -----------------------------------------------------------------------------
  * INTERNAL 
@@ -70,129 +62,90 @@
 }
 
 static void
-changed_key (SeahorseSSHKey *skey)
+changed_key (SeahorseSSHKey *self)
 {
-    SeahorseKey *key = SEAHORSE_KEY (skey);
-    SeahorseObject *obj = SEAHORSE_OBJECT (skey);
-
-    g_free (skey->priv->displayname);
-    skey->priv->displayname = NULL;
-    
-    g_free (skey->priv->simplename);
-    skey->priv->simplename = NULL;
-    
-    if (skey->keydata) {
-
-        /* Try to make display and simple names */
-        if (skey->keydata->comment) {
-            skey->priv->displayname = g_strdup (skey->keydata->comment);
-            skey->priv->simplename = parse_first_word (skey->keydata->comment);
+	SeahorseObject *obj = SEAHORSE_OBJECT (self);
+	SeahorseUsage usage;
+	const gchar *description = NULL;
+	const gchar *display = NULL;
+	gchar *simple = NULL;
+    
+	if (self->keydata) {
+
+  		 /* Try to make display and simple names */
+		if (self->keydata->comment) {
+			display = self->keydata->comment;
+			simple = parse_first_word (self->keydata->comment);
             
-        /* No names when not even the fingerpint loaded */
-        } else if (!skey->keydata->fingerprint) {
-            skey->priv->displayname = g_strdup (_("(Unreadable Secure Shell Key)"));
-    
-        /* No comment, but loaded */        
-        } else {
-            skey->priv->displayname = g_strdup (_("Secure Shell Key"));
-        }
+		/* No names when not even the fingerpint loaded */
+		} else if (!self->keydata->fingerprint) {
+			display = _("(Unreadable Secure Shell Key)");
+
+		/* No comment, but loaded */        
+		} else {
+			display = _("Secure Shell Key");
+		}
+    
+		if (simple == NULL)
+			simple = g_strdup (_("Secure Shell Key"));
+	}
     
-        if (skey->priv->simplename == NULL)
-            skey->priv->simplename = g_strdup (_("Secure Shell Key"));
+	if (!self->keydata || !self->keydata->fingerprint) {
         
-    }
-    
-    /* Now start setting the main SeahorseKey fields */
-    obj->_tag = SEAHORSE_SSH;
-    obj->_id = 0;
-    
-    if (!skey->keydata || !skey->keydata->fingerprint) {
-        
-        obj->_location = SEAHORSE_LOCATION_INVALID;
-        obj->_usage = SEAHORSE_USAGE_NONE;
-        key->loaded = SKEY_INFO_NONE;
-        obj->_flags = SKEY_FLAG_DISABLED;
-        key->keydesc = _("Invalid");
-        key->rawid = NULL;
-        
-    } else {
-    
-        /* The key id */
-        obj->_id = seahorse_ssh_key_get_cannonical_id (skey->keydata->fingerprint);
-        key->rawid = skey->keydata->fingerprint;
-        obj->_location = SEAHORSE_LOCATION_LOCAL;
-        key->loaded = SKEY_INFO_COMPLETE;
-        obj->_flags = skey->keydata->authorized ? SKEY_FLAG_TRUSTED : 0;
-        obj->_flags |= SKEY_FLAG_EXPORTABLE;
-        
-        if (skey->keydata->privfile) {
-            obj->_usage = SEAHORSE_USAGE_PRIVATE_KEY;
-            key->keydesc = _("Private Secure Shell Key");
-        } else {
-            obj->_usage = SEAHORSE_USAGE_PUBLIC_KEY;
-            key->keydesc = _("Public Secure Shell Key");
-        }
-    }
-    
-    if (!obj->_id)
-        obj->_id = g_quark_from_string (SEAHORSE_SSH_STR ":UNKNOWN ");
-    
-    seahorse_object_fire_changed (obj, SKEY_CHANGE_ALL);
+		g_object_set (self,
+		              "id", 0,
+		              "label", "",
+		              "icon", NULL,
+		              "usage", SEAHORSE_USAGE_NONE,
+		              "description", _("Invalid"),		              
+		              "nickname", "",
+		              "location", SEAHORSE_LOCATION_INVALID,
+		              "flags", SEAHORSE_FLAG_DISABLED,
+		              NULL);
+		return;
+		
+	} 
+
+	if (self->keydata->privfile) {
+		usage = SEAHORSE_USAGE_PRIVATE_KEY;
+		description = _("Private Secure Shell Key");
+	} else {
+		usage = SEAHORSE_USAGE_PUBLIC_KEY;
+		description = _("Public Secure Shell Key");
+	}
+
+	g_object_set (obj,
+	              "id", seahorse_ssh_key_get_cannonical_id (self->keydata->fingerprint),
+	              "label", display,
+	              "icon", SEAHORSE_STOCK_KEY_SSH,
+	              "usage", usage,
+	              "nickname", simple,
+	              "description", description,
+	              "location", SEAHORSE_LOCATION_LOCAL,
+	              "flags", (self->keydata->authorized ? SEAHORSE_FLAG_TRUSTED : 0) | SEAHORSE_FLAG_EXPORTABLE,
+	              NULL);
 }
 
 static guint 
 calc_validity (SeahorseSSHKey *skey)
 {
-    if (skey->keydata->privfile)
-        return SEAHORSE_VALIDITY_ULTIMATE;
-    return 0;
+	if (skey->keydata->privfile)
+		return SEAHORSE_VALIDITY_ULTIMATE;
+	return 0;
 }
 
 static guint
 calc_trust (SeahorseSSHKey *skey)
 {
-    if (skey->keydata->authorized)
-        return SEAHORSE_VALIDITY_FULL;
-    return 0;
+	if (skey->keydata->authorized)
+		return SEAHORSE_VALIDITY_FULL;
+	return 0;
 }
 
 /* -----------------------------------------------------------------------------
  * OBJECT 
  */
 
-static guint 
-seahorse_ssh_key_get_num_names (SeahorseKey *key)
-{
-    return 1;
-}
-
-static gchar* 
-seahorse_ssh_key_get_name (SeahorseKey *key, guint index)
-{
-    SeahorseSSHKey *skey;
-    
-    g_assert (SEAHORSE_IS_SSH_KEY (key));
-    skey = SEAHORSE_SSH_KEY (key);
-    
-    g_assert (index == 0);
-
-    return g_strdup (skey->priv->displayname);
-}
-
-static gchar* 
-seahorse_ssh_key_get_name_cn (SeahorseKey *skey, guint index)
-{
-    g_assert (index != 0);
-    return NULL;
-}
-
-static SeahorseValidity  
-seahorse_ssh_key_get_name_validity  (SeahorseKey *skey, guint index)
-{
-    g_return_val_if_fail (index == 0, SEAHORSE_VALIDITY_UNKNOWN);
-    return calc_validity (SEAHORSE_SSH_KEY (skey));
-}
-
 static void
 seahorse_ssh_key_get_property (GObject *object, guint prop_id,
                                GValue *value, GParamSpec *pspec)
@@ -203,15 +156,6 @@
     case PROP_KEY_DATA:
         g_value_set_pointer (value, skey->keydata);
         break;
-    case PROP_DISPLAY_NAME:
-        g_value_set_string (value, skey->priv->displayname);
-        break;
-    case PROP_DISPLAY_ID:
-        g_value_set_string (value, seahorse_key_get_short_keyid (SEAHORSE_KEY (skey))); 
-        break;
-    case PROP_SIMPLE_NAME:        
-        g_value_set_string (value, skey->priv->simplename);
-        break;
     case PROP_FINGERPRINT:
         g_value_set_string (value, skey->keydata ? skey->keydata->fingerprint : NULL);
         break;
@@ -227,9 +171,6 @@
     case PROP_LENGTH:
         g_value_set_uint (value, skey->keydata ? skey->keydata->length : 0);
         break;
-    case PROP_STOCK_ID:
-        g_value_set_string (value, SEAHORSE_STOCK_KEY_SSH);
-        break;
     }
 }
 
@@ -258,56 +199,32 @@
 {
     SeahorseSSHKey *skey = SEAHORSE_SSH_KEY (gobject);
     
-    g_free (skey->priv->displayname);
-    g_free (skey->priv->simplename);
-    g_free (skey->priv);
-    skey->priv = NULL;
-    
     seahorse_ssh_key_data_free (skey->keydata);
     
     G_OBJECT_CLASS (seahorse_ssh_key_parent_class)->finalize (gobject);
 }
 
 static void
-seahorse_ssh_key_init (SeahorseSSHKey *skey)
+seahorse_ssh_key_init (SeahorseSSHKey *self)
 {
-    /* init private vars */
-    skey->priv = g_new0 (SeahorseSSHKeyPrivate, 1);
+	
 }
 
 static void
 seahorse_ssh_key_class_init (SeahorseSSHKeyClass *klass)
 {
     GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-    SeahorseKeyClass *key_class = SEAHORSE_KEY_CLASS (klass);
     
     seahorse_ssh_key_parent_class = g_type_class_peek_parent (klass);
     
     gobject_class->finalize = seahorse_ssh_key_finalize;
     gobject_class->set_property = seahorse_ssh_key_set_property;
     gobject_class->get_property = seahorse_ssh_key_get_property;
-
-    key_class->get_num_names = seahorse_ssh_key_get_num_names;
-    key_class->get_name = seahorse_ssh_key_get_name;
-    key_class->get_name_cn = seahorse_ssh_key_get_name_cn;
-    key_class->get_name_validity = seahorse_ssh_key_get_name_validity;
     
     g_object_class_install_property (gobject_class, PROP_KEY_DATA,
         g_param_spec_pointer ("key-data", "SSH Key Data", "SSH key data pointer",
                               G_PARAM_READWRITE));
 
-    g_object_class_install_property (gobject_class, PROP_DISPLAY_NAME,
-        g_param_spec_string ("display-name", "Display Name", "User Displayable name for this key",
-                             "", G_PARAM_READABLE));
-
-    g_object_class_install_property (gobject_class, PROP_DISPLAY_ID,
-        g_param_spec_string ("display-id", "Display ID", "User Displayable id for this key",
-                             "", G_PARAM_READABLE));
-                      
-    g_object_class_install_property (gobject_class, PROP_SIMPLE_NAME,
-        g_param_spec_string ("simple-name", "Simple Name", "Simple name for this key",
-                             "", G_PARAM_READABLE));
-                      
     g_object_class_install_property (gobject_class, PROP_FINGERPRINT,
         g_param_spec_string ("fingerprint", "Fingerprint", "Unique fingerprint for this key",
                              "", G_PARAM_READABLE));
@@ -327,10 +244,6 @@
     g_object_class_install_property (gobject_class, PROP_LENGTH,
         g_param_spec_uint ("length", "Length of", "The length of this key",
                            0, G_MAXUINT, 0, G_PARAM_READABLE));
-                           
-    g_object_class_install_property (gobject_class, PROP_STOCK_ID,
-        g_param_spec_string ("stock-id", "The stock icon", "The stock icon id",
-                             NULL, G_PARAM_READABLE));
 }
 
 /* -----------------------------------------------------------------------------
@@ -341,7 +254,7 @@
 seahorse_ssh_key_new (SeahorseSource *sksrc, SeahorseSSHKeyData *data)
 {
     SeahorseSSHKey *skey;
-    skey = g_object_new (SEAHORSE_TYPE_SSH_KEY, "key-source", sksrc, 
+    skey = g_object_new (SEAHORSE_TYPE_SSH_KEY, "source", sksrc, 
                          "key-data", data, NULL);
     return skey;
 }
@@ -414,3 +327,18 @@
     return ret;
 }
 
+gchar*
+seahorse_ssh_key_get_fingerprint (SeahorseSSHKey *self)
+{
+	gchar *fpr;
+	g_object_get (self, "fingerprint", &fpr, NULL);
+	return fpr;	
+}
+
+SeahorseValidity
+seahorse_ssh_key_get_trust (SeahorseSSHKey *self)
+{
+    guint validity;
+    g_object_get (self, "trust", &validity, NULL);
+    return validity;
+}

Modified: trunk/ssh/seahorse-ssh-key.h
==============================================================================
--- trunk/ssh/seahorse-ssh-key.h	(original)
+++ trunk/ssh/seahorse-ssh-key.h	Sat Nov 29 17:37:20 2008
@@ -19,31 +19,15 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/**
- * SeahorseSSHKey: Represents a SSH key 
- * 
- * - Derived from SeahorseKey
- * 
- * Properties:
- *   display-name: (gchar*) The display name for the key.
- *   display-id: (gchar*) The display id for the key.
- *   simple-name: (gchar*) Shortened display name for the key (for use in files etc...).
- *   fingerprint: (gchar*) Displayable fingerprint for the key.
- *   validity: (SeahorseValidity) The key validity.
- *   trust: (SeahorseValidity) Trust for the key.
- *   expires: (gulong) Date this key expires or 0.
- *   length: (guint) The length of the key in bits.
- *   stock-id: (string) The stock icon id.
- */
- 
 #ifndef __SEAHORSE_SSH_KEY_H__
 #define __SEAHORSE_SSH_KEY_H__
 
 #include <gtk/gtk.h>
 
-#include "seahorse-key.h"
-#include "seahorse-source.h"
+#include "seahorse-object.h"
 #include "seahorse-operation.h"
+#include "seahorse-source.h"
+#include "seahorse-validity.h"
 
 #include "seahorse-ssh-module.h"
 #include "seahorse-ssh-key-data.h"
@@ -63,7 +47,7 @@
 typedef struct _SeahorseSSHKeyPrivate SeahorseSSHKeyPrivate;
 
 struct _SeahorseSSHKey {
-    SeahorseKey	parent;
+    SeahorseObject	parent;
 
     /*< public >*/
     struct _SeahorseSSHKeyData *keydata;
@@ -74,7 +58,7 @@
 
 
 struct _SeahorseSSHKeyClass {
-    SeahorseKeyClass            parent_class;
+    SeahorseObjectClass            parent_class;
 };
 
 SeahorseSSHKey*         seahorse_ssh_key_new                  (SeahorseSource *sksrc, 
@@ -94,5 +78,8 @@
 
 GQuark                  seahorse_ssh_key_get_cannonical_id    (const gchar *id);
 
+SeahorseValidity        seahorse_ssh_key_get_trust            (SeahorseSSHKey *self);
+
+gchar*                  seahorse_ssh_key_get_fingerprint      (SeahorseSSHKey *self);
 
 #endif /* __SEAHORSE_KEY_H__ */

Modified: trunk/ssh/seahorse-ssh-operation.c
==============================================================================
--- trunk/ssh/seahorse-ssh-operation.c	(original)
+++ trunk/ssh/seahorse-ssh-operation.c	Sat Nov 29 17:37:20 2008
@@ -86,7 +86,7 @@
     PasswordCallback password_cb;
     
     /* Prompt information */
-    SeahorseKey *prompt_skey;
+    SeahorseObject *prompt_skey;
     GtkDialog *prompt_dialog;
     guint prompt_requests;
     
@@ -112,7 +112,7 @@
 IMPLEMENT_OPERATION_PROPS(SSH, ssh)
 
     g_object_class_install_property (gobject_class, PROP_KEY_SOURCE,
-        g_param_spec_object ("key-source", "SSH Key Source", "Key source this operation works on.", 
+        g_param_spec_object ("source", "SSH Key Source", "Key source this operation works on.", 
                              SEAHORSE_TYPE_SSH_SOURCE, G_PARAM_READABLE));
 
     g_type_class_add_private (gobject_class, sizeof (SeahorseSSHOperationPrivate));
@@ -432,18 +432,17 @@
                    const gchar* check, gboolean confirm)
 {
     SeahorseSSHOperationPrivate *pv = SEAHORSE_SSH_OPERATION_GET_PRIVATE (sop);
-    gchar *display;
+    const gchar *display;
     gchar *msg;
     
     if (pv->prompt_dialog)
         gtk_widget_destroy (GTK_WIDGET (pv->prompt_dialog));
     
     if (pv->prompt_skey)
-        display = seahorse_key_get_display_name (pv->prompt_skey);
+        display = seahorse_object_get_label (pv->prompt_skey);
     else 
-        display = g_strdup (_("Secure Shell key"));
+        display = _("Secure Shell key");
     msg = g_strdup_printf (message, display);
-    g_free (display);
 
     pv->prompt_dialog = seahorse_passphrase_prompt_show (title, msg, _("Passphrase:"), 
                                                          check, confirm);
@@ -465,18 +464,17 @@
                  const gchar* check, gboolean confirm)
 {
     SeahorseSSHOperationPrivate *pv = SEAHORSE_SSH_OPERATION_GET_PRIVATE (sop);
-    gchar *display;
+    const gchar *display;
     gchar *msg;
     
     if (pv->prompt_dialog)
         gtk_widget_destroy (GTK_WIDGET (pv->prompt_dialog));
     
     if (pv->prompt_skey)
-        display = seahorse_key_get_display_name (pv->prompt_skey);
+        display = seahorse_object_get_label (pv->prompt_skey);
     else 
         display = g_strdup (_("Secure Shell key"));
     msg = g_strdup_printf (message, display);
-    g_free (display);
 
     pv->prompt_dialog = seahorse_passphrase_prompt_show (title, msg, _("Password:"), 
                                                          check, confirm);
@@ -632,7 +630,7 @@
     pv = SEAHORSE_SSH_OPERATION_GET_PRIVATE (sop);
 
     sop->sksrc = ssrc;
-    pv->prompt_skey = SEAHORSE_KEY (skey);
+    pv->prompt_skey = SEAHORSE_OBJECT (skey);
     
     DEBUG_OPERATION (("SSHOP: Executing SSH command: %s\n", command));
     
@@ -771,7 +769,7 @@
     SeahorseOperation *op;
     GMemoryOutputStream *output;
     gchar *data;
-    size_t length, size, strl;
+    size_t length;
     gchar *cmd;
     
     g_return_val_if_fail (keys != NULL, NULL);
@@ -874,7 +872,7 @@
     SeahorseSSHOperationPrivate *pv = SEAHORSE_SSH_OPERATION_GET_PRIVATE (sop);
     if (pv->prompt_skey)
         seahorse_source_load_async (SEAHORSE_SOURCE (sop->sksrc), 
-                                        seahorse_key_get_keyid (pv->prompt_skey));
+                                        seahorse_object_get_id (pv->prompt_skey));
 }
 
 SeahorseOperation*
@@ -888,7 +886,7 @@
     g_return_val_if_fail (SEAHORSE_IS_SSH_KEY (skey), NULL);
     g_return_val_if_fail (skey->keydata && skey->keydata->privfile, NULL);
     
-    ssrc = seahorse_key_get_source (SEAHORSE_KEY (skey));
+    ssrc = seahorse_object_get_source (SEAHORSE_OBJECT (skey));
     g_return_val_if_fail (SEAHORSE_IS_SSH_SOURCE (ssrc), NULL);
     
     cmd = g_strdup_printf (SSH_KEYGEN_PATH " -p -f '%s'", skey->keydata->privfile);
@@ -976,114 +974,6 @@
 }
 
 /* -----------------------------------------------------------------------------
- * LOAD KEY INTO AGENT
- */ 
-
-#if 0
-#define KEYRING_ATTR_TYPE "seahorse-key-type"
-#define KEYRING_ATTR_KEYID "openssh-keyid"
-#define KEYRING_VAL_SSH "openssh"
-
-static gchar*
-get_keyring_passphrase (SeahorseKey *skey)
-{
-    GnomeKeyringAttributeList *attributes = NULL;
-    GnomeKeyringResult res;
-    GList *found_items;
-    GnomeKeyringFound *found;
-    gchar *ret = NULL;
-    const gchar *id;
-    
-    g_assert (skey != NULL);
-    id = seahorse_key_get_rawid (seahorse_key_get_keyid (skey));
-    
-    attributes = gnome_keyring_attribute_list_new ();
-    gnome_keyring_attribute_list_append_string (attributes, KEYRING_ATTR_KEYID, id);
-    res = gnome_keyring_find_items_sync (GNOME_KEYRING_ITEM_GENERIC_SECRET, attributes, 
-                                         &found_items);
-    gnome_keyring_attribute_list_free (attributes);
-        
-    if (res != GNOME_KEYRING_RESULT_OK) {
-        if (res != GNOME_KEYRING_RESULT_DENIED)
-            g_warning ("couldn't search keyring: (code %d)", res);
-            
-    } else {
-        
-        if (found_items && found_items->data) {
-            found = (GnomeKeyringFound*)found_items->data;
-            if (found->secret)
-                ret = g_strdup (found->secret);
-        }
-            
-        gnome_keyring_found_list_free (found_items);
-    }
-    
-    return ret;
-}
-
-static void 
-set_keyring_passphrase (SeahorseKey *skey, const gchar *pass)
-{
-    const gchar *keyring = NULL;
-    GnomeKeyringResult res;
-    GnomeKeyringAttributeList *attributes = NULL;
-    guint item_id;
-    const gchar *id;
-    gchar *display;
-    
-    g_assert ((skey != NULL) && (pass != NULL));
-    
-    id = seahorse_key_get_rawid (seahorse_key_get_keyid (skey));
-    g_assert (id != NULL);
-    display = seahorse_key_get_display_name (skey);
-    
-    attributes = gnome_keyring_attribute_list_new ();
-    gnome_keyring_attribute_list_append_string (attributes, KEYRING_ATTR_TYPE, 
-                                                KEYRING_VAL_SSH);
-    gnome_keyring_attribute_list_append_string (attributes, KEYRING_ATTR_KEYID, id);
-    res = gnome_keyring_item_create_sync (keyring, GNOME_KEYRING_ITEM_GENERIC_SECRET, 
-                                          display, attributes, pass, TRUE, &item_id);
-    gnome_keyring_attribute_list_free (attributes);
-        
-    if (res != GNOME_KEYRING_RESULT_OK)
-        g_warning ("Couldn't store password in keyring: (code %d)", res);
-}
-
-static const gchar*
-load_password_cb (SeahorseSSHOperation *sop, const gchar* msg)
-{
-    SeahorseSSHOperationPrivate *pv = SEAHORSE_SSH_OPERATION_GET_PRIVATE (sop);
-    gchar* pass;
-
-    DEBUG_OPERATION (("in load_password_cb\n"));
-    
-    if (pv->prompt_requests <= 0) {
-        pass = get_keyring_passphrase (pv->prompt_skey);
-        if (pass != NULL) {
-            g_object_set_data_full (G_OBJECT (sop), "load-keyring-passphrase", pass, g_free);
-            return pass;
-        }
-        pv->prompt_requests++;
-    }
-    
-    return prompt_passphrase (sop, _("Secure Shell Key Passphrase"), _("Enter the passphrase for: %s"), 
-                              _("Save this passphrase in my keyring"), FALSE);
-}
-
-static void
-load_result_cb (SeahorseSSHOperation *sop)
-{
-    SeahorseSSHOperationPrivate *pv = SEAHORSE_SSH_OPERATION_GET_PRIVATE (sop);
-    const gchar* pass;
-    
-    if (pv->prompt_dialog && seahorse_passphrase_prompt_checked (pv->prompt_dialog)) {
-        pass = seahorse_passphrase_prompt_get (pv->prompt_dialog);
-        set_keyring_passphrase (pv->prompt_skey, pass);
-    }
-}
-#endif
-
-/* -----------------------------------------------------------------------------
  * IMPORT A PUBLIC KEY 
  */
 
@@ -1250,7 +1140,7 @@
     /* Just reload that one key */
     if (!err)
         seahorse_source_load (SEAHORSE_SOURCE (ssrc), 
-                                  seahorse_key_get_keyid (SEAHORSE_KEY (skey)));
+                                  seahorse_object_get_id (SEAHORSE_OBJECT (skey)));
     
     return seahorse_operation_new_complete (err);
 }

Modified: trunk/ssh/seahorse-ssh-source.c
==============================================================================
--- trunk/ssh/seahorse-ssh-source.c	(original)
+++ trunk/ssh/seahorse-ssh-source.c	Sat Nov 29 17:37:20 2008
@@ -142,24 +142,6 @@
 }
 
 static void
-key_changed (SeahorseKey *skey, SeahorseKeyChange change, SeahorseSource *sksrc)
-{
-    /* TODO: We need to fix these key change flags. Currently the only thing
-     * that sets 'ALL' is when we replace a key in an skey. We don't 
-     * need to reload in that case */
-    
-    if (change != SKEY_CHANGE_ALL)
-        seahorse_source_load_async (sksrc, seahorse_key_get_keyid (skey));
-}
-
-static void
-key_destroyed (SeahorseKey *skey, SeahorseSource *sksrc)
-{
-    g_signal_handlers_disconnect_by_func (skey, key_changed, sksrc);
-    g_signal_handlers_disconnect_by_func (skey, key_destroyed, sksrc);
-}
-
-static void
 cancel_scheduled_refresh (SeahorseSSHSource *ssrc)
 {
     if (ssrc->priv->scheduled_refresh != 0) {
@@ -170,7 +152,7 @@
 }
 
 static void
-remove_key_from_context (gpointer hkey, SeahorseKey *dummy, SeahorseSSHSource *ssrc)
+remove_key_from_context (gpointer hkey, SeahorseObject *dummy, SeahorseSSHSource *ssrc)
 {
     GQuark keyid = GPOINTER_TO_UINT (hkey);
     SeahorseObject *sobj;
@@ -321,11 +303,7 @@
     /* Create a new key */        
     g_assert (keydata);
     skey = seahorse_ssh_key_new (sksrc, keydata);
-            
-    /* We listen in to get notified of changes on this key */
-    g_signal_connect (skey, "changed", G_CALLBACK (key_changed), sksrc);
-    g_signal_connect (skey, "destroy", G_CALLBACK (key_destroyed), sksrc);
-        
+
     seahorse_context_take_object (SCTX_APP (), SEAHORSE_OBJECT (skey));
     return skey;
 }
@@ -593,7 +571,7 @@
     gchar *results = NULL;
     gchar *raw = NULL;
     GError *error = NULL;
-    SeahorseKey *skey;
+    SeahorseObject *object;
     GList *l;
     gsize written;
     
@@ -601,15 +579,15 @@
     g_return_val_if_fail (G_IS_OUTPUT_STREAM (output), NULL);
     
     for (l = keys; l; l = g_list_next (l)) {
-        skey = SEAHORSE_KEY (l->data);
+        object = SEAHORSE_OBJECT (l->data);
         
-        g_assert (SEAHORSE_IS_SSH_KEY (skey));
+        g_assert (SEAHORSE_IS_SSH_KEY (object));
         
         results = NULL;
         raw = NULL;
         
         keydata = NULL;
-        g_object_get (skey, "key-data", &keydata, NULL);
+        g_object_get (object, "key-data", &keydata, NULL);
         g_return_val_if_fail (keydata, NULL);
         
         /* We should already have the data loaded */
@@ -823,7 +801,7 @@
  
     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));
+                           0, G_MAXUINT, SEAHORSE_TAG_INVALID, 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.",
@@ -837,7 +815,7 @@
         g_param_spec_string ("base-directory", "Key directory", "Directory where the keys are stored",
                              NULL, G_PARAM_READABLE));
     
-	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_SSH_SOURCE, "key-source", "local", SEAHORSE_SSH_STR, NULL);
+	seahorse_registry_register_type (NULL, SEAHORSE_TYPE_SSH_SOURCE, "source", "local", SEAHORSE_SSH_STR, NULL);
 }
 
 /* -----------------------------------------------------------------------------

Modified: trunk/ssh/seahorse-ssh-upload.c
==============================================================================
--- trunk/ssh/seahorse-ssh-upload.c	(original)
+++ trunk/ssh/seahorse-ssh-upload.c	Sat Nov 29 17:37:20 2008
@@ -86,7 +86,7 @@
     SeahorseMultiOperation *mop = NULL;
     SeahorseOperation *op = NULL;
     SeahorseSource *sksrc;
-    SeahorseKey *skey;
+    SeahorseObject *object;
     GList *next;
     
     seahorse_util_objects_sort (keys);
@@ -97,11 +97,11 @@
         /* Break off one set (same keysource) */
         next = seahorse_util_objects_splice (keys);
         
-        g_assert (SEAHORSE_IS_KEY (keys->data));
-        skey = SEAHORSE_KEY (keys->data);
+        g_assert (SEAHORSE_IS_OBJECT (keys->data));
+        object = SEAHORSE_OBJECT (keys->data);
 
         /* Upload via this key source */        
-        sksrc = seahorse_key_get_source (skey);
+        sksrc = seahorse_object_get_source (object);
         g_return_val_if_fail (sksrc != NULL, NULL);
         
         g_return_val_if_fail (SEAHORSE_IS_SSH_SOURCE (sksrc), NULL);

Modified: trunk/ssh/vala-build.stamp
==============================================================================
--- trunk/ssh/vala-build.stamp	(original)
+++ trunk/ssh/vala-build.stamp	Sat Nov 29 17:37:20 2008
@@ -1 +1 @@
-1221605166
+1227980103

Modified: trunk/tests/dbus-crypto-test.py
==============================================================================
--- trunk/tests/dbus-crypto-test.py	(original)
+++ trunk/tests/dbus-crypto-test.py	Sat Nov 29 17:37:20 2008
@@ -10,7 +10,7 @@
 proxy_obj = bus.get_object('org.gnome.seahorse', '/org/gnome/seahorse/crypto')
 service = dbus.Interface(proxy_obj, 'org.gnome.seahorse.CryptoService')
 
-encrypted = service.EncryptText(["openpgp:XXXXXXXXXXX", "openpgp:XXXXXXX"], "", 0, "cleartext")
+encrypted = service.EncryptText(["openpgp:A50CFA6E5DBAA916", "openpgp:A50CFA6E5DBAA916"], "", 0, "cleartext")
 print "Encrypted: ", encrypted
 
 (decrypted, signer) = service.DecryptText("openpgp", 0, encrypted)
@@ -18,7 +18,7 @@
 print "Signer: ", signer
 
 
-signed = service.SignText("openpgp:XXXXXXXXXXXXXXXXXXXXX", 0, "cleartext")
+signed = service.SignText("openpgp:A50CFA6E5DBAA916", 0, "cleartext")
 print "Signed: ", signed
 
 (verified, signer) = service.VerifyText("openpgp", 0, signed)

Modified: trunk/tests/dbus-display-notification-test.py
==============================================================================
--- trunk/tests/dbus-display-notification-test.py	(original)
+++ trunk/tests/dbus-display-notification-test.py	Sat Nov 29 17:37:20 2008
@@ -10,8 +10,8 @@
 proxy_obj = bus.get_object('org.gnome.seahorse', '/org/gnome/seahorse/keys')
 service = dbus.Interface(proxy_obj, 'org.gnome.seahorse.KeyService')
 
-service.DisplayNotification("The heading", "1 The text <key id='openpgp:xxxxxxxxxxxxxxxx'/>", "", True)
-service.DisplayNotification("The heading", "2 The text <key id='openpgp:xxxxxxxxxxxxxxxx' field='simple-name'/>", "", True)
-service.DisplayNotification("The heading", "3 The text <key id='openpgp:xxxxxxxxxxxxxxxx' field='key-id'/>", "", True)
-service.DisplayNotification("The heading", "4 The text <key id='openpgp:xxxxxxxxxxxxxxxx' field='id'/>", "", True)
+service.DisplayNotification("The heading", "1 The text <key id='openpgp:A50CFA6E5DBAA916'/>", "", True)
+service.DisplayNotification("The heading", "2 The text <key id='openpgp:A50CFA6E5DBAA916' field='simple-name'/>", "", True)
+service.DisplayNotification("The heading", "3 The text <key id='openpgp:A50CFA6E5DBAA916' field='key-id'/>", "", True)
+service.DisplayNotification("The heading", "4 The text <key id='openpgp:A50CFA6E5DBAA916' field='id'/>", "", True)
 



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