* src/mimeview.c
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 19 Jan 2003 16:04:36 +0000 (16:04 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 19 Jan 2003 16:04:36 +0000 (16:04 +0000)
mimeview_save_all(): display name of file before overwriting;
continue saving all, even when one overwrite was cancelled

ChangeLog.claws
configure.ac
src/mimeview.c

index 32bd942..1f561f0 100644 (file)
@@ -1,3 +1,9 @@
+2003-01-19 [alfons]    0.8.8claws120
+
+       * src/mimeview.c
+               mimeview_save_all(): display name of file before overwriting;
+               continue saving all, even when one overwrite was cancelled
+
 2003-01-19 [christoph] 0.8.8claws119
 
        * src/summaryview.c
index 92ede62..b32d24d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws119
+EXTRA_VERSION=claws120
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 03d31a6..cb8db9c 100644 (file)
@@ -812,13 +812,14 @@ static void mimeview_save_all(MimeView *mimeview)
        /* return to first children */
        attachment = partinfo->parent->children->next;
        /* for each attachment, extract it in the selected dir. */
-       while(attachment != NULL)
-       {
+       while (attachment != NULL) {
                static guint subst_cnt = 1;
                gchar *attachdir;
                gchar *attachname = (attachment->filename)
                        ? g_strdup(attachment->filename)
                        : g_strdup_printf("noname.%d",subst_cnt++);
+               AlertValue aval;
+               gchar *res;
 
                subst_chars(attachname, "/\\", G_DIR_SEPARATOR);
                subst_chars(attachname, ":?*&|<>\t\r\n", '_');
@@ -830,17 +831,17 @@ static void mimeview_save_all(MimeView *mimeview)
                attachdir = g_dirname(buf);
                make_dir_hier(attachdir);
                g_free(attachdir);
-               g_free(attachname);
 
                if (is_file_exist(buf)) {
-                       AlertValue aval;
-
-                       aval = alertpanel(_("Overwrite"),
-                                         _("Overwrite existing file?"),
-                                         _("OK"), _("Cancel"), NULL);
-                       if (G_ALERTDEFAULT != aval) return;
+                       res = g_strdup_printf(_("Overwrite existing file '%s'?"),
+                                             attachname);
+                       aval = alertpanel(_("Overwrite"), res, _("OK"), 
+                                         _("Cancel"), NULL);
+                       g_free(res);                                      
                }
-               if (procmime_get_part(buf, mimeview->file, attachment) < 0)
+               g_free(attachname);
+
+               if (G_ALERTDEFAULT == aval && procmime_get_part(buf, mimeview->file, attachment) < 0)
                        alertpanel_error(_("Can't save the part of multipart message."));
                attachment = attachment->next;
        }