aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer-attachment-bar.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-10-10 08:10:02 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-10-10 08:10:02 +0800
commit45a3bf8c4557eea71a77afd8a6efcc01416ecdef (patch)
treef615af925957410ecf2f9c0bf82fc79c8726a7f6 /composer/e-msg-composer-attachment-bar.c
parentb457da9a980ac545fbb051bf6b7f80bfb070c867 (diff)
downloadgsoc2013-evolution-45a3bf8c4557eea71a77afd8a6efcc01416ecdef.tar.gz
gsoc2013-evolution-45a3bf8c4557eea71a77afd8a6efcc01416ecdef.tar.zst
gsoc2013-evolution-45a3bf8c4557eea71a77afd8a6efcc01416ecdef.zip
If the attachment fails, report the error to the user.
2001-10-09 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer-attachment-bar.c (add_from_file): If the attachment fails, report the error to the user. * e-msg-composer-attachment.c (e_msg_composer_attachment_new): Now takes a CamelException argument. svn path=/trunk/; revision=13537
Diffstat (limited to 'composer/e-msg-composer-attachment-bar.c')
-rw-r--r--composer/e-msg-composer-attachment-bar.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c
index 259d1709ec..14b0b39588 100644
--- a/composer/e-msg-composer-attachment-bar.c
+++ b/composer/e-msg-composer-attachment-bar.c
@@ -31,6 +31,8 @@
#include <libgnomeui/gnome-app.h>
#include <libgnomeui/gnome-app-helper.h>
#include <libgnomeui/gnome-popup-menu.h>
+#include <libgnomeui/gnome-dialog-util.h>
+#include <libgnomeui/gnome-dialog.h>
#include <glade/glade.h>
#include <libgnomevfs/gnome-vfs-mime-info.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
@@ -145,17 +147,17 @@ add_common (EMsgComposerAttachmentBar *bar,
EMsgComposerAttachment *attachment)
{
g_return_if_fail (attachment != NULL);
-
+
gtk_signal_connect (GTK_OBJECT (attachment), "changed",
GTK_SIGNAL_FUNC (attachment_changed_cb),
bar);
-
+
bar->priv->attachments = g_list_append (bar->priv->attachments,
attachment);
bar->priv->num_attachments++;
-
+
update (bar);
-
+
gtk_signal_emit (GTK_OBJECT (bar), signals[CHANGED]);
}
@@ -168,10 +170,28 @@ add_from_mime_part (EMsgComposerAttachmentBar *bar,
static void
add_from_file (EMsgComposerAttachmentBar *bar,
- const gchar *file_name,
- const gchar *disposition)
+ const char *file_name,
+ const char *disposition)
{
- add_common (bar, e_msg_composer_attachment_new (file_name, disposition));
+ EMsgComposerAttachment *attachment;
+ EMsgComposer *composer;
+ CamelException ex;
+ GtkWidget *dialog;
+
+ camel_exception_init (&ex);
+ attachment = e_msg_composer_attachment_new (file_name, disposition, &ex);
+ if (attachment) {
+ add_common (bar, attachment);
+ } else {
+ composer = E_MSG_COMPOSER (gtk_widget_get_toplevel (GTK_WIDGET (bar)));
+
+ 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);
+ }
}
static void