Included save_all patch from Xaview FACQ
authorThorsten Maerz <torte@netztorte.de>
Sun, 21 Jul 2002 16:06:50 +0000 (16:06 +0000)
committerThorsten Maerz <torte@netztorte.de>
Sun, 21 Jul 2002 16:06:50 +0000 (16:06 +0000)
ChangeLog.claws
TODO.claws
configure.in
src/mimeview.c

index 596fc569017236bc82c5f0fa6125278d105141ea..1a82037feac59c1e2310ca578706a70c00b68144 100644 (file)
@@ -1,3 +1,10 @@
+2002-07-21 [thorsten]  0.7.8claws89
+
+       * src/mimeview.c
+               Included save_all patch from Xaview FACQ
+               added support for pathnames
+
+       
 2002-07-21 [alfons]    0.7.8claws88
 
        * po/POTFILES.in
 2002-07-21 [alfons]    0.7.8claws88
 
        * po/POTFILES.in
index e0784af3f7802bfc920e7dae17f539d96a9f29bd..b068037c11b36779fb1d0d1c437395611364a9a4 100644 (file)
          Hiro to accept the new system too)
        o fix processing, summaryview still uses old list of
          messages with messages deleted or moved by processing
          Hiro to accept the new system too)
        o fix processing, summaryview still uses old list of
          messages with messages deleted or moved by processing
+
+[thorsten]
+       
+0.8.0claws+
+       o common dialog for save / save all attachments
+
+win32 0.8.0claws+
+       o LDAP support
+       o Pspell support
+       o implement pipe actions
+       o fix addrbook crash
+       o review utf8 conversions for mem leaks
+       ? imap : use buffer instead of MSG_PEEK
index dce706777ed0bec9c8457516caa4b62eb4d00270..258060437a388a3742709f69d507536906d33ee9 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws88
+EXTRA_VERSION=claws89
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 4111804d7bfbd59f99e3c8e8b777d664373d3f77..2fe0feadd7e64c9c5e3974afa6a327c4288847ac 100644 (file)
@@ -102,6 +102,7 @@ static void mimeview_drag_data_get      (GtkWidget    *widget,
 static void mimeview_display_as_text   (MimeView       *mimeview);
 static void mimeview_show_image                (MimeView       *mimeview);
 static void mimeview_save_as           (MimeView       *mimeview);
 static void mimeview_display_as_text   (MimeView       *mimeview);
 static void mimeview_show_image                (MimeView       *mimeview);
 static void mimeview_save_as           (MimeView       *mimeview);
+static void mimeview_save_all          (MimeView       *mimeview);
 static void mimeview_launch            (MimeView       *mimeview);
 static void mimeview_open_with         (MimeView       *mimeview);
 static void mimeview_view_file         (const gchar    *filename,
 static void mimeview_launch            (MimeView       *mimeview);
 static void mimeview_open_with         (MimeView       *mimeview);
 static void mimeview_view_file         (const gchar    *filename,
@@ -117,7 +118,8 @@ static GtkItemFactoryEntry mimeview_popup_entries[] =
        {N_("/Open _with..."),    NULL, mimeview_open_with,       0, NULL},
        {N_("/_Display as text"), NULL, mimeview_display_as_text, 0, NULL},
        {N_("/_Display image"),   NULL, mimeview_show_image,      0, NULL},
        {N_("/Open _with..."),    NULL, mimeview_open_with,       0, NULL},
        {N_("/_Display as text"), NULL, mimeview_display_as_text, 0, NULL},
        {N_("/_Display image"),   NULL, mimeview_show_image,      0, NULL},
-       {N_("/_Save as..."),      NULL, mimeview_save_as,         0, NULL}
+       {N_("/_Save as..."),      NULL, mimeview_save_as,         0, NULL},
+       {N_("/Save _all..."),     NULL, mimeview_save_all,        0, NULL}
 #if USE_GPGME
         ,
         {N_("/_Check signature"), NULL, mimeview_check_signature, 0, NULL}
 #if USE_GPGME
         ,
         {N_("/_Check signature"), NULL, mimeview_check_signature, 0, NULL}
@@ -790,6 +792,66 @@ static void mimeview_drag_data_get(GtkWidget           *widget,
        g_free(filename);
 }
 
        g_free(filename);
 }
 
+static void mimeview_save_all(MimeView *mimeview)
+{
+       gchar *dirname;
+       gchar *defname = NULL;
+       MimeInfo *partinfo;
+       MimeInfo *attachment;
+       gchar buf[1024];
+
+       if (!mimeview->opened) return;
+       if (!mimeview->file) return;
+
+       partinfo = gtk_ctree_node_get_row_data
+               (GTK_CTREE(mimeview->ctree), mimeview->opened);
+
+       g_return_if_fail(partinfo != NULL);
+
+       dirname = filesel_select_file(_("Save as"), defname);
+
+       if (!dirname) return;
+
+       /* return to first children */
+       attachment = partinfo->parent->children->next;
+
+       /* for each attachment, extract it in the selected dir. */
+       while(attachment != NULL)
+       {
+               if(attachment->filename)
+               {
+                       gchar *attachname = g_strdup(attachment->filename);
+
+                       subst_chars(attachname, "/\\", G_DIR_SEPARATOR);
+                       subst_chars(attachname, ":?*&|<>\t\r\n", '_');
+                       g_snprintf(buf, sizeof(buf), "%s%s",
+                                       dirname,
+                                       (attachname[0] == G_DIR_SEPARATOR)
+                                       ? &attachname[1]
+                                       : attachname );
+                       g_free(attachname);
+                       make_dir_hier(g_dirname(buf));
+
+                       if (is_file_exist(buf))
+                       {
+                               AlertValue aval;
+
+                               aval = alertpanel(_("Overwrite"),
+                                               _("Overwrite existing file?"),
+                                               _("OK"), _("Cancel"), NULL);
+
+                               if (G_ALERTDEFAULT != aval) return;
+                       }
+
+                       if (procmime_get_part(buf, mimeview->file, attachment) < 0)
+                               alertpanel_error
+                                       (_("Can't save the part of multipart message."));
+               }
+
+               attachment = attachment->next;
+       }
+}
+
 static void mimeview_display_as_text(MimeView *mimeview)
 {
        MimeInfo *partinfo;
 static void mimeview_display_as_text(MimeView *mimeview)
 {
        MimeInfo *partinfo;