seahorse r2638 - in trunk: . gkr libseahorse pgp pkcs11 po src ssh
- From: nnielsen svn gnome org
- To: svn-commits-list gnome org
- Subject: seahorse r2638 - in trunk: . gkr libseahorse pgp pkcs11 po src ssh
- Date: Sun, 30 Nov 2008 03:21:48 +0000 (UTC)
Author: nnielsen
Date: Sun Nov 30 03:21:48 2008
New Revision: 2638
URL: http://svn.gnome.org/viewvc/seahorse?rev=2638&view=rev
Log:
* gkr/Makefile.am:
* gkr/seahorse-gkr-item.c:
* gkr/seahorse-gkr-keyring.c: (added)
* gkr/seahorse-gkr-keyring.glade: (added)
* gkr/seahorse-gkr-keyring.h: (added)
* gkr/seahorse-gkr-keyring-properties.c: (added)
* gkr/seahorse-gkr-module.c:
* gkr/seahorse-gkr-source.c: Add keyring object, and show all keyrings
in the main window. Basic support.
* libseahorse/seahorse-set-model.c: Some fixes for displaying parents
that aren't in the matched set.
* libseahorse/libseahorse.vapi:
* libseahorse/seahorse-context.c:
* libseahorse/seahorse-context.h:
* libseahorse/seahorse-object.c:
* libseahorse/seahorse-object.h:
* src/seahorse-key-manager.vala: Add some better enumeration of objects
using callbacks. Also add possiblility to match on GObject type.
Added:
trunk/gkr/seahorse-gkr-keyring-properties.c
trunk/gkr/seahorse-gkr-keyring.c
trunk/gkr/seahorse-gkr-keyring.glade
trunk/gkr/seahorse-gkr-keyring.h
Modified:
trunk/ChangeLog
trunk/gkr/ (props changed)
trunk/gkr/Makefile.am
trunk/gkr/seahorse-gkr-commands.c
trunk/gkr/seahorse-gkr-dialogs.h
trunk/gkr/seahorse-gkr-item.c
trunk/gkr/seahorse-gkr-module.c
trunk/gkr/seahorse-gkr-source.c
trunk/libseahorse/libseahorse.vapi
trunk/libseahorse/seahorse-context.c
trunk/libseahorse/seahorse-context.h
trunk/libseahorse/seahorse-object.c
trunk/libseahorse/seahorse-object.h
trunk/libseahorse/seahorse-set-model.c
trunk/pgp/vala-build.stamp
trunk/pkcs11/vala-build.stamp
trunk/po/POTFILES.in
trunk/src/seahorse-key-manager.c
trunk/src/seahorse-key-manager.vala
trunk/src/seahorse-keyserver-results.vala
trunk/src/vala-build.stamp
trunk/ssh/vala-build.stamp
Modified: trunk/gkr/Makefile.am
==============================================================================
--- trunk/gkr/Makefile.am (original)
+++ trunk/gkr/Makefile.am Sun Nov 30 03:21:48 2008
@@ -23,6 +23,8 @@
seahorse-gkr-dialogs.h \
seahorse-gkr-item.c seahorse-gkr-item.h \
seahorse-gkr-item-properties.c \
+ seahorse-gkr-keyring.c seahorse-gkr-keyring.h \
+ seahorse-gkr-keyring-properties.c \
seahorse-gkr-module.c seahorse-gkr-module.h \
seahorse-gkr-operation.c seahorse-gkr-operation.h \
seahorse-gkr-source.c seahorse-gkr-source.h
@@ -33,7 +35,8 @@
$(top_builddir)/libcryptui/libcryptui.la
glade_DATA = \
- seahorse-gkr-item-properties.glade
+ seahorse-gkr-item-properties.glade \
+ seahorse-gkr-keyring.glade
EXTRA_DIST = \
$(glade_DATA)
Modified: trunk/gkr/seahorse-gkr-commands.c
==============================================================================
--- trunk/gkr/seahorse-gkr-commands.c (original)
+++ trunk/gkr/seahorse-gkr-commands.c Sun Nov 30 03:21:48 2008
@@ -61,11 +61,20 @@
static void
seahorse_gkr_commands_show_properties (SeahorseCommands* base, SeahorseObject* object)
{
+ GtkWindow *window;
+
g_return_if_fail (SEAHORSE_IS_OBJECT (object));
g_return_if_fail (seahorse_object_get_tag (object) == SEAHORSE_GKR_TYPE);
+
+ window = seahorse_view_get_window (seahorse_commands_get_view (base));
+ if (G_OBJECT_TYPE (object) == SEAHORSE_TYPE_GKR_ITEM)
+ seahorse_gkr_item_properties_show (SEAHORSE_GKR_ITEM (object), window);
+
+ else if (G_OBJECT_TYPE (object) == SEAHORSE_TYPE_GKR_KEYRING)
+ seahorse_gkr_keyring_properties_show (SEAHORSE_GKR_KEYRING (object), window);
- seahorse_gkr_item_properties_show (SEAHORSE_GKR_ITEM (object),
- seahorse_view_get_window (seahorse_commands_get_view (base)));
+ else
+ g_return_if_reached ();
}
static SeahorseOperation*
Modified: trunk/gkr/seahorse-gkr-dialogs.h
==============================================================================
--- trunk/gkr/seahorse-gkr-dialogs.h (original)
+++ trunk/gkr/seahorse-gkr-dialogs.h Sun Nov 30 03:21:48 2008
@@ -25,7 +25,10 @@
#include <gtk/gtk.h>
#include "seahorse-gkr-item.h"
+#include "seahorse-gkr-keyring.h"
void seahorse_gkr_item_properties_show (SeahorseGkrItem *git, GtkWindow *parent);
+void seahorse_gkr_keyring_properties_show (SeahorseGkrKeyring *gkr, GtkWindow *parent);
+
#endif /* __SEAHORSE_GKR_DIALOGS__ */
Modified: trunk/gkr/seahorse-gkr-item.c
==============================================================================
--- trunk/gkr/seahorse-gkr-item.c (original)
+++ trunk/gkr/seahorse-gkr-item.c Sun Nov 30 03:21:48 2008
@@ -528,9 +528,7 @@
seahorse_gkr_item_init (SeahorseGkrItem *self)
{
self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, SEAHORSE_TYPE_GKR_ITEM, SeahorseGkrItemPrivate);
- g_object_set (self,
- "usage", SEAHORSE_USAGE_CREDENTIALS,
- NULL);
+ g_object_set (self, "usage", SEAHORSE_USAGE_CREDENTIALS, NULL);
}
static GObject*
Added: trunk/gkr/seahorse-gkr-keyring-properties.c
==============================================================================
--- (empty file)
+++ trunk/gkr/seahorse-gkr-keyring-properties.c Sun Nov 30 03:21:48 2008
@@ -0,0 +1,113 @@
+/*
+ * 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 "config.h"
+
+#include "seahorse-gkr-dialogs.h"
+#include "seahorse-gkr-keyring.h"
+
+#include <glib/gi18n.h>
+
+#include "seahorse-gtkstock.h"
+#include "seahorse-object.h"
+#include "seahorse-object-widget.h"
+#include "seahorse-util.h"
+
+#include "common/seahorse-bind.h"
+
+/* -----------------------------------------------------------------------------
+ * MAIN TAB
+ */
+
+static gboolean
+transform_keyring_created (const GValue *from, GValue *to)
+{
+ GnomeKeyringInfo *info;
+ time_t time;
+
+ info = g_value_get_boxed (from);
+ if (info) {
+ time = gnome_keyring_info_get_ctime (info);
+ g_value_take_string (to, seahorse_util_get_display_date_string (time));
+ }
+
+ if (!g_value_get_string (to))
+ g_value_set_string (to, "");
+
+ 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, "keyring-image"));
+
+ /* The window title */
+ seahorse_bind_property ("label", object, "title",
+ seahorse_widget_get_toplevel (swidget));
+
+ /* Setup the label properly */
+ seahorse_bind_property ("keyring-name", object, "label",
+ seahorse_widget_get_widget (swidget, "name-field"));
+
+ /* The date field */
+ seahorse_bind_property_full ("keyring-info", object, transform_keyring_created, "label",
+ seahorse_widget_get_widget (swidget, "created-field"), NULL);
+}
+
+/* -----------------------------------------------------------------------------
+ * GENERAL
+ */
+
+static void
+properties_response (GtkDialog *dialog, int response, SeahorseWidget *swidget)
+{
+ if (response == GTK_RESPONSE_HELP) {
+ seahorse_widget_show_help (swidget);
+ return;
+ }
+
+ seahorse_widget_destroy (swidget);
+}
+
+void
+seahorse_gkr_keyring_properties_show (SeahorseGkrKeyring *gkr, GtkWindow *parent)
+{
+ SeahorseObject *object = SEAHORSE_OBJECT (gkr);
+ SeahorseWidget *swidget = NULL;
+ GtkWidget *widget;
+
+ swidget = seahorse_object_widget_new ("gkr-keyring", 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);
+
+ setup_main (swidget);
+}
Added: trunk/gkr/seahorse-gkr-keyring.c
==============================================================================
--- (empty file)
+++ trunk/gkr/seahorse-gkr-keyring.c Sun Nov 30 03:21:48 2008
@@ -0,0 +1,291 @@
+/*
+ * 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-gkr.h"
+#include "seahorse-gkr-keyring.h"
+
+enum {
+ PROP_0,
+ PROP_KEYRING_NAME,
+ PROP_KEYRING_INFO
+};
+
+struct _SeahorseGkrKeyringPrivate {
+ gchar *keyring_name;
+
+ gpointer req_info;
+ GnomeKeyringInfo *keyring_info;
+};
+
+G_DEFINE_TYPE (SeahorseGkrKeyring, seahorse_gkr_keyring, SEAHORSE_TYPE_OBJECT);
+
+GType
+boxed_type_keyring_info (void)
+{
+ static GType type = 0;
+ if (!type)
+ type = g_boxed_type_register_static ("GnomeKeyringInfo",
+ (GBoxedCopyFunc)gnome_keyring_info_copy,
+ (GBoxedFreeFunc)gnome_keyring_info_free);
+ return type;
+}
+
+/* -----------------------------------------------------------------------------
+ * INTERNAL
+ */
+
+static void
+received_keyring_info (GnomeKeyringResult result, GnomeKeyringInfo *info, gpointer data)
+{
+ SeahorseGkrKeyring *self = SEAHORSE_GKR_KEYRING (data);
+ self->pv->req_info = NULL;
+
+ if (result == GNOME_KEYRING_RESULT_CANCELLED)
+ return;
+
+ if (result != GNOME_KEYRING_RESULT_OK) {
+ /* TODO: Implement so that we can display an error icon, along with some text */
+ g_message ("failed to retrieve info for keyring %s: %s",
+ self->pv->keyring_name,
+ gnome_keyring_result_to_message (result));
+ return;
+ }
+
+ seahorse_gkr_keyring_set_info (self, info);
+}
+
+static gboolean
+require_keyring_info (SeahorseGkrKeyring *self)
+{
+ if (self->pv->keyring_info)
+ return TRUE;
+
+ /* Already in progress */
+ if (!self->pv->req_info) {
+ g_object_ref (self);
+ self->pv->req_info = gnome_keyring_get_info (self->pv->keyring_name,
+ received_keyring_info,
+ self, g_object_unref);
+ }
+
+ return self->pv->keyring_info != NULL;
+}
+
+/* -----------------------------------------------------------------------------
+ * OBJECT
+ */
+
+static void
+seahorse_gkr_keyring_realize (SeahorseObject *obj)
+{
+ SeahorseGkrKeyring *self = SEAHORSE_GKR_KEYRING (obj);
+ gchar *name, *markup;
+
+ name = g_strdup_printf ("Passwords: %s", self->pv->keyring_name);
+ markup = g_markup_printf_escaped ("<b>Passwords:</b> %s", self->pv->keyring_name);
+
+ g_object_set (self,
+ "label", name,
+ "markup", markup,
+ "nickname", self->pv->keyring_name,
+ "identifier", "",
+ "description", "",
+ "flags", 0,
+ "icon", "folder",
+ NULL);
+
+ g_free (name);
+ g_free (markup);
+
+ SEAHORSE_OBJECT_CLASS (seahorse_gkr_keyring_parent_class)->realize (obj);
+}
+
+static void
+seahorse_gkr_keyring_flush (SeahorseObject *obj)
+{
+ SeahorseGkrKeyring *self = SEAHORSE_GKR_KEYRING (obj);
+
+ if (self->pv->keyring_info)
+ gnome_keyring_info_free (self->pv->keyring_info);
+ self->pv->keyring_info = NULL;
+ g_assert (self->pv->req_info == NULL);
+
+ SEAHORSE_OBJECT_CLASS (seahorse_gkr_keyring_parent_class)->flush (obj);
+}
+
+
+static GObject*
+seahorse_gkr_keyring_constructor (GType type, guint n_props, GObjectConstructParam *props)
+{
+ GObject *obj = G_OBJECT_CLASS (seahorse_gkr_keyring_parent_class)->constructor (type, n_props, props);
+ SeahorseGkrKeyring *self = NULL;
+ gchar *id;
+
+ if (obj) {
+ self = SEAHORSE_GKR_KEYRING (obj);
+
+ g_return_val_if_fail (self->pv->keyring_name, obj);
+ id = g_strdup_printf ("%s:%s", SEAHORSE_GKR_TYPE_STR, self->pv->keyring_name);
+ g_object_set (self,
+ "id", g_quark_from_string (id),
+ "usage", SEAHORSE_USAGE_NONE,
+ NULL);
+ g_free (id);
+ }
+
+ return obj;
+}
+
+static void
+seahorse_gkr_keyring_init (SeahorseGkrKeyring *self)
+{
+ self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, SEAHORSE_TYPE_GKR_KEYRING, SeahorseGkrKeyringPrivate);
+}
+
+static void
+seahorse_gkr_keyring_finalize (GObject *obj)
+{
+ SeahorseGkrKeyring *self = SEAHORSE_GKR_KEYRING (obj);
+
+ g_free (self->pv->keyring_name);
+ self->pv->keyring_name = NULL;
+
+ if (self->pv->keyring_info)
+ gnome_keyring_info_free (self->pv->keyring_info);
+ self->pv->keyring_info = NULL;
+
+ G_OBJECT_CLASS (seahorse_gkr_keyring_parent_class)->finalize (obj);
+}
+
+static void
+seahorse_gkr_keyring_set_property (GObject *obj, guint prop_id, const GValue *value,
+ GParamSpec *pspec)
+{
+ SeahorseGkrKeyring *self = SEAHORSE_GKR_KEYRING (obj);
+
+ switch (prop_id) {
+ case PROP_KEYRING_NAME:
+ g_return_if_fail (self->pv->keyring_name == NULL);
+ self->pv->keyring_name = g_value_dup_string (value);
+ g_object_notify (obj, "keyring-name");
+ break;
+ case PROP_KEYRING_INFO:
+ seahorse_gkr_keyring_set_info (self, g_value_get_boxed (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+seahorse_gkr_keyring_get_property (GObject *obj, guint prop_id, GValue *value,
+ GParamSpec *pspec)
+{
+ SeahorseGkrKeyring *self = SEAHORSE_GKR_KEYRING (obj);
+
+ switch (prop_id) {
+ case PROP_KEYRING_NAME:
+ g_value_set_string (value, seahorse_gkr_keyring_get_name (self));
+ break;
+ case PROP_KEYRING_INFO:
+ g_value_set_boxed (value, seahorse_gkr_keyring_get_info (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+seahorse_gkr_keyring_class_init (SeahorseGkrKeyringClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ SeahorseObjectClass *seahorse_class;
+
+ seahorse_gkr_keyring_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (SeahorseGkrKeyringPrivate));
+
+ gobject_class->constructor = seahorse_gkr_keyring_constructor;
+ gobject_class->finalize = seahorse_gkr_keyring_finalize;
+ gobject_class->set_property = seahorse_gkr_keyring_set_property;
+ gobject_class->get_property = seahorse_gkr_keyring_get_property;
+
+ seahorse_class = SEAHORSE_OBJECT_CLASS (klass);
+ seahorse_class->realize = seahorse_gkr_keyring_realize;
+ seahorse_class->flush = seahorse_gkr_keyring_flush;
+
+ g_object_class_install_property (gobject_class, PROP_KEYRING_NAME,
+ g_param_spec_string ("keyring-name", "Gnome Keyring Name", "Name of keyring.",
+ "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property (gobject_class, PROP_KEYRING_INFO,
+ g_param_spec_boxed ("keyring-info", "Gnome Keyring Info", "Info about keyring.",
+ boxed_type_keyring_info (), G_PARAM_READWRITE));
+}
+
+/* -----------------------------------------------------------------------------
+ * PUBLIC
+ */
+
+SeahorseGkrKeyring*
+seahorse_gkr_keyring_new (const gchar *keyring_name)
+{
+ return g_object_new (SEAHORSE_TYPE_GKR_KEYRING, "keyring-name", keyring_name, NULL);
+}
+
+const gchar*
+seahorse_gkr_keyring_get_name (SeahorseGkrKeyring *self)
+{
+ g_return_val_if_fail (SEAHORSE_IS_GKR_KEYRING (self), NULL);
+ return self->pv->keyring_name;
+}
+
+GnomeKeyringInfo*
+seahorse_gkr_keyring_get_info (SeahorseGkrKeyring *self)
+{
+ g_return_val_if_fail (SEAHORSE_IS_GKR_KEYRING (self), NULL);
+ require_keyring_info (self);
+ return self->pv->keyring_info;
+}
+
+void
+seahorse_gkr_keyring_set_info (SeahorseGkrKeyring *self, GnomeKeyringInfo *info)
+{
+ GObject *obj;
+
+ g_return_if_fail (SEAHORSE_IS_GKR_KEYRING (self));
+
+ if (self->pv->keyring_info)
+ gnome_keyring_info_free (self->pv->keyring_info);
+ if (info)
+ self->pv->keyring_info = gnome_keyring_info_copy (info);
+ else
+ self->pv->keyring_info = NULL;
+
+ obj = G_OBJECT (self);
+ g_object_freeze_notify (obj);
+ seahorse_gkr_keyring_realize (SEAHORSE_OBJECT (self));
+ g_object_notify (obj, "keyring-info");
+ g_object_thaw_notify (obj);
+}
Added: trunk/gkr/seahorse-gkr-keyring.glade
==============================================================================
--- (empty file)
+++ trunk/gkr/seahorse-gkr-keyring.glade Sun Nov 30 03:21:48 2008
@@ -0,0 +1,287 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkDialog" id="gkr-keyring">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Keyring Properties</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+ <property name="has_separator">False</property>
+ <signal name="delete_event" handler="delete_event" last_modification_time="Mon, 20 Mar 2006 21:04:39 GMT"/>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="helpbutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-help</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-11</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="closebutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-7</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkNotebook" id="notebook">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="show_tabs">True</property>
+ <property name="show_border">True</property>
+ <property name="tab_pos">GTK_POS_TOP</property>
+ <property name="scrollable">False</property>
+ <property name="enable_popup">False</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox7">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">18</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox61">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkImage" id="keyring-image">
+ <property name="visible">True</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon_size">6</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkTable" id="table9">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+
+ <child>
+ <widget class="GtkLabel" id="label72">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Name:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label22228">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" comments="To translators: This is the noun not the verb.">Created:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">1</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="created-field">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">date</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">1</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="name-field">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">keyring name</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">1</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="tab_expand">False</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Keyring</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">3</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
Added: trunk/gkr/seahorse-gkr-keyring.h
==============================================================================
--- (empty file)
+++ trunk/gkr/seahorse-gkr-keyring.h Sun Nov 30 03:21:48 2008
@@ -0,0 +1,62 @@
+/*
+ * 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_GKR_KEYRING_H__
+#define __SEAHORSE_GKR_KEYRING_H__
+
+#include <glib-object.h>
+
+#include "seahorse-object.h"
+
+#include <gnome-keyring.h>
+
+#define SEAHORSE_TYPE_GKR_KEYRING (seahorse_gkr_keyring_get_type ())
+#define SEAHORSE_GKR_KEYRING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_GKR_KEYRING, SeahorseGkrKeyring))
+#define SEAHORSE_GKR_KEYRING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_GKR_KEYRING, SeahorseGkrKeyringClass))
+#define SEAHORSE_IS_GKR_KEYRING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_GKR_KEYRING))
+#define SEAHORSE_IS_GKR_KEYRING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_GKR_KEYRING))
+#define SEAHORSE_GKR_KEYRING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_GKR_KEYRING, SeahorseGkrKeyringClass))
+
+typedef struct _SeahorseGkrKeyring SeahorseGkrKeyring;
+typedef struct _SeahorseGkrKeyringClass SeahorseGkrKeyringClass;
+typedef struct _SeahorseGkrKeyringPrivate SeahorseGkrKeyringPrivate;
+
+struct _SeahorseGkrKeyring {
+ SeahorseObject parent;
+ SeahorseGkrKeyringPrivate *pv;
+};
+
+struct _SeahorseGkrKeyringClass {
+ SeahorseObjectClass parent_class;
+};
+
+GType seahorse_gkr_keyring_get_type (void);
+
+SeahorseGkrKeyring* seahorse_gkr_keyring_new (const gchar *keyring_name);
+
+const gchar* seahorse_gkr_keyring_get_name (SeahorseGkrKeyring *self);
+
+GnomeKeyringInfo* seahorse_gkr_keyring_get_info (SeahorseGkrKeyring *self);
+
+void seahorse_gkr_keyring_set_info (SeahorseGkrKeyring *self,
+ GnomeKeyringInfo *info);
+
+#endif /* __SEAHORSE_GKR_KEYRING_H__ */
Modified: trunk/gkr/seahorse-gkr-module.c
==============================================================================
--- trunk/gkr/seahorse-gkr-module.c (original)
+++ trunk/gkr/seahorse-gkr-module.c Sun Nov 30 03:21:48 2008
@@ -33,21 +33,27 @@
void
seahorse_gkr_module_init (void)
{
- SeahorseSource *source;
GnomeKeyringResult result;
- gchar *keyring;
-
- /* Create a keyring for the default gnome keyring */
- result = gnome_keyring_get_default_keyring_sync (&keyring);
+ SeahorseSource *source;
+ const gchar *keyring_name;
+ GList *l, *keyrings = NULL;
+
+ /* List the keyrings and add one per */
+ result = gnome_keyring_list_keyring_names_sync (&keyrings);
if (result != GNOME_KEYRING_RESULT_OK) {
- g_warning ("couldn't get default gnome-keyring keyring: %s",
+ g_warning ("couldn't get list gnome-keyring keyrings: %s",
gnome_keyring_result_to_message (result));
} else {
- source = SEAHORSE_SOURCE (seahorse_gkr_source_new (keyring));
- g_free (keyring);
- seahorse_context_take_source (NULL, source);
+
+ for (l = keyrings; l; l = g_list_next (l)) {
+ keyring_name = (const gchar*)l->data;
+ source = SEAHORSE_SOURCE (seahorse_gkr_source_new (keyring_name));
+ seahorse_context_take_source (NULL, source);
+ }
+
+ gnome_keyring_string_list_free (keyrings);
}
-
+
/* Let these classes register themselves */
g_type_class_unref (g_type_class_ref (SEAHORSE_TYPE_GKR_SOURCE));
g_type_class_unref (g_type_class_ref (SEAHORSE_TYPE_GKR_COMMANDS));
Modified: trunk/gkr/seahorse-gkr-source.c
==============================================================================
--- trunk/gkr/seahorse-gkr-source.c (original)
+++ trunk/gkr/seahorse-gkr-source.c Sun Nov 30 03:21:48 2008
@@ -27,13 +27,15 @@
#include <glib/gi18n.h>
-#include "seahorse-gkr-source.h"
#include "seahorse-operation.h"
#include "seahorse-util.h"
-#include "seahorse-gkr-item.h"
#include "seahorse-secure-memory.h"
#include "seahorse-passphrase.h"
+
+#include "seahorse-gkr-item.h"
+#include "seahorse-gkr-keyring.h"
#include "seahorse-gkr-operation.h"
+#include "seahorse-gkr-source.h"
#include "common/seahorse-registry.h"
@@ -66,8 +68,9 @@
};
struct _SeahorseGkrSourcePrivate {
- SeahorseMultiOperation *operations; /* A list of all current operations */
- gchar *keyring_name; /* The key ring name */
+ SeahorseMultiOperation *operations; /* A list of all current operations */
+ gchar *keyring_name; /* The key ring name */
+ SeahorseObject *keyring_object; /* Object which represents the whole keyring */
};
G_DEFINE_TYPE (SeahorseGkrSource, seahorse_gkr_source, SEAHORSE_TYPE_SOURCE);
@@ -160,6 +163,7 @@
git = seahorse_gkr_item_new (SEAHORSE_SOURCE (lop->gsrc), keyring_name, item_id);
/* Add to context */
+ seahorse_object_set_parent (SEAHORSE_OBJECT (git), lop->gsrc->pv->keyring_object);
seahorse_context_take_object (SCTX_APP (), SEAHORSE_OBJECT (git));
}
@@ -177,11 +181,19 @@
}
+static void
+insert_id_hashtable (SeahorseObject *object, gpointer user_data)
+{
+ g_hash_table_insert ((GHashTable*)user_data,
+ GUINT_TO_POINTER (seahorse_object_get_id (object)),
+ GUINT_TO_POINTER (TRUE));
+}
+
static SeahorseListOperation*
start_list_operation (SeahorseGkrSource *gsrc)
{
SeahorseListOperation *lop;
- GList *keys, *l;
+ SeahorseObjectPredicate pred;
g_assert (SEAHORSE_IS_GKR_SOURCE (gsrc));
@@ -192,11 +204,10 @@
/* When loading new keys prepare a list of current */
lop->checks = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);
- keys = seahorse_context_get_objects (SCTX_APP (), SEAHORSE_SOURCE (gsrc));
- for (l = keys; l; l = g_list_next (l))
- g_hash_table_insert (lop->checks, GUINT_TO_POINTER (seahorse_object_get_id (l->data)),
- GUINT_TO_POINTER (TRUE));
- g_list_free (keys);
+ seahorse_object_predicate_clear (&pred);
+ pred.source = SEAHORSE_SOURCE (gsrc);
+ pred.type = SEAHORSE_TYPE_GKR_ITEM;
+ seahorse_context_for_objects_full (SCTX_APP (), &pred, insert_id_hashtable, lop->checks);
/* Start listing of ids */
seahorse_operation_mark_progress (SEAHORSE_OPERATION (lop), _("Listing passwords"), -1);
@@ -406,8 +417,18 @@
static GObject*
seahorse_gkr_source_constructor (GType type, guint n_props, GObjectConstructParam* props)
{
- GObject* obj = G_OBJECT_CLASS (seahorse_gkr_source_parent_class)->constructor (type, n_props, props);
- return obj;
+ GObject* obj = G_OBJECT_CLASS (seahorse_gkr_source_parent_class)->constructor (type, n_props, props);
+ SeahorseGkrSource *self = NULL;
+
+ if (obj) {
+ self = SEAHORSE_GKR_SOURCE (obj);
+
+ /* Add the initial keyring folder style object */
+ self->pv->keyring_object = SEAHORSE_OBJECT (seahorse_gkr_keyring_new (self->pv->keyring_name));
+ seahorse_context_add_object (SCTX_APP (), self->pv->keyring_object);
+ }
+
+ return obj;
}
static void
@@ -533,6 +554,11 @@
g_object_unref (gsrc->pv->operations);
gsrc->pv->operations = NULL;
}
+
+ /* The keyring object */
+ if (gsrc->pv->keyring_object)
+ g_object_unref (gsrc->pv->keyring_object);
+ gsrc->pv->keyring_object = NULL;
G_OBJECT_CLASS (seahorse_gkr_source_parent_class)->dispose (gobject);
}
Modified: trunk/libseahorse/libseahorse.vapi
==============================================================================
--- trunk/libseahorse/libseahorse.vapi (original)
+++ trunk/libseahorse/libseahorse.vapi Sun Nov 30 03:21:48 2008
@@ -65,6 +65,7 @@
public struct Predicate {
public GLib.Quark tag;
public GLib.Quark id;
+ public GLib.Type type;
public Seahorse.Location location;
public Seahorse.Usage usage;
public uint flags;
@@ -72,6 +73,7 @@
public weak Seahorse.Source? source;
public Seahorse.Object.PredicateFunc? custom;
public bool match (Seahorse.Object obj);
+ public void clear ();
}
[CCode (cheader_filename = "seahorse-object.h")]
public delegate bool PredicateFunc (Seahorse.Object obj);
Modified: trunk/libseahorse/seahorse-context.c
==============================================================================
--- trunk/libseahorse/seahorse-context.c (original)
+++ trunk/libseahorse/seahorse-context.c Sun Nov 30 03:21:48 2008
@@ -419,7 +419,7 @@
static void
-object_notify (SeahorseObject *sobj, SeahorseContext *sctx)
+object_notify (SeahorseObject *sobj, GParamSpec *spec, SeahorseContext *sctx)
{
g_signal_emit (sctx, signals[CHANGED], 0, sobj);
}
@@ -527,7 +527,7 @@
g_signal_emit (sctx, signals[ADDED], 0, sobj);
g_object_unref (sobj);
- seahorse_bind_objects (NULL, sobj, (SeahorseTransfer)object_notify, sctx);
+ g_signal_connect (sobj, "notify", G_CALLBACK (object_notify), sctx);
}
guint
@@ -555,47 +555,93 @@
}
typedef struct _ObjectMatcher {
-
- SeahorseObjectPredicate *kp;
- gboolean many;
- GList *objects;
-
+ SeahorseObjectPredicate *kp;
+ gboolean many;
+ SeahorseObjectFunc func;
+ gpointer user_data;
} ObjectMatcher;
gboolean
find_matching_objects (gpointer key, SeahorseObject *sobj, ObjectMatcher *km)
{
- if (km->kp && seahorse_object_predicate_match (km->kp, SEAHORSE_OBJECT (sobj)))
- km->objects = g_list_prepend (km->objects, sobj);
+ gboolean matched;
+
+ if (km->kp && seahorse_object_predicate_match (km->kp, SEAHORSE_OBJECT (sobj))) {
+ matched = TRUE;
+ (km->func) (sobj, km->user_data);
+ }
+
+ /* Terminate search */
+ if (!km->many && matched)
+ return TRUE;
- /* Terminate search */
- if (!km->many && km->objects)
- return TRUE;
+ /* Keep going */
+ return FALSE;
+}
- /* Keep going */
- return FALSE;
+static void
+add_object_to_list (SeahorseObject *object, gpointer user_data)
+{
+ GList** list = (GList**)user_data;
+ *list = g_list_prepend (*list, object);
}
-GList*
-seahorse_context_get_objects (SeahorseContext *sctx, SeahorseSource *sksrc)
+GList*
+seahorse_context_find_objects_full (SeahorseContext *self, SeahorseObjectPredicate *pred)
{
- SeahorseObjectPredicate kp;
- ObjectMatcher km;
+ GList *list = NULL;
+ ObjectMatcher km;
- if (!sctx)
- sctx = seahorse_context_for_app ();
- g_return_val_if_fail (SEAHORSE_IS_CONTEXT (sctx), NULL);
- g_return_val_if_fail (sksrc == NULL || SEAHORSE_IS_SOURCE (sksrc), NULL);
+ if (!self)
+ self = seahorse_context_for_app ();
+ g_return_val_if_fail (SEAHORSE_IS_CONTEXT (self), NULL);
+ g_return_val_if_fail (pred, NULL);
+
+ memset (&km, 0, sizeof (km));
+ km.kp = pred;
+ km.many = TRUE;
+ km.func = add_object_to_list;
+ km.user_data = &list;
- memset (&kp, 0, sizeof (kp));
- memset (&km, 0, sizeof (km));
-
- km.kp = &kp;
- km.many = TRUE;
- kp.source = sksrc;
-
- g_hash_table_find (sctx->pv->objects_by_source, (GHRFunc)find_matching_objects, &km);
- return km.objects;
+ g_hash_table_find (self->pv->objects_by_source, (GHRFunc)find_matching_objects, &km);
+ return list;
+}
+
+void
+seahorse_context_for_objects_full (SeahorseContext *self, SeahorseObjectPredicate *pred,
+ SeahorseObjectFunc func, gpointer user_data)
+{
+ ObjectMatcher km;
+
+ if (!self)
+ self = seahorse_context_for_app ();
+ g_return_if_fail (SEAHORSE_IS_CONTEXT (self));
+ g_return_if_fail (pred);
+ g_return_if_fail (func);
+
+ memset (&km, 0, sizeof (km));
+ km.kp = pred;
+ km.many = TRUE;
+ km.func = func;
+ km.user_data = user_data;
+
+ g_hash_table_find (self->pv->objects_by_source, (GHRFunc)find_matching_objects, &km);
+}
+
+GList*
+seahorse_context_get_objects (SeahorseContext *self, SeahorseSource *source)
+{
+ SeahorseObjectPredicate pred;
+
+ if (!self)
+ self = seahorse_context_for_app ();
+ g_return_val_if_fail (SEAHORSE_IS_CONTEXT (self), NULL);
+ g_return_val_if_fail (source == NULL || SEAHORSE_IS_SOURCE (source), NULL);
+
+ seahorse_object_predicate_clear (&pred);
+ pred.source = source;
+
+ return seahorse_context_find_objects_full (self, &pred);
}
SeahorseObject*
@@ -642,24 +688,6 @@
return seahorse_context_find_objects_full (sctx, &pred);
}
-GList*
-seahorse_context_find_objects_full (SeahorseContext *sctx, SeahorseObjectPredicate *skpred)
-{
- ObjectMatcher km;
-
- if (!sctx)
- sctx = seahorse_context_for_app ();
- g_return_val_if_fail (SEAHORSE_IS_CONTEXT (sctx), NULL);
-
- memset (&km, 0, sizeof (km));
-
- km.kp = skpred;
- km.many = TRUE;
-
- g_hash_table_find (sctx->pv->objects_by_source, (GHRFunc)find_matching_objects, &km);
- return km.objects;
-}
-
void
seahorse_context_remove_object (SeahorseContext *sctx, SeahorseObject *sobj)
{
Modified: trunk/libseahorse/seahorse-context.h
==============================================================================
--- trunk/libseahorse/seahorse-context.h (original)
+++ trunk/libseahorse/seahorse-context.h Sun Nov 30 03:21:48 2008
@@ -91,6 +91,8 @@
SEAHORSE_CONTEXT_DAEMON = 2,
};
+typedef void (*SeahorseObjectFunc) (struct _SeahorseObject *obj, gpointer user_data);
+
#define SCTX_APP() (seahorse_context_for_app ())
GType seahorse_context_get_type (void);
@@ -148,9 +150,14 @@
SeahorseUsage usage,
SeahorseLocation location);
-GList* seahorse_context_find_objects_full (SeahorseContext *sctx,
+GList* seahorse_context_find_objects_full (SeahorseContext *self,
struct _SeahorseObjectPredicate *skpred);
-
+
+void seahorse_context_for_objects_full (SeahorseContext *self,
+ struct _SeahorseObjectPredicate *skpred,
+ SeahorseObjectFunc func,
+ gpointer user_data);
+
void seahorse_context_remove_object (SeahorseContext *sctx,
struct _SeahorseObject *sobj);
Modified: trunk/libseahorse/seahorse-object.c
==============================================================================
--- trunk/libseahorse/seahorse-object.c (original)
+++ trunk/libseahorse/seahorse-object.c Sun Nov 30 03:21:48 2008
@@ -878,6 +878,8 @@
return FALSE;
if (self->id != 0 && self->id != pv->id)
return FALSE;
+ if (self->type != 0 && self->type != G_OBJECT_TYPE (obj))
+ return FALSE;
if (self->location != 0 && self->location != pv->location)
return FALSE;
if (self->usage != 0 && self->usage != pv->usage)
@@ -895,3 +897,9 @@
return TRUE;
}
+
+void
+seahorse_object_predicate_clear (SeahorseObjectPredicate *self)
+{
+ memset (self, 0, sizeof (*self));
+}
Modified: trunk/libseahorse/seahorse-object.h
==============================================================================
--- trunk/libseahorse/seahorse-object.h (original)
+++ trunk/libseahorse/seahorse-object.h Sun Nov 30 03:21:48 2008
@@ -139,6 +139,7 @@
struct _SeahorseObjectPredicate {
GQuark tag;
GQuark id;
+ GType type;
SeahorseLocation location;
SeahorseUsage usage;
guint flags;
@@ -148,6 +149,8 @@
gpointer custom_target;
};
+void seahorse_object_predicate_clear (SeahorseObjectPredicate *self);
+
gboolean seahorse_object_predicate_match (SeahorseObjectPredicate *self,
SeahorseObject *obj);
Modified: trunk/libseahorse/seahorse-set-model.c
==============================================================================
--- trunk/libseahorse/seahorse-set-model.c (original)
+++ trunk/libseahorse/seahorse-set-model.c Sun Nov 30 03:21:48 2008
@@ -206,6 +206,7 @@
{
SeahorseSetModelPrivate *pv = SEAHORSE_SET_MODEL_GET_PRIVATE (smodel);
GNode *node;
+ GNode *parent;
SeahorseObject *parent_obj;
node = g_hash_table_lookup (pv->object_to_node, sobj);
@@ -213,6 +214,9 @@
g_assert (node != pv->root_node);
g_assert (node->data == sobj);
+ parent = node->parent;
+ g_assert (parent);
+
/* Remove this object and any children */
g_node_traverse (node, G_POST_ORDER, G_TRAVERSE_ALL, -1,
(GNodeTraverseFunc)remove_each_object, smodel);
@@ -221,9 +225,12 @@
* Now check if the parent of this object is actually in the set, or was
* just added for the sake of holding the child (see add_object above)
*/
- parent_obj = seahorse_object_get_parent (sobj);
- if (parent_obj && !seahorse_set_has_object (smodel->set, parent_obj))
- remove_object (smodel, sobj);
+ if (parent != pv->root_node && g_node_n_children (parent) == 0) {
+ parent_obj = seahorse_object_get_parent (sobj);
+ g_return_if_fail (parent_obj);
+ if (!seahorse_set_has_object (smodel->set, parent_obj))
+ remove_object (smodel, parent_obj);
+ }
}
static void
Modified: trunk/pgp/vala-build.stamp
==============================================================================
--- trunk/pgp/vala-build.stamp (original)
+++ trunk/pgp/vala-build.stamp Sun Nov 30 03:21:48 2008
@@ -1 +1 @@
-1227980068
+1228006945
Modified: trunk/pkcs11/vala-build.stamp
==============================================================================
--- trunk/pkcs11/vala-build.stamp (original)
+++ trunk/pkcs11/vala-build.stamp Sun Nov 30 03:21:48 2008
@@ -1 +1 @@
-1227979999
+1228006941
Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in (original)
+++ trunk/po/POTFILES.in Sun Nov 30 03:21:48 2008
@@ -9,6 +9,9 @@
gkr/seahorse-gkr-item.c
gkr/seahorse-gkr-item-properties.c
gkr/seahorse-gkr-item-properties.glade
+gkr/seahorse-gkr-keyring.c
+gkr/seahorse-gkr-keyring.glade
+gkr/seahorse-gkr-keyring-properties.c
gkr/seahorse-gkr-operation.c
gkr/seahorse-gkr-source.c
gkr/seahorse-gkr-commands.c
Modified: trunk/src/seahorse-key-manager.c
==============================================================================
--- trunk/src/seahorse-key-manager.c (original)
+++ trunk/src/seahorse-key-manager.c Sun Nov 30 03:21:48 2008
@@ -158,10 +158,10 @@
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) (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 SeahorseObjectPredicate SEAHORSE_KEY_MANAGER_PRED_PUBLIC = {((GQuark) (0)), ((GQuark) (0)), ((GType) (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)), ((GType) (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)), ((GType) (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)), ((GType) (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))}};
static const GtkActionEntry SEAHORSE_KEY_MANAGER_SERVER_ENTRIES[] = {{"remote-find", GTK_STOCK_FIND, N_ ("_Find Remote Keys..."), "", N_ ("Search for keys on a key server"), ((GCallback) (NULL))}, {"remote-sync", GTK_STOCK_REFRESH, N_ ("_Sync and Publish Keys..."), "", N_ ("Publish and/or synchronize your keys with those online."), ((GCallback) (NULL))}};
static const GtkToggleActionEntry SEAHORSE_KEY_MANAGER_VIEW_ENTRIES[] = {{"view-type", NULL, N_ ("T_ypes"), NULL, N_ ("Show type column"), NULL, FALSE}, {"view-expires", NULL, N_ ("_Expiry"), NULL, N_ ("Show expiry column"), NULL, FALSE}, {"view-trust", NULL, N_ ("_Trust"), NULL, N_ ("Show owner trust column"), NULL, FALSE}, {"view-validity", NULL, N_ ("_Validity"), NULL, N_ ("Show validity column"), NULL, FALSE}};
Modified: trunk/src/seahorse-key-manager.vala
==============================================================================
--- trunk/src/seahorse-key-manager.vala (original)
+++ trunk/src/seahorse-key-manager.vala Sun Nov 30 03:21:48 2008
@@ -61,43 +61,47 @@
private TabInfo[] _tabs;
private static const Object.Predicate PRED_PUBLIC = {
- 0, /* ktype */
+ 0, /* tag */
0, /* id */
+ 0, /* type */
Location.LOCAL, /* location */
Usage.PUBLIC_KEY, /* usage */
0, /* flags */
Object.Flag.TRUSTED | Object.Flag.IS_VALID, /* nflags */
- null /* sksrc */
+ null /* source */
};
private static const Object.Predicate PRED_TRUSTED = {
- 0, /* ktype */
+ 0, /* tag */
0, /* id */
+ 0, /* type */
Location.LOCAL, /* location */
Usage.PUBLIC_KEY, /* usage */
Object.Flag.TRUSTED | Object.Flag.IS_VALID, /* flags */
0, /* nflags */
- null /* sksrc */
+ null /* source */
};
private static const Object.Predicate PRED_PRIVATE = {
- 0, /* ktype */
+ 0, /* tag */
0, /* id */
+ 0, /* type */
Location.LOCAL, /* location */
Usage.PRIVATE_KEY, /* usage */
0, /* flags */
0, /* nflags */
- null /* sksrc */
+ null /* source */
};
private static const Object.Predicate PRED_PASSWORD = {
- 0, /* ktype */
+ 0, /* tag */
0, /* id */
+ 0, /* type */
Location.LOCAL, /* location */
Usage.CREDENTIALS, /* usage */
0, /* flags */
0, /* nflags */
- null /* sksrc */
+ null /* source */
};
private static const Gtk.ActionEntry[] GENERAL_ENTRIES = {
Modified: trunk/src/seahorse-keyserver-results.vala
==============================================================================
--- trunk/src/seahorse-keyserver-results.vala (original)
+++ trunk/src/seahorse-keyserver-results.vala Sun Nov 30 03:21:48 2008
@@ -115,7 +115,7 @@
_pred.usage = Usage.PUBLIC_KEY;
_pred.location = Location.REMOTE;
_pred.custom = on_filter_objects;
-
+
/* Our set all nicely filtered */
_objects = new Set.full (ref _pred);
_store = new KeyManagerStore (_objects, _view);
Modified: trunk/src/vala-build.stamp
==============================================================================
--- trunk/src/vala-build.stamp (original)
+++ trunk/src/vala-build.stamp Sun Nov 30 03:21:48 2008
@@ -1 +1 @@
-1227995668
+1228007245
Modified: trunk/ssh/vala-build.stamp
==============================================================================
--- trunk/ssh/vala-build.stamp (original)
+++ trunk/ssh/vala-build.stamp Sun Nov 30 03:21:48 2008
@@ -1 +1 @@
-1227980103
+1228006950
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]