diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-02-20 08:42:28 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-02-20 08:42:28 +0800 |
commit | 8c481ff34db2c7229db6a4c6105f6caa88f5211d (patch) | |
tree | 87af892f2ea8d09f0deca26fa2957212bf582840 /composer/e-msg-composer.c | |
parent | 72bc2233d228d6313a52c6a43e6a22c63067b954 (diff) | |
download | gsoc2013-evolution-8c481ff34db2c7229db6a4c6105f6caa88f5211d.tar gsoc2013-evolution-8c481ff34db2c7229db6a4c6105f6caa88f5211d.tar.gz gsoc2013-evolution-8c481ff34db2c7229db6a4c6105f6caa88f5211d.tar.bz2 gsoc2013-evolution-8c481ff34db2c7229db6a4c6105f6caa88f5211d.tar.lz gsoc2013-evolution-8c481ff34db2c7229db6a4c6105f6caa88f5211d.tar.xz gsoc2013-evolution-8c481ff34db2c7229db6a4c6105f6caa88f5211d.tar.zst gsoc2013-evolution-8c481ff34db2c7229db6a4c6105f6caa88f5211d.zip |
Handle exceptions a little nicer and pop up a nice GnomeDialog with the
2001-02-19 Jeffrey Stedfast <fejj@ximian.com>
* e-msg-composer.c (build_message): Handle exceptions a little
nicer and pop up a nice GnomeDialog with the error message - also,
don't return a CamelMimeMessage if it fails to sign/decrypt
because we want to let the user decide what to do based on the
error message he/she gets.
svn path=/trunk/; revision=8296
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r-- | composer/e-msg-composer.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index da370614cd..aa13d442ca 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -245,6 +245,7 @@ build_message (EMsgComposer *composer) CamelMultipart *body = NULL; CamelMimePart *part; gboolean plain_e8bit = FALSE, html_e8bit = FALSE; + CamelException ex; char *html = NULL, *plain = NULL; char *content_type = NULL; int i; @@ -411,9 +412,10 @@ build_message (EMsgComposer *composer) } } + camel_exception_init (&ex); + if (composer->pgp_sign) { /* FIXME: should use the PGP key id rather than email address */ - CamelException ex; const char *pgpid; camel_exception_init (&ex); @@ -422,16 +424,14 @@ build_message (EMsgComposer *composer) pgp_mime_part_sign (&part, pgpid, PGP_HASH_TYPE_SHA1, &ex); camel_object_unref (CAMEL_OBJECT (from)); - if (camel_exception_is_set (&ex)) { - g_warning ("EEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKK!!!"); - } + if (camel_exception_is_set (&ex)) + goto exception; } if (composer->pgp_encrypt) { /* FIXME: recipients should be an array of key ids rather than email addresses */ const CamelInternetAddress *addr; const char *address; - CamelException ex; GPtrArray *recipients; int i, len; @@ -463,9 +463,8 @@ build_message (EMsgComposer *composer) for (i = 0; i < recipients->len; i++) g_free (recipients->pdata[i]); g_ptr_array_free (recipients, TRUE); - if (camel_exception_is_set (&ex)) { - g_warning ("EEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKK!!!"); - } + if (camel_exception_is_set (&ex)) + goto exception; } camel_medium_set_content_object (CAMEL_MEDIUM (new), @@ -473,6 +472,22 @@ build_message (EMsgComposer *composer) camel_object_unref (CAMEL_OBJECT (part)); return new; + + exception: + + camel_object_unref (CAMEL_OBJECT (part)); + camel_object_unref (CAMEL_OBJECT (new)); + + if (camel_exception_is_set (&ex)) { + GtkWidget *dialog; + + dialog = gnome_error_dialog_parented (camel_exception_get_description (&ex), + GTK_WINDOW (composer)); + gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + camel_exception_clear (&ex); + } + + return NULL; } static char * |