Face's are also saved from here: complete last commit
[claws.git] / src / headerview.c
index 7880d2540bb76aa79ebff6180b4b9aca1a471652..5e45a09a79141df647f2e80dba8f2852fe9e1e6e 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2020 the Claws Mail team and Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 #ifdef HAVE_CONFIG_H
@@ -38,7 +37,6 @@
 #include "codeconv.h"
 #include "gtkutils.h"
 #include "utils.h"
-#include "base64.h"
 #include "headers.h"
 #include "addrindex.h"
 #include "hooks.h"
@@ -102,11 +100,11 @@ HeaderView *headerview_create(void)
        gtk_label_set_selectable(GTK_LABEL(subject_body_label), TRUE);
        gtk_label_set_selectable(GTK_LABEL(tags_body_label), TRUE);
 
-       gtkut_widget_set_can_focus(from_body_label, FALSE);
-       gtkut_widget_set_can_focus(to_body_label, FALSE);
-       gtkut_widget_set_can_focus(ng_body_label, FALSE);
-       gtkut_widget_set_can_focus(subject_body_label, FALSE);
-       gtkut_widget_set_can_focus(tags_body_label, FALSE);
+       gtk_widget_set_can_focus(from_body_label, FALSE);
+       gtk_widget_set_can_focus(to_body_label, FALSE);
+       gtk_widget_set_can_focus(ng_body_label, FALSE);
+       gtk_widget_set_can_focus(subject_body_label, FALSE);
+       gtk_widget_set_can_focus(tags_body_label, FALSE);
 
        gtk_box_pack_start(GTK_BOX(hbox1), from_header_label, FALSE, FALSE, 0);
        gtk_box_pack_start(GTK_BOX(hbox1), from_body_label, FALSE, FALSE, 0);
@@ -226,7 +224,6 @@ static gint headerview_show_avatar (HeaderView *headerview, MsgInfo *msginfo)
 {
        AvatarRender *avatarr = avatars_avatarrender_new(msginfo);
        GtkWidget *hbox = headerview->hbox;
-       GtkWidget *image;
 
        hooks_invoke(AVATAR_IMAGE_RENDER_HOOKLIST, avatarr);
 
@@ -256,13 +253,14 @@ static gint headerview_show_avatar (HeaderView *headerview, MsgInfo *msginfo)
        avatarr->image = NULL; /* avoid destroying */
        avatars_avatarrender_free(avatarr);
 
-       headerview_save_contact_pic(headerview, msginfo);
+       if (prefs_common.save_xface)
+               headerview_save_contact_pic(headerview, msginfo);
        return 0;
 }
 
 static void headerview_save_contact_pic (HeaderView *headerview, MsgInfo *msginfo)
 {
-#ifndef USE_NEW_ADDRBOOK
+#ifndef USE_ALT_ADDRBOOK
        gchar *filename = NULL;
        GError *error = NULL;
        GdkPixbuf *picture = NULL;
@@ -279,7 +277,7 @@ static void headerview_save_contact_pic (HeaderView *headerview, MsgInfo *msginf
        if (!is_file_exist(filename)) {
                gdk_pixbuf_save(picture, filename, "png", &error, NULL);
                if (error) {
-                       g_warning(_("Failed to save image: \n%s"),
+                       g_warning("Failed to save image: %s",
                                        error->message);
                        g_error_free(error);
                }
@@ -292,7 +290,7 @@ static void headerview_save_contact_pic (HeaderView *headerview, MsgInfo *msginf
 
 static gint headerview_show_contact_pic (HeaderView *headerview, MsgInfo *msginfo)
 {
-#ifndef USE_NEW_ADDRBOOK
+#ifndef USE_ALT_ADDRBOOK
        GtkWidget *hbox = headerview->hbox;
        GtkWidget *image;
        gchar *filename = NULL;
@@ -325,7 +323,7 @@ static gint headerview_show_contact_pic (HeaderView *headerview, MsgInfo *msginf
 
        g_free(filename);
        if (error) {
-               debug_print("Failed to import image: \n%s",
+               debug_print("Failed to import image: %s\n",
                                error->message);
                g_error_free(error);
                return -1;