From 6561e49374018bd4828de2637df5250b3dba9ba6 Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 9 Dec 2003 01:57:09 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'GNOME_SYSTEM_MONITOR_2_6_0'. svn path=/tags/GNOME_SYSTEM_MONITOR_2_6_0/; revision=23789 --- smime/gui/.cvsignore | 3 - smime/gui/Makefile.am | 35 - smime/gui/certificate-manager.c | 745 -------------- smime/gui/certificate-manager.h | 30 - smime/gui/certificate-viewer.c | 298 ------ smime/gui/certificate-viewer.h | 31 - smime/gui/e-cert-selector.c | 247 ----- smime/gui/e-cert-selector.h | 67 -- smime/gui/smime-ui.glade | 2100 --------------------------------------- 9 files changed, 3556 deletions(-) delete mode 100644 smime/gui/.cvsignore delete mode 100644 smime/gui/Makefile.am delete mode 100644 smime/gui/certificate-manager.c delete mode 100644 smime/gui/certificate-manager.h delete mode 100644 smime/gui/certificate-viewer.c delete mode 100644 smime/gui/certificate-viewer.h delete mode 100644 smime/gui/e-cert-selector.c delete mode 100644 smime/gui/e-cert-selector.h delete mode 100644 smime/gui/smime-ui.glade (limited to 'smime/gui') diff --git a/smime/gui/.cvsignore b/smime/gui/.cvsignore deleted file mode 100644 index 61a0c160f1..0000000000 --- a/smime/gui/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -Makefile.in -smime-ui.gladep diff --git a/smime/gui/Makefile.am b/smime/gui/Makefile.am deleted file mode 100644 index a15fdade86..0000000000 --- a/smime/gui/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -INCLUDES = \ - -DG_LOG_DOMAIN=\"evolution-smime\" \ - -I$(top_srcdir) \ - -I$(top_srcdir)/smime/lib \ - -I$(top_srcdir)/shell \ - -I$(top_builddir) \ - -DEVOLUTION_DATADIR=\""$(datadir)"\" \ - -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ - -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ - -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ - -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ - -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \ - -DPREFIX=\""$(prefix)"\" \ - $(EVOLUTION_ADDRESSBOOK_CFLAGS) \ - $(CERT_UI_CFLAGS) - -noinst_LTLIBRARIES = libevolution-smime.la - -libevolution_smime_la_SOURCES = \ - certificate-manager.c \ - certificate-manager.h \ - certificate-viewer.c \ - certificate-viewer.h \ - e-cert-selector.c \ - e-cert-selector.h - -libevolution_smime_la_LIBADD = \ - $(top_builddir)/smime/lib/libessmime.la \ - $(CERT_UI_LIBS) - - -glade_DATA = smime-ui.glade - -EXTRA_DIST = \ - $(glade_DATA) diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c deleted file mode 100644 index d2ae5e4fea..0000000000 --- a/smime/gui/certificate-manager.c +++ /dev/null @@ -1,745 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Chris Toshok - * - * Copyright (C) 2003 Ximian, Inc. (www.ximian.com) - * - * 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 Street #330, Boston, MA 02111-1307, USA. - * - */ - -#define GLADE_FILE_NAME "smime-ui.glade" - -#include - -#include - -#include -#include "evolution-config-control.h" -#include "certificate-manager.h" -#include "certificate-viewer.h" - -#include "e-cert.h" -#include "e-cert-db.h" -#include "e-pkcs12.h" - -#include "nss.h" -#include -#include -#include -#include -#include - -typedef struct { - GladeXML *gui; - - GtkWidget *yourcerts_treeview; - GtkTreeStore *yourcerts_treemodel; - GHashTable *yourcerts_root_hash; - GtkWidget *view_your_button; - GtkWidget *backup_your_button; - GtkWidget *backup_all_your_button; - GtkWidget *import_your_button; - GtkWidget *delete_your_button; - - GtkWidget *contactcerts_treeview; - GtkTreeStore *contactcerts_treemodel; - GHashTable *contactcerts_root_hash; - GtkWidget *view_contact_button; - GtkWidget *edit_contact_button; - GtkWidget *import_contact_button; - GtkWidget *delete_contact_button; - - GtkWidget *authoritycerts_treeview; - GtkTreeStore *authoritycerts_treemodel; - GHashTable *authoritycerts_root_hash; - GtkWidget *view_ca_button; - GtkWidget *edit_ca_button; - GtkWidget *import_ca_button; - GtkWidget *delete_ca_button; - -} CertificateManagerData; - -typedef void (*AddCertCb)(CertificateManagerData *cfm, ECert *cert); - -static void unload_certs (CertificateManagerData *cfm, ECertType type); -static void load_certs (CertificateManagerData *cfm, ECertType type, AddCertCb add_cert); - -static void add_user_cert (CertificateManagerData *cfm, ECert *cert); -static void add_contact_cert (CertificateManagerData *cfm, ECert *cert); -static void add_ca_cert (CertificateManagerData *cfm, ECert *cert); - -static void -handle_selection_changed (GtkTreeSelection *selection, - int cert_column, - GtkWidget *view_button, - GtkWidget *edit_button, - GtkWidget *delete_button) -{ - GtkTreeIter iter; - gboolean cert_selected = FALSE; - GtkTreeModel *model; - - if (gtk_tree_selection_get_selected (selection, - &model, - &iter)) { - ECert *cert; - - gtk_tree_model_get (model, - &iter, - cert_column, &cert, - -1); - - if (cert) { - cert_selected = TRUE; - g_object_unref (cert); - } - } - - if (delete_button) - gtk_widget_set_sensitive (delete_button, cert_selected); - if (edit_button) - gtk_widget_set_sensitive (edit_button, cert_selected); - if (view_button) - gtk_widget_set_sensitive (view_button, cert_selected); -} - -static void -import_your (GtkWidget *widget, CertificateManagerData *cfm) -{ - GtkWidget *filesel = gtk_file_selection_new (_("Select a cert to import...")); - - if (GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (filesel))) { - const char *filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel)); - EPKCS12 *pkcs12 = e_pkcs12_new (); - - if (e_pkcs12_import_from_file (pkcs12, filename, NULL /* XXX */)) { - /* there's no telling how many certificates were added during the import, - so we blow away the contact cert display and regenerate it. */ - unload_certs (cfm, E_CERT_USER); - load_certs (cfm, E_CERT_USER, add_user_cert); - } - } - - gtk_widget_destroy (filesel); -} - -static void -yourcerts_selection_changed (GtkTreeSelection *selection, CertificateManagerData *cfm) -{ - handle_selection_changed (selection, - 4, - cfm->view_your_button, - cfm->backup_your_button, /* yes yes, not really "edit", it's a hack :) */ - cfm->delete_your_button); -} - -static void -initialize_yourcerts_ui (CertificateManagerData *cfm) -{ - GtkCellRenderer *cell = gtk_cell_renderer_text_new (); - GtkTreeSelection *selection; - - gtk_tree_view_append_column (GTK_TREE_VIEW (cfm->yourcerts_treeview), - gtk_tree_view_column_new_with_attributes (_("Certificate Name"), - cell, - "text", 0, - NULL)); - - gtk_tree_view_append_column (GTK_TREE_VIEW (cfm->yourcerts_treeview), - gtk_tree_view_column_new_with_attributes (_("Purposes"), - cell, - "text", 1, - NULL)); - - gtk_tree_view_append_column (GTK_TREE_VIEW (cfm->yourcerts_treeview), - gtk_tree_view_column_new_with_attributes (_("Serial Number"), - cell, - "text", 2, - NULL)); - - gtk_tree_view_append_column (GTK_TREE_VIEW (cfm->yourcerts_treeview), - gtk_tree_view_column_new_with_attributes (_("Expires"), - cell, - "text", 3, - NULL)); - - cfm->yourcerts_treemodel = gtk_tree_store_new (5, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_OBJECT); - - gtk_tree_view_set_model (GTK_TREE_VIEW (cfm->yourcerts_treeview), - GTK_TREE_MODEL (cfm->yourcerts_treemodel)); - - cfm->yourcerts_root_hash = g_hash_table_new (g_str_hash, g_str_equal); - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cfm->yourcerts_treeview)); - g_signal_connect (selection, "changed", G_CALLBACK (yourcerts_selection_changed), cfm); - - if (cfm->import_your_button) { - g_signal_connect (cfm->import_your_button, "clicked", G_CALLBACK (import_your), cfm); - } - - if (cfm->delete_your_button) { - /* g_signal_connect */ - } - - if (cfm->view_your_button) { - /* g_signal_connect */ - } - - if (cfm->backup_your_button) { - /* g_signal_connect */ - } - - if (cfm->backup_all_your_button) { - /* g_signal_connect */ - } -} - -static void -view_contact (GtkWidget *widget, CertificateManagerData *cfm) -{ - GtkTreeIter iter; - - if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW(cfm->contactcerts_treeview)), - NULL, - &iter)) { - ECert *cert; - - gtk_tree_model_get (GTK_TREE_MODEL (cfm->contactcerts_treemodel), - &iter, - 3, &cert, - -1); - - if (cert) - certificate_viewer_show (cert); - } -} - -static void -import_contact (GtkWidget *widget, CertificateManagerData *cfm) -{ - GtkWidget *filesel = gtk_file_selection_new (_("Select a cert to import...")); - - if (GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (filesel))) { - const char *filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel)); - - if (e_cert_db_import_certs_from_file (e_cert_db_peek (), - filename, - E_CERT_CONTACT, - NULL)) { - - /* there's no telling how many certificates were added during the import, - so we blow away the contact cert display and regenerate it. */ - unload_certs (cfm, E_CERT_CONTACT); - load_certs (cfm, E_CERT_CONTACT, add_contact_cert); - } - } - - gtk_widget_destroy (filesel); -} - -static void -delete_contact (GtkWidget *widget, CertificateManagerData *cfm) -{ - GtkTreeIter iter; - - if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW(cfm->contactcerts_treeview)), - NULL, - &iter)) { - ECert *cert; - - gtk_tree_model_get (GTK_TREE_MODEL (cfm->contactcerts_treemodel), - &iter, - 3, &cert, - -1); - - if (cert) { - printf ("DELETE\n"); - e_cert_db_delete_cert (e_cert_db_peek (), cert); - gtk_tree_store_remove (cfm->contactcerts_treemodel, - &iter); - - /* we need two unrefs here, one to unref the - gtk_tree_model_get above, and one to unref - the initial ref when we created the cert - and added it to the tree */ - g_object_unref (cert); - g_object_unref (cert); - } - } - -} - -static void -contactcerts_selection_changed (GtkTreeSelection *selection, CertificateManagerData *cfm) -{ - handle_selection_changed (selection, - 3, - cfm->view_contact_button, - cfm->edit_contact_button, - cfm->delete_contact_button); -} - -static GtkTreeStore* -create_contactcerts_treemodel (void) -{ - return gtk_tree_store_new (4, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_OBJECT); -} - -static void -initialize_contactcerts_ui (CertificateManagerData *cfm) -{ - GtkCellRenderer *cell = gtk_cell_renderer_text_new (); - GtkTreeSelection *selection; - - gtk_tree_view_append_column (GTK_TREE_VIEW (cfm->contactcerts_treeview), - gtk_tree_view_column_new_with_attributes (_("Certificate Name"), - cell, - "text", 0, - NULL)); - - gtk_tree_view_append_column (GTK_TREE_VIEW (cfm->contactcerts_treeview), - gtk_tree_view_column_new_with_attributes (_("E-Mail Address"), - cell, - "text", 1, - NULL)); - - gtk_tree_view_append_column (GTK_TREE_VIEW (cfm->contactcerts_treeview), - gtk_tree_view_column_new_with_attributes (_("Purposes"), - cell, - "text", 2, - NULL)); - - gtk_tree_view_set_model (GTK_TREE_VIEW (cfm->contactcerts_treeview), - GTK_TREE_MODEL (cfm->contactcerts_treemodel)); - - cfm->contactcerts_root_hash = g_hash_table_new (g_str_hash, g_str_equal); - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cfm->contactcerts_treeview)); - g_signal_connect (selection, "changed", G_CALLBACK (contactcerts_selection_changed), cfm); - - if (cfm->view_contact_button) - g_signal_connect (cfm->view_contact_button, "clicked", G_CALLBACK (view_contact), cfm); - - if (cfm->import_contact_button) - g_signal_connect (cfm->import_contact_button, "clicked", G_CALLBACK (import_contact), cfm); - - if (cfm->delete_contact_button) - g_signal_connect (cfm->delete_contact_button, "clicked", G_CALLBACK (delete_contact), cfm); - -} - -static gint -iter_string_compare (GtkTreeModel *model, - GtkTreeIter *a, - GtkTreeIter *b, - gpointer user_data) -{ - char *string1, *string2; - - gtk_tree_model_get (model, a, - 0, &string1, - -1); - - gtk_tree_model_get (model, b, - 0, &string2, - -1); - - return g_utf8_collate (string1, string2); -} - -static void -view_ca (GtkWidget *widget, CertificateManagerData *cfm) -{ - GtkTreeIter iter; - - if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW(cfm->authoritycerts_treeview)), - NULL, - &iter)) { - ECert *cert; - - gtk_tree_model_get (GTK_TREE_MODEL (cfm->authoritycerts_treemodel), - &iter, - 1, &cert, - -1); - - if (cert) - certificate_viewer_show (cert); - } -} - -static void -import_ca (GtkWidget *widget, CertificateManagerData *cfm) -{ - GtkWidget *filesel = gtk_file_selection_new (_("Select a cert to import...")); - - if (GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (filesel))) { - const char *filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel)); - - if (e_cert_db_import_certs_from_file (e_cert_db_peek (), - filename, - E_CERT_CA, - NULL)) { - - /* there's no telling how many certificates were added during the import, - so we blow away the CA cert display and regenerate it. */ - unload_certs (cfm, E_CERT_CA); - load_certs (cfm, E_CERT_CA, add_ca_cert); - } - } - - gtk_widget_destroy (filesel); -} - -static void -delete_ca (GtkWidget *widget, CertificateManagerData *cfm) -{ - GtkTreeIter iter; - - if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW(cfm->authoritycerts_treeview)), - NULL, - &iter)) { - ECert *cert; - - gtk_tree_model_get (GTK_TREE_MODEL (cfm->authoritycerts_treemodel), - &iter, - 1, &cert, - -1); - - if (cert) { - printf ("DELETE\n"); - e_cert_db_delete_cert (e_cert_db_peek (), cert); - gtk_tree_store_remove (cfm->authoritycerts_treemodel, - &iter); - - /* we need two unrefs here, one to unref the - gtk_tree_model_get above, and one to unref - the initial ref when we created the cert - and added it to the tree */ - g_object_unref (cert); - g_object_unref (cert); - } - } - -} - -static void -authoritycerts_selection_changed (GtkTreeSelection *selection, CertificateManagerData *cfm) -{ - handle_selection_changed (selection, - 1, - cfm->view_ca_button, - cfm->edit_ca_button, - cfm->delete_ca_button); -} - -static GtkTreeStore* -create_authoritycerts_treemodel (void) -{ - return gtk_tree_store_new (2, - G_TYPE_STRING, - G_TYPE_OBJECT); - -} - -static void -initialize_authoritycerts_ui (CertificateManagerData *cfm) -{ - GtkCellRenderer *cell = gtk_cell_renderer_text_new (); - GtkTreeSelection *selection; - - gtk_tree_view_append_column (GTK_TREE_VIEW (cfm->authoritycerts_treeview), - gtk_tree_view_column_new_with_attributes (_("Certificate Name"), - cell, - "text", 0, - NULL)); - - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (cfm->authoritycerts_treemodel), - 0, - iter_string_compare, NULL, NULL); - - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (cfm->authoritycerts_treemodel), - 0, - GTK_SORT_ASCENDING); - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cfm->authoritycerts_treeview)); - g_signal_connect (selection, "changed", G_CALLBACK (authoritycerts_selection_changed), cfm); - - if (cfm->view_ca_button) - g_signal_connect (cfm->view_ca_button, "clicked", G_CALLBACK (view_ca), cfm); - - if (cfm->import_ca_button) - g_signal_connect (cfm->import_ca_button, "clicked", G_CALLBACK (import_ca), cfm); - - if (cfm->delete_ca_button) - g_signal_connect (cfm->delete_ca_button, "clicked", G_CALLBACK (delete_ca), cfm); -} - -static void -add_user_cert (CertificateManagerData *cfm, ECert *cert) -{ - GtkTreeIter iter; - GtkTreeIter *parent_iter = NULL; - const char *organization = e_cert_get_org (cert); - - if (organization) { - parent_iter = g_hash_table_lookup (cfm->yourcerts_root_hash, organization); - if (!parent_iter) { - /* create a new toplevel node */ - gtk_tree_store_append (GTK_TREE_STORE (cfm->yourcerts_treemodel), &iter, NULL); - - gtk_tree_store_set (GTK_TREE_STORE (cfm->yourcerts_treemodel), &iter, - 0, organization, -1); - - /* now copy it off into parent_iter and insert it into - the hashtable */ - parent_iter = gtk_tree_iter_copy (&iter); - g_hash_table_insert (cfm->yourcerts_root_hash, g_strdup (organization), parent_iter); - } - } - - gtk_tree_store_append (GTK_TREE_STORE (cfm->yourcerts_treemodel), &iter, parent_iter); - - if (e_cert_get_cn (cert)) - gtk_tree_store_set (GTK_TREE_STORE (cfm->yourcerts_treemodel), &iter, - 0, e_cert_get_cn (cert), - 4, cert, - -1); - else - gtk_tree_store_set (GTK_TREE_STORE (cfm->yourcerts_treemodel), &iter, - 0, e_cert_get_nickname (cert), - 4, cert, - -1); -} - -static void -add_contact_cert (CertificateManagerData *cfm, ECert *cert) -{ - GtkTreeIter iter; - GtkTreeIter *parent_iter = NULL; - const char *organization = e_cert_get_org (cert); - - if (organization) { - parent_iter = g_hash_table_lookup (cfm->contactcerts_root_hash, organization); - if (!parent_iter) { - /* create a new toplevel node */ - gtk_tree_store_append (GTK_TREE_STORE (cfm->contactcerts_treemodel), &iter, NULL); - - gtk_tree_store_set (GTK_TREE_STORE (cfm->contactcerts_treemodel), &iter, - 0, organization, -1); - - /* now copy it off into parent_iter and insert it into - the hashtable */ - parent_iter = gtk_tree_iter_copy (&iter); - g_hash_table_insert (cfm->contactcerts_root_hash, g_strdup (organization), parent_iter); - } - } - - gtk_tree_store_append (GTK_TREE_STORE (cfm->contactcerts_treemodel), &iter, parent_iter); - - if (e_cert_get_cn (cert)) - gtk_tree_store_set (GTK_TREE_STORE (cfm->contactcerts_treemodel), &iter, - 0, e_cert_get_cn (cert), - 1, e_cert_get_email (cert), - 3, cert, - -1); - else - gtk_tree_store_set (GTK_TREE_STORE (cfm->contactcerts_treemodel), &iter, - 0, e_cert_get_nickname (cert), - 1, e_cert_get_email (cert), - 3, cert, - -1); -} - -static void -add_ca_cert (CertificateManagerData *cfm, ECert *cert) -{ - GtkTreeIter iter; - GtkTreeIter *parent_iter = NULL; - const char *organization = e_cert_get_org (cert); - - if (organization) { - parent_iter = g_hash_table_lookup (cfm->authoritycerts_root_hash, organization); - if (!parent_iter) { - /* create a new toplevel node */ - gtk_tree_store_append (GTK_TREE_STORE (cfm->authoritycerts_treemodel), &iter, NULL); - - gtk_tree_store_set (GTK_TREE_STORE (cfm->authoritycerts_treemodel), &iter, - 0, organization, -1); - - /* now copy it off into parent_iter and insert it into - the hashtable */ - parent_iter = gtk_tree_iter_copy (&iter); - g_hash_table_insert (cfm->authoritycerts_root_hash, g_strdup (organization), parent_iter); - } - } - - - gtk_tree_store_append (GTK_TREE_STORE (cfm->authoritycerts_treemodel), &iter, parent_iter); - - if (e_cert_get_cn (cert)) - gtk_tree_store_set (GTK_TREE_STORE (cfm->authoritycerts_treemodel), &iter, - 0, e_cert_get_cn (cert), - 1, cert, - -1); - else - gtk_tree_store_set (GTK_TREE_STORE (cfm->authoritycerts_treemodel), &iter, - 0, e_cert_get_nickname (cert), - 1, cert, - -1); -} - -static void -destroy_key (gpointer data) -{ - g_free (data); -} - -static void -destroy_value (gpointer data) -{ - gtk_tree_iter_free (data); -} - -static void -unload_certs (CertificateManagerData *cfm, - ECertType type) -{ - switch (type) { - case E_CERT_USER: - break; - case E_CERT_CONTACT: - cfm->contactcerts_treemodel = create_contactcerts_treemodel (); - gtk_tree_view_set_model (GTK_TREE_VIEW (cfm->contactcerts_treeview), - GTK_TREE_MODEL (cfm->contactcerts_treemodel)); - - if (cfm->contactcerts_root_hash) - g_hash_table_destroy (cfm->contactcerts_root_hash); - - cfm->contactcerts_root_hash = g_hash_table_new_full (g_str_hash, g_str_equal, - destroy_key, destroy_value); - break; - case E_CERT_SITE: - break; - case E_CERT_CA: - cfm->authoritycerts_treemodel = create_authoritycerts_treemodel (); - gtk_tree_view_set_model (GTK_TREE_VIEW (cfm->authoritycerts_treeview), - GTK_TREE_MODEL (cfm->authoritycerts_treemodel)); - - if (cfm->authoritycerts_root_hash) - g_hash_table_destroy (cfm->authoritycerts_root_hash); - - cfm->authoritycerts_root_hash = g_hash_table_new_full (g_str_hash, g_str_equal, - destroy_key, destroy_value); - - - break; - case E_CERT_UNKNOWN: - /* nothing to do here */ - break; - } -} - -static void -load_certs (CertificateManagerData *cfm, - ECertType type, - AddCertCb add_cert) -{ - CERTCertList *certList; - CERTCertListNode *node; - - certList = PK11_ListCerts (PK11CertListUnique, NULL); - - printf ("certList = %p\n", certList); - - for (node = CERT_LIST_HEAD(certList); - !CERT_LIST_END(node, certList); - node = CERT_LIST_NEXT(node)) { - ECert *cert = e_cert_new ((CERTCertificate*)node->cert); - if (e_cert_get_cert_type(cert) == type) { - printf ("cert (nickname = '%s') matches\n", e_cert_get_nickname (cert)); - add_cert (cfm, cert); - } - } - -} - -static void -populate_ui (CertificateManagerData *cfm) -{ - unload_certs (cfm, E_CERT_USER); - load_certs (cfm, E_CERT_USER, add_user_cert); - - unload_certs (cfm, E_CERT_CONTACT); - load_certs (cfm, E_CERT_CONTACT, add_contact_cert); - - unload_certs (cfm, E_CERT_CA); - load_certs (cfm, E_CERT_CA, add_ca_cert); -} - -EvolutionConfigControl* -certificate_manager_config_control_new (void) -{ - CertificateManagerData *cfm_data; - GtkWidget *control_widget; - - /* We need to peek the db here to make sure it (and NSS) are fully initialized. */ - e_cert_db_peek (); - - cfm_data = g_new0 (CertificateManagerData, 1); - cfm_data->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL, NULL); - - cfm_data->yourcerts_treeview = glade_xml_get_widget (cfm_data->gui, "yourcerts-treeview"); - cfm_data->contactcerts_treeview = glade_xml_get_widget (cfm_data->gui, "contactcerts-treeview"); - cfm_data->authoritycerts_treeview = glade_xml_get_widget (cfm_data->gui, "authoritycerts-treeview"); - - cfm_data->view_your_button = glade_xml_get_widget (cfm_data->gui, "your-view-button"); - cfm_data->backup_your_button = glade_xml_get_widget (cfm_data->gui, "your-backup-button"); - cfm_data->backup_all_your_button = glade_xml_get_widget (cfm_data->gui, "your-backup-all-button"); - cfm_data->import_your_button = glade_xml_get_widget (cfm_data->gui, "your-import-button"); - cfm_data->delete_your_button = glade_xml_get_widget (cfm_data->gui, "your-delete-button"); - - cfm_data->view_contact_button = glade_xml_get_widget (cfm_data->gui, "contact-view-button"); - cfm_data->edit_contact_button = glade_xml_get_widget (cfm_data->gui, "contact-edit-button"); - cfm_data->import_contact_button = glade_xml_get_widget (cfm_data->gui, "contact-import-button"); - cfm_data->delete_contact_button = glade_xml_get_widget (cfm_data->gui, "contact-delete-button"); - - cfm_data->view_ca_button = glade_xml_get_widget (cfm_data->gui, "authority-view-button"); - cfm_data->edit_ca_button = glade_xml_get_widget (cfm_data->gui, "authority-edit-button"); - cfm_data->import_ca_button = glade_xml_get_widget (cfm_data->gui, "authority-import-button"); - cfm_data->delete_ca_button = glade_xml_get_widget (cfm_data->gui, "authority-delete-button"); - - initialize_yourcerts_ui(cfm_data); - initialize_contactcerts_ui(cfm_data); - initialize_authoritycerts_ui(cfm_data); - - populate_ui (cfm_data); - - control_widget = glade_xml_get_widget (cfm_data->gui, "cert-manager-notebook"); - gtk_widget_ref (control_widget); - - gtk_container_remove (GTK_CONTAINER (control_widget->parent), control_widget); - - return evolution_config_control_new (control_widget); -} diff --git a/smime/gui/certificate-manager.h b/smime/gui/certificate-manager.h deleted file mode 100644 index ee2002b159..0000000000 --- a/smime/gui/certificate-manager.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Chris Toshok - * - * Copyright (C) 2003 Ximian, Inc. (www.ximian.com) - * - * 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 Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _CERTIFICATE_MANAGER_H_ -#define _CERTIFICATE_MANAGER_H - -#include "evolution-config-control.h" - -EvolutionConfigControl* certificate_manager_config_control_new (void); - -#endif /* _CERTIFICATE_MANAGER_H_ */ diff --git a/smime/gui/certificate-viewer.c b/smime/gui/certificate-viewer.c deleted file mode 100644 index 792ccab01a..0000000000 --- a/smime/gui/certificate-viewer.c +++ /dev/null @@ -1,298 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Chris Toshok - * - * Copyright (C) 2003 Ximian, Inc. (www.ximian.com) - * - * 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 Street #330, Boston, MA 02111-1307, USA. - * - */ - -#include "certificate-viewer.h" - -#include "e-asn1-object.h" - -#include - -#include -#include - -#define GLADE_FILE_NAME "smime-ui.glade" - -typedef struct { - GladeXML *gui; - GtkWidget *dialog; - GtkTreeStore *hierarchy_store, *fields_store; - GtkWidget *hierarchy_tree, *fields_tree; - GtkWidget *field_text; - - GList *cert_chain; -} CertificateViewerData; - -static void -free_data (gpointer data, GObject *where_the_object_was) -{ - CertificateViewerData *cvm = data; - - g_list_foreach (cvm->cert_chain, (GFunc)g_object_unref, NULL); - g_list_free (cvm->cert_chain); - - g_object_unref (cvm->gui); - g_free (cvm); -} - -static void -fill_in_general (CertificateViewerData *cvm_data, ECert *cert) -{ - CERTCertificate *mcert = e_cert_get_internal_cert (cert); - GtkWidget *label; - const char *text; - - /* issued to */ - if (e_cert_get_cn (cert)) { - label = glade_xml_get_widget (cvm_data->gui, "issued-to-cn"); - gtk_label_set_text (GTK_LABEL (label), e_cert_get_cn (cert)); - } - - if (e_cert_get_org (cert)) { - label = glade_xml_get_widget (cvm_data->gui, "issued-to-o"); - gtk_label_set_text (GTK_LABEL (label), e_cert_get_org (cert)); - } - - if (e_cert_get_org_unit (cert)) { - label = glade_xml_get_widget (cvm_data->gui, "issued-to-ou"); - gtk_label_set_text (GTK_LABEL (label), e_cert_get_org_unit (cert)); - } - - text = e_cert_get_serial_number (cert); - label = glade_xml_get_widget (cvm_data->gui, "issued-to-serial"); - gtk_label_set_text (GTK_LABEL (label), text); - - /* issued by */ - if (e_cert_get_issuer_cn (cert)) { - label = glade_xml_get_widget (cvm_data->gui, "issued-by-cn"); - gtk_label_set_text (GTK_LABEL (label), e_cert_get_issuer_cn (cert)); - } - - if (e_cert_get_issuer_org (cert)) { - label = glade_xml_get_widget (cvm_data->gui, "issued-by-o"); - gtk_label_set_text (GTK_LABEL (label), e_cert_get_issuer_org (cert)); - } - - if (e_cert_get_issuer_org_unit (cert)) { - label = glade_xml_get_widget (cvm_data->gui, "issued-by-ou"); - gtk_label_set_text (GTK_LABEL (label), e_cert_get_issuer_org_unit (cert)); - } - - /* validity */ - if (e_cert_get_issued_on (cert)) { - label = glade_xml_get_widget (cvm_data->gui, "validity-issued-on"); - gtk_label_set_text (GTK_LABEL (label), e_cert_get_issued_on (cert)); - } - - if (e_cert_get_expires_on (cert)) { - label = glade_xml_get_widget (cvm_data->gui, "validity-expires-on"); - gtk_label_set_text (GTK_LABEL (label), e_cert_get_expires_on (cert)); - } - - /* fingerprints */ - text = e_cert_get_sha1_fingerprint (cert); - label = glade_xml_get_widget (cvm_data->gui, "fingerprints-sha1"); - gtk_label_set_text (GTK_LABEL (label), text); - - text = e_cert_get_md5_fingerprint (cert); - label = glade_xml_get_widget (cvm_data->gui, "fingerprints-md5"); - gtk_label_set_text (GTK_LABEL (label), text); -} - -static void -populate_fields_tree (CertificateViewerData *cvm_data, EASN1Object *asn1, GtkTreeIter *root) -{ - GtkTreeIter new_iter; - - /* first insert a node for the current asn1 */ - gtk_tree_store_insert (cvm_data->fields_store, &new_iter, root, -1); - gtk_tree_store_set (cvm_data->fields_store, &new_iter, - 0, e_asn1_object_get_display_name (asn1), - 1, asn1, - -1); - - if (e_asn1_object_is_valid_container (asn1)) { - GList *children = e_asn1_object_get_children (asn1); - if (children) { - GList *l; - for (l = children; l; l = l->next) { - EASN1Object *subasn1 = l->data; - populate_fields_tree (cvm_data, subasn1, &new_iter); - } - } - g_list_foreach (children, (GFunc)g_object_unref, NULL); - g_list_free (children); - } -} - -static void -hierarchy_selection_changed (GtkTreeSelection *selection, CertificateViewerData *cvm_data) -{ - GtkTreeIter iter; - GtkTreeModel *model; - - if (gtk_tree_selection_get_selected (selection, - &model, - &iter)) { - EASN1Object *asn1_object; - ECert *cert; - - gtk_tree_model_get (model, - &iter, - 1, &cert, - -1); - - if (!cert) - return; - - /* display the cert's ASN1 structure */ - asn1_object = e_cert_get_asn1_struct (cert); - - /* wipe out the old model */ - cvm_data->fields_store = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); - gtk_tree_view_set_model (GTK_TREE_VIEW (cvm_data->fields_tree), - GTK_TREE_MODEL (cvm_data->fields_store)); - - /* populate the fields from the newly selected cert */ - populate_fields_tree (cvm_data, asn1_object, NULL); - gtk_tree_view_expand_all (GTK_TREE_VIEW (cvm_data->fields_tree)); - g_object_unref (asn1_object); - - /* and blow away the field value */ - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), - "", 0); - } -} - -static void -fields_selection_changed (GtkTreeSelection *selection, CertificateViewerData *cvm_data) -{ - GtkTreeIter iter; - GtkTreeModel *model; - - if (gtk_tree_selection_get_selected (selection, - &model, - &iter)) { - EASN1Object *asn1_object; - const char *value; - - gtk_tree_model_get (model, - &iter, - 1, &asn1_object, - -1); - - value = e_asn1_object_get_display_value (asn1_object); - - if (value) - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), - value, strlen (value)); - else - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)), - "", 0); - } -} - -static void -fill_in_details (CertificateViewerData *cvm_data, ECert *cert) -{ - GList *l; - GtkTreeIter *root = NULL; - GtkTreeSelection *selection; - - /* hook up all the hierarchy tree foo */ - cvm_data->hierarchy_store = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_OBJECT); - cvm_data->hierarchy_tree = glade_xml_get_widget (cvm_data->gui, "cert-hierarchy-treeview"); - gtk_tree_view_set_model (GTK_TREE_VIEW (cvm_data->hierarchy_tree), - GTK_TREE_MODEL (cvm_data->hierarchy_store)); - - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (cvm_data->hierarchy_tree), - -1, "Cert", gtk_cell_renderer_text_new(), - "text", 0, NULL); - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cvm_data->hierarchy_tree)); - g_signal_connect (selection, "changed", G_CALLBACK (hierarchy_selection_changed), cvm_data); - - /* hook up all the fields tree foo */ - cvm_data->fields_tree = glade_xml_get_widget (cvm_data->gui, "cert-fields-treeview"); - - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (cvm_data->fields_tree), - -1, "Field", gtk_cell_renderer_text_new(), - "text", 0, NULL); - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cvm_data->fields_tree)); - g_signal_connect (selection, "changed", G_CALLBACK (fields_selection_changed), cvm_data); - - /* hook up all the field display foo */ - cvm_data->field_text = glade_xml_get_widget (cvm_data->gui, "cert-field-value-textview"); - - /* initially populate the hierarchy from the cert's chain */ - cvm_data->cert_chain = e_cert_get_chain (cert); - cvm_data->cert_chain = g_list_reverse (cvm_data->cert_chain); - for (l = cvm_data->cert_chain; l; l = l->next) { - ECert *c = l->data; - const char *str; - GtkTreeIter new_iter; - - str = e_cert_get_cn (c); - if (!str) - str = e_cert_get_subject_name (c); - - gtk_tree_store_insert (cvm_data->hierarchy_store, &new_iter, root, -1); - gtk_tree_store_set (cvm_data->hierarchy_store, &new_iter, - 0, str, - 1, c, - -1); - - root = &new_iter; - } - - gtk_tree_view_expand_all (GTK_TREE_VIEW (cvm_data->hierarchy_tree)); -} - -GtkWidget* -certificate_viewer_show (ECert *cert) -{ - CertificateViewerData *cvm_data; - char *title; - - cvm_data = g_new0 (CertificateViewerData, 1); - cvm_data->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL, NULL); - - cvm_data->dialog = glade_xml_get_widget (cvm_data->gui, "certificate-viewer-dialog"); - - title = g_strdup_printf (_("Certificate Viewer: %s"), e_cert_get_window_title (cert)); - - gtk_window_set_title (GTK_WINDOW (cvm_data->dialog), - title); - - g_free (title); - - fill_in_general (cvm_data, cert); - fill_in_details (cvm_data, cert); - - g_object_weak_ref (G_OBJECT (cvm_data->dialog), free_data, cvm_data); - - g_signal_connect (cvm_data->dialog, "response", - G_CALLBACK (gtk_widget_destroy), NULL); - - gtk_widget_show (cvm_data->dialog); - return cvm_data->dialog; -} diff --git a/smime/gui/certificate-viewer.h b/smime/gui/certificate-viewer.h deleted file mode 100644 index ab60043a39..0000000000 --- a/smime/gui/certificate-viewer.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Chris Toshok - * - * Copyright (C) 2003 Ximian, Inc. (www.ximian.com) - * - * 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 Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _CERTIFICATE_VIEWER_H_ -#define _CERTIFICATE_VIEWER_H - -#include -#include "e-cert.h" - -GtkWidget* certificate_viewer_show (ECert *cert); - -#endif /* _CERTIFICATE_VIEWER_H_ */ diff --git a/smime/gui/e-cert-selector.c b/smime/gui/e-cert-selector.c deleted file mode 100644 index b3fcabdc43..0000000000 --- a/smime/gui/e-cert-selector.c +++ /dev/null @@ -1,247 +0,0 @@ - -/* Copyright 2003, Novell Inc. - * - * Author(s): Michael Zucchi - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * 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 - -#include - -#include -#include -#include -#include -#include - -#include "nss.h" -#include "pk11func.h" -#include "certdb.h" -#include "cert.h" - -#include - -#include "e-cert-selector.h" - -struct _ECertSelectorPrivate { - CERTCertList *certlist; - - GtkWidget *menu, *description; -}; - -enum { - ECS_SELECTED, - ECS_LAST_SIGNAL -}; - -static guint ecs_signals[ECS_LAST_SIGNAL]; - -static GtkDialog *ecs_parent_class; - -/* (this is what mozilla shows) -Issued to: - Subject: E=notzed@ximian.com, CN=notzed@ximian.com, O=My Company Ltd, L=Adelaide, ST=SA, C=AU - Serial Number: 03 - Valid from 23/10/03 06:35:29 to 22/10/04 06:35:29 - Purposes: Sign,Encrypt -Issued by: - Subject: E=notzed@ximian.com, O=company, L=there, ST=Here, C=AU -*/ - -static CERTCertListNode * -ecs_find_current(ECertSelector *ecs) -{ - struct _ECertSelectorPrivate *p = ecs->priv; - CERTCertListNode *node; - int n; - - if (CERT_LIST_EMPTY(p->certlist)) - return NULL; - - n = gtk_option_menu_get_history((GtkOptionMenu *)p->menu); - node = CERT_LIST_HEAD(p->certlist); - while (n>0 && !CERT_LIST_END(node, p->certlist)) { - n--; - node = CERT_LIST_NEXT(node); - } - - g_assert(!CERT_LIST_END(node, p->certlist)); - - return node; -} - -static void -ecs_response(GtkDialog *dialog, gint button) -{ - CERTCertListNode *node; - - switch (button) { - case GTK_RESPONSE_OK: - node = ecs_find_current((ECertSelector *)dialog); - break; - default: - node = NULL; - break; - } - - g_signal_emit(dialog, ecs_signals[ECS_SELECTED], 0, node?node->cert->nickname:NULL); -} - -static void -ecs_cert_changed(GtkWidget *w, ECertSelector *ecs) -{ - struct _ECertSelectorPrivate *p = ecs->priv; - CERTCertListNode *node; - GtkTextBuffer *buffer; - GString *text; - - text = g_string_new(""); - node = ecs_find_current(ecs); - if (node) { - /* FIXME: add serial no, validity date, uses */ - g_string_append_printf(text, _("Issued to:\n Subject: %s\n"), node->cert->subjectName); - g_string_append_printf(text, _("Issued by:\n Subject: %s\n"), node->cert->issuerName); - } - - buffer = gtk_text_view_get_buffer((GtkTextView *)p->description); - gtk_text_buffer_set_text(buffer, text->str, text->len); - g_string_free(text, TRUE); -} - -/** - * e_cert_selector_new: - * @type: - * @currentid: - * - * Create a new ECertSelector dialog. @type specifies which type of cert to - * be selected, E_CERT_SELECTOR_SIGNER for signing certs, and - * E_CERT_SELECTOR_RECIPIENT for encrypting certs. - * - * @currentid is the nickname of the cert currently selected for this user. - * - * You only need to connect to a single signal "selected" which will - * be called with either a NULL nickname if cancelled, or the newly - * selected nickname otherwise. - * - * Return value: A dialogue to be shown. - **/ -GtkWidget * -e_cert_selector_new(int type, const char *currentid) -{ - ECertSelector *ecs; - struct _ECertSelectorPrivate *p; - SECCertUsage usage; - CERTCertList *certlist; - CERTCertListNode *node; - GladeXML *gui; - GtkWidget *w, *menu; - int n=0, active=0; - - ecs = g_object_new(e_cert_selector_get_type(), NULL); - p = ecs->priv; - - gui = glade_xml_new(EVOLUTION_GLADEDIR "/smime-ui.glade", "cert_selector_vbox", NULL); - - p->menu = glade_xml_get_widget(gui, "cert_menu"); - p->description = glade_xml_get_widget(gui, "cert_description"); - - w = glade_xml_get_widget(gui, "cert_selector_vbox"); - gtk_box_pack_start((GtkBox *)((GtkDialog *)ecs)->vbox, w, TRUE, TRUE, 3); - - switch (type) { - case E_CERT_SELECTOR_SIGNER: - default: - usage = certUsageEmailSigner; - break; - case E_CERT_SELECTOR_RECIPIENT: - usage = certUsageEmailRecipient; - break; - } - - menu = gtk_menu_new(); - - certlist = CERT_FindUserCertsByUsage(CERT_GetDefaultCertDB(), usage, FALSE, TRUE, NULL); - ecs->priv->certlist = certlist; - node = CERT_LIST_HEAD(certlist); - while (!CERT_LIST_END(node, certlist)) { - w = gtk_menu_item_new_with_label(node->cert->nickname); - gtk_menu_shell_append((GtkMenuShell *)menu, w); - gtk_widget_show(w); - - if (currentid != NULL - && (strcmp(node->cert->nickname, currentid) == 0 - || strcmp(node->cert->emailAddr, currentid) == 0)) - active = n; - - n++; - node = CERT_LIST_NEXT(node); - } - - gtk_option_menu_set_menu((GtkOptionMenu *)p->menu, menu); - gtk_option_menu_set_history((GtkOptionMenu *)p->menu, active); - - g_signal_connect(p->menu, "changed", G_CALLBACK(ecs_cert_changed), ecs); - - g_object_unref(gui); - - ecs_cert_changed(p->menu, ecs); - - return GTK_WIDGET(ecs); -} - -static void -ecs_init(ECertSelector *ecs) -{ - gtk_dialog_add_buttons((GtkDialog *)ecs, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); - - ecs->priv = g_malloc0(sizeof(*ecs->priv)); -} - -static void -ecs_finalise(GObject *o) -{ - ECertSelector *ecs = (ECertSelector *)o; - - if (ecs->priv->certlist) - CERT_DestroyCertList(ecs->priv->certlist); - - g_free(ecs->priv); - - ((GObjectClass *)ecs_parent_class)->finalize(o); -} - -static void -ecs_class_init(ECertSelectorClass *klass) -{ - ecs_parent_class = g_type_class_ref(gtk_dialog_get_type()); - - ((GObjectClass *)klass)->finalize = ecs_finalise; - ((GtkDialogClass *)klass)->response = ecs_response; - - ecs_signals[ECS_SELECTED] = - g_signal_new("selected", - G_OBJECT_CLASS_TYPE(klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(ECertSelectorClass, selected), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); -} - -E_MAKE_TYPE(e_cert_selector, "ECertSelector", ECertSelector, ecs_class_init, ecs_init, gtk_dialog_get_type()) diff --git a/smime/gui/e-cert-selector.h b/smime/gui/e-cert-selector.h deleted file mode 100644 index 8919a3e916..0000000000 --- a/smime/gui/e-cert-selector.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-cert-selector.h - * - * Copyright (C) 2003 Novell Inc. - * - * Authors: Michael Zucchi - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * 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 E_CERT_SELECTOR_H -#define E_CERT_SELECTOR_H - -#include - -#ifdef cplusplus -extern "C" { -#pragma } -#endif /* cplusplus */ - -#define E_TYPE_CERT_SELECTOR (e_cert_selector_get_type ()) -#define E_CERT_SELECTOR(obj) (GTK_CHECK_CAST ((obj), E_TYPE_CERT_SELECTOR, ECertSelector)) -#define E_CERT_SELECTOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_CERT_SELECTOR, ECertSelectorClass)) -#define E_IS_CERT_SELECTOR(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_CERT_SELECTOR)) -#define E_IS_CERT_SELECTOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_CERT_SELECTOR)) - -typedef struct _ECertSelector ECertSelector; -typedef struct _ECertSelectorClass ECertSelectorClass; - -struct _ECertSelector { - GtkDialog parent; - - struct _ECertSelectorPrivate *priv; -}; - -struct _ECertSelectorClass { - GtkDialogClass parent_class; - - void (*selected)(ECertSelector *, const char *certid); -}; - -enum _e_cert_selector_type { - E_CERT_SELECTOR_SIGNER, - E_CERT_SELECTOR_RECIPIENT, -}; - -GtkType e_cert_selector_get_type (void); -GtkWidget *e_cert_selector_new (int type, const char *currentid); - -#ifdef cplusplus -} -#endif /* cplusplus */ - -#endif /* E_CERT_SELECTOR_H */ diff --git a/smime/gui/smime-ui.glade b/smime/gui/smime-ui.glade deleted file mode 100644 index 36966f7443..0000000000 --- a/smime/gui/smime-ui.glade +++ /dev/null @@ -1,2100 +0,0 @@ - - - - - - - dialog1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 12 - True - True - True - True - GTK_POS_TOP - False - False - - - - 6 - True - False - 6 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - 6 - True - False - 0 - - - - True - SSL Client Certificate - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - SSL Server Certificate - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Email Signer Certificate - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Email Recipient Certificate - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - True - <b>This certificate has been verified for the following uses:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - - - 0 - False - True - - - - - - 3 - True - 15 - 2 - False - 0 - 6 - - - - True - <b>Issued To</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 1 - 0 - 3 - - - 0 - 2 - 0 - 1 - fill - - - - - - - True - Common Name (CN) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 6 - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Organization (O) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 6 - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - Organizational Unit (OU) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 6 - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - Serial Number - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 6 - 0 - - - 0 - 1 - 4 - 5 - fill - - - - - - - True - Common Name (CN) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 6 - 0 - - - 0 - 1 - 6 - 7 - fill - - - - - - - True - Organization (O) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 6 - 0 - - - 0 - 1 - 7 - 8 - fill - - - - - - - True - Organizational Unit (OU) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 6 - 0 - - - 0 - 1 - 8 - 9 - fill - - - - - - - True - Issued On - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 6 - 0 - - - 0 - 1 - 10 - 11 - fill - - - - - - - True - Expires On - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 6 - 0 - - - 0 - 1 - 11 - 12 - fill - - - - - - - True - <b>Issued By</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 1 - 0 - 3 - - - 0 - 2 - 5 - 6 - fill - - - - - - - True - <b>Fingerprints</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 3 - - - 0 - 2 - 12 - 13 - fill - - - - - - - True - SHA1 Fingerprint - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 6 - 0 - - - 0 - 1 - 13 - 14 - fill - - - - - - - True - MD5 Fingerprint - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 6 - 0 - - - 0 - 1 - 14 - 15 - fill - - - - - - - True - True - <Not Part of Certificate> - False - False - GTK_JUSTIFY_LEFT - False - True - 0 - 0.5 - 0 - 0 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - True - <Not Part of Certificate> - False - False - GTK_JUSTIFY_LEFT - False - True - 0 - 0.5 - 0 - 0 - - - 1 - 2 - 3 - 4 - fill - - - - - - - True - True - <Not Part of Certificate> - False - False - GTK_JUSTIFY_LEFT - False - True - 0 - 0.5 - 0 - 0 - - - 1 - 2 - 4 - 5 - fill - - - - - - - True - True - <Not Part of Certificate> - False - False - GTK_JUSTIFY_LEFT - False - True - 0 - 0.5 - 0 - 0 - - - 1 - 2 - 6 - 7 - fill - - - - - - - True - True - <Not Part of Certificate> - False - False - GTK_JUSTIFY_LEFT - False - True - 0 - 0.5 - 0 - 0 - - - 1 - 2 - 7 - 8 - fill - - - - - - - True - True - <Not Part of Certificate> - False - False - GTK_JUSTIFY_LEFT - False - True - 0 - 0.5 - 0 - 0 - - - 1 - 2 - 8 - 9 - fill - - - - - - - True - True - <Not Part of Certificate> - False - False - GTK_JUSTIFY_LEFT - False - True - 0 - 0.5 - 0 - 0 - - - 1 - 2 - 10 - 11 - fill - - - - - - - True - True - <Not Part of Certificate> - False - False - GTK_JUSTIFY_LEFT - False - True - 0 - 0.5 - 0 - 0 - - - 1 - 2 - 11 - 12 - fill - - - - - - - True - True - <Not Part of Certificate> - False - False - GTK_JUSTIFY_LEFT - False - True - 0 - 0.5 - 0 - 0 - - - 1 - 2 - 13 - 14 - fill - - - - - - - True - True - <Not Part of Certificate> - False - False - GTK_JUSTIFY_LEFT - False - True - 0 - 0.5 - 0 - 0 - - - 1 - 2 - 14 - 15 - fill - - - - - - - True - True - <Not Part of Certificate> - False - False - GTK_JUSTIFY_LEFT - False - True - 0 - 0.5 - 0 - 0 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - <b>Validity</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 3 - - - 0 - 2 - 9 - 10 - fill - - - - - - 0 - False - True - - - - - False - True - - - - - - True - General - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - 6 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - - - - - - - - True - <b>Certificate Hierarchy</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - 6 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - - - - - - - - True - <b>Certificate Fields</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - 6 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_ETCHED_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - False - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - - True - <b>Field Value</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - label_item - - - - - 0 - False - True - - - - - False - True - - - - - - True - Details - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - 0 - True - True - - - - - - - - window1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - - - - True - True - True - True - GTK_POS_TOP - False - False - - - - 6 - True - False - 6 - - - - True - You have certificates from these organizations that identify you: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 6 - - - - True - False - True - True - View - True - GTK_RELIEF_NORMAL - - - - - - True - False - True - True - GTK_RELIEF_NORMAL - - - - True - 0.5 - 0.5 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-save - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Backup - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - - - - True - True - True - GTK_RELIEF_NORMAL - - - - True - 0.5 - 0.5 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-save - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Backup All - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - - - - True - True - True - Import - True - GTK_RELIEF_NORMAL - - - - - - True - False - True - True - gtk-delete - True - GTK_RELIEF_NORMAL - - - - - 0 - False - True - - - - - False - True - - - - - - True - Your Certificates - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - - 6 - True - False - 6 - - - - True - You have certificates on file that identify these people: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - False - True - True - View - True - GTK_RELIEF_NORMAL - - - - - - True - False - True - True - GTK_RELIEF_NORMAL - - - - True - 0.5 - 0.5 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-properties - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Edit - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - - - - True - True - True - Import - True - GTK_RELIEF_NORMAL - - - - - - True - False - True - True - gtk-delete - True - GTK_RELIEF_NORMAL - - - - - 0 - False - True - - - - - False - True - - - - - - True - Contact Certificates - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - - 6 - True - False - 6 - - - - True - You have certificates on file that identify these certificate authorities: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - False - True - True - View - True - GTK_RELIEF_NORMAL - - - - - - True - False - True - True - GTK_RELIEF_NORMAL - - - - True - 0.5 - 0.5 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-properties - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Edit - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - - - - True - True - True - Import - True - GTK_RELIEF_NORMAL - - - - - - True - False - True - True - gtk-delete - True - GTK_RELIEF_NORMAL - - - - - 0 - False - True - - - - - False - True - - - - - - True - Authorities - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - - - - Certificate Authority Trust - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - -6 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - You have been asked to trust a new Certificate Authority (CA). - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Do you want to trust "%s" for the following purposes? - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - True - Trust this CA to identify web sites. - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - - True - True - Trust this CA to identify email users. - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - - True - True - Trust this CA to identify software developers. - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - 0 - False - False - - - - - - True - Before trusting this CA for any purpose, you should examine its certificate and its policy and procedures (if available). - False - False - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - 0 - 0.5 - 0 - 1 - - - - True - True - View Certificate - True - GTK_RELIEF_NORMAL - - - - - 0 - False - False - - - - - - - - Dummy window only - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - - - - True - False - 0 - - - - 6 - True - False - 6 - - - - True - Certificate - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - True - -1 - - - 0 - False - False - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - 6 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - - True - Certificate details - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - label_item - - - - - 0 - True - True - - - - - - - -- cgit v1.2.3