aboutsummaryrefslogtreecommitdiffstats
path: root/em-format/e-mail-formatter-secure-button.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-12-12 02:48:07 +0800
committerMilan Crha <mcrha@redhat.com>2012-12-12 02:48:07 +0800
commit8a1eb1f24e2a4624d78d3eeb4ab563d9e48ec865 (patch)
treea1bc41f9d06c7206fc4ba9a217b356966a99a569 /em-format/e-mail-formatter-secure-button.c
parentc18043684137440e5853d5c952f89751148b6c24 (diff)
downloadgsoc2013-evolution-8a1eb1f24e2a4624d78d3eeb4ab563d9e48ec865.tar.gz
gsoc2013-evolution-8a1eb1f24e2a4624d78d3eeb4ab563d9e48ec865.tar.zst
gsoc2013-evolution-8a1eb1f24e2a4624d78d3eeb4ab563d9e48ec865.zip
Use the same certificate-viewer as the trust-prompt from eds
This way it'll be possible to copy whole files if change in one of them will be done. A real code reuse, rather than copy, would be ideal, but the trust-prompt is just a module for evolution-user-prompter.
Diffstat (limited to 'em-format/e-mail-formatter-secure-button.c')
-rw-r--r--em-format/e-mail-formatter-secure-button.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/em-format/e-mail-formatter-secure-button.c b/em-format/e-mail-formatter-secure-button.c
index f5f51d2242..2b61a74d93 100644
--- a/em-format/e-mail-formatter-secure-button.c
+++ b/em-format/e-mail-formatter-secure-button.c
@@ -27,7 +27,7 @@
#include <e-util/e-util.h>
#if defined (HAVE_NSS) && defined (ENABLE_SMIME)
-#include "certificate-viewer.h"
+#include "certificate-manager.h"
#include "e-cert-db.h"
#endif
@@ -101,7 +101,7 @@ emfe_secure_button_format (EMailFormatterExtension *extension,
#if defined (HAVE_NSS) && defined (ENABLE_SMIME)
static void
viewcert_clicked (GtkWidget *button,
- GtkWidget *parent)
+ GtkWidget *grid)
{
CamelCipherCertInfo *info = g_object_get_data ((GObject *) button, "e-cert-info");
ECert *ec = NULL;
@@ -110,18 +110,19 @@ viewcert_clicked (GtkWidget *button,
ec = e_cert_new (CERT_DupCertificate (info->cert_data));
if (ec != NULL) {
- GtkWidget *w = certificate_viewer_show (ec);
+ GtkWidget *dialog, *parent;
- /* oddly enough certificate_viewer_show doesn't ... */
- gtk_widget_show (w);
+ parent = gtk_widget_get_toplevel (grid);
+ if (!parent || !GTK_IS_WINDOW (parent))
+ parent = NULL;
+
+ dialog = e_cert_manager_new_certificate_viewer ((GtkWindow *) parent, ec);
+
+ gtk_widget_show (dialog);
g_signal_connect (
- w, "response",
+ dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
- if (w && parent)
- gtk_window_set_transient_for (
- (GtkWindow *) w, (GtkWindow *) parent);
-
g_object_unref (ec);
} else {
g_warning (