gcr-certificate-basics-widget.c gcr-certificate-basics-widget.h \
gcr-certificate-details-widget.c gcr-certificate-details-widget.h \
gcr-display-view.c gcr-display-view.h \
+ gcr-icons.c gcr-icons.h \
gcr-import-dialog.c gcr-import-dialog.h \
gcr-importer.c gcr-importer.h \
gcr-internal.h \
#include "gcr-certificate.h"
#include "gcr-certificate-widget.h"
#include "gcr-display-view.h"
+#include "gcr-icons.h"
#include "egg/egg-asn1.h"
#include "egg/egg-oid.h"
/* TODO: Calculate name properly */
_gcr_display_view_append_title (self->pv->view, "Certificate Name");
-#if 0
- _gcr_display_view_append_table ()
-
- Issued To:
- Issued By:
- Expires:
-#endif
-
display = egg_asn1_read_dn_part (asn, "tbsCertificate.subject.rdnSequence", "CN");
- _gcr_display_view_append_content (self->pv->view, _("Identifies"), display);
+ _gcr_display_view_append_content (self->pv->view, _("Identity"), display);
g_free (display);
display = egg_asn1_read_dn_part (asn, "tbsCertificate.issuer.rdnSequence", "CN");
self = GCR_CERTIFICATE_WIDGET (obj);
self->pv->view = _gcr_display_view_new ();
- _gcr_display_view_set_stock_image (self->pv->view, GTK_STOCK_DIALOG_AUTHENTICATION);
+ _gcr_display_view_set_stock_image (self->pv->view, GCR_ICON_CERTIFICATE);
scroll = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
g_object_class_install_property (gobject_class, PROP_CERTIFICATE,
g_param_spec_object("certificate", "Certificate", "Certificate to display.",
GCR_TYPE_CERTIFICATE, G_PARAM_READWRITE));
+
+ _gcr_icons_register ();
}
/* -----------------------------------------------------------------------------
on_expander_realize (GtkWidget *widget, gpointer user_data)
{
GdkCursor *cursor = gdk_cursor_new (GDK_ARROW);
- g_printerr ("realize cursor\n");
gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
gdk_cursor_unref (cursor);
}
if (GTK_WIDGET_CLASS (_gcr_display_view_parent_class)->realize)
GTK_WIDGET_CLASS (_gcr_display_view_parent_class)->realize (widget);
- g_printerr ("setting color\n");
style = gtk_widget_get_style (widget);
gtk_widget_modify_bg (self->pv->details_widget, GTK_STATE_NORMAL, &style->base[GTK_STATE_NORMAL]);
}
--- /dev/null
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2010 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 "gcr.h"
+#include "gcr-types.h"
+#include "gcr-icons.h"
+#include "gcr-internal.h"
+
+static gboolean registered_icons = FALSE;
+static const gchar *themed_icons[] = {
+ GCR_ICON_FOLDER,
+ GCR_ICON_CERTIFICATE,
+ NULL,
+};
+
+static void
+add_theme_source (GtkIconSet *iconset, const gchar *icon, GtkIconSize size)
+{
+ GtkIconSource *source;
+
+ source = gtk_icon_source_new ();
+ gtk_icon_source_set_icon_name (source, icon);
+ gtk_icon_source_set_direction_wildcarded (source, TRUE);
+ gtk_icon_source_set_state_wildcarded (source, TRUE);
+
+ if (size == -1) {
+ gtk_icon_source_set_size_wildcarded (source, TRUE);
+ } else {
+ gtk_icon_source_set_size_wildcarded (source, FALSE);
+ gtk_icon_source_set_size (source, size);
+ }
+
+ gtk_icon_set_add_source (iconset, source);
+ gtk_icon_source_free (source);
+}
+
+void
+_gcr_icons_register (void)
+{
+ GtkIconFactory *factory;
+ GtkIconSet *iconset;
+ const gchar **name;
+
+ if (registered_icons)
+ return;
+
+ /* Setup the icon factory. */
+ factory = gtk_icon_factory_new ();
+ gtk_icon_factory_add_default (factory);
+
+ for (name = themed_icons; name && *name; name++) {
+ iconset = gtk_icon_set_new ();
+ add_theme_source (iconset, *name, GTK_ICON_SIZE_BUTTON);
+ add_theme_source (iconset, *name, GTK_ICON_SIZE_MENU);
+ add_theme_source (iconset, *name, GTK_ICON_SIZE_LARGE_TOOLBAR);
+ add_theme_source (iconset, *name, GTK_ICON_SIZE_SMALL_TOOLBAR);
+ add_theme_source (iconset, *name, GTK_ICON_SIZE_DIALOG);
+ add_theme_source (iconset, *name, -1);
+ gtk_icon_factory_add (factory, *name, iconset);
+ gtk_icon_set_unref (iconset);
+ }
+
+ g_object_unref (factory);
+ registered_icons = TRUE;
+}
--- /dev/null
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2010 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 __GCR_ICONS_H__
+#define __GCR_ICONS_H__
+
+#include "gcr-internal.h"
+
+G_BEGIN_DECLS
+
+#define GCR_ICON_FOLDER "folder"
+#define GCR_ICON_CERTIFICATE "application-certificate"
+
+void _gcr_icons_register (void);
+
+G_END_DECLS
+
+#endif /* __GCR_TOKEN_MANAGER_H__ */