Move all colors into an array
[claws.git] / src / gtk / about.c
index 8d7c99162d91d88c81a1d1c15e6d9f96317dd960..d7dfbd158e828f35c8282fc218cbee168433aed1 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2017 Hiroyuki Yamamoto and the Claws Mail team
  *
  * 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
  *
  * 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
 #  include "config.h"
+#include "claws-features.h"
 #endif
 
 #include "defs.h"
 #include "codeconv.h"
 #include "menu.h"
 #include "textview.h"
+#include "main.h"
+
+extern SessionStats session_stats;
+static GtkTextBuffer *stats_text_buffer;
 
 static GtkWidget *window;
 static gchar* uri_hover = NULL;
@@ -64,6 +68,7 @@ static gboolean about_textview_leave_notify(GtkWidget *widget,
 static void about_size_allocate_cb(GtkWidget *widget,
                                        GtkAllocation *allocation);
 static void about_textview_uri_update(GtkWidget *textview, gint x, gint y);
+static void about_update_stats(void);
 
 static GtkWidget *link_popupmenu;
 
@@ -72,11 +77,15 @@ void about_show(void)
 {
        if (!window)
                about_create();
-       else 
+       else {
+               about_update_stats();
                gtk_window_present(GTK_WINDOW(window));
+       }
        
 }
 
+#define ADD_TEXT(text) gtk_text_buffer_insert(buffer, &iter, text, -1)
+
 static GtkWidget *about_create_child_page_info(void)
 {
        GtkWidget *scrolledwin;
@@ -109,7 +118,7 @@ static GtkWidget *about_create_child_page_info(void)
        gtk_text_buffer_get_iter_at_offset(buffer, &iter, 0);
 
        /* textview link style (based upon main prefs) */
-       gtkut_convert_int_to_gdk_color(prefs_common.uri_col,
+       gtkut_convert_int_to_gdk_color(prefs_common.color[COL_URI],
                                (GdkColor*)&uri_color);
        tag = gtk_text_buffer_create_tag(buffer, "link",
                                "foreground-gdk", &uri_color,
@@ -120,18 +129,25 @@ static GtkWidget *about_create_child_page_info(void)
                                "underline", PANGO_UNDERLINE_SINGLE,
                                NULL);
 
-       gtk_text_buffer_insert(buffer, &iter, _(
-                               "Claws Mail is a lightweight, fast and "
-                               "highly-configurable email client.\n\n"
-                               "For further information visit the Claws Mail "
-                               "website:\n"), -1);
+       ADD_TEXT(_("Claws Mail is a lightweight, fast and highly-configurable "
+                               "email client."));
+       ADD_TEXT("\n\n");
+       ADD_TEXT(_("For further information visit the Claws Mail website:"));
+       ADD_TEXT("\n");
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, HOMEPAGE_URI, -1,
                                "link", NULL);
-       gtk_text_buffer_insert(buffer, &iter, _("\n\n"
-                               "Claws Mail is free software released "
+       ADD_TEXT("\n\n");
+       ADD_TEXT(_("For support and discussion subscribe to the Claws Mail "
+                               "users' mailing list:"));
+       ADD_TEXT("\n");
+       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, USERS_ML_URI, -1,
+                               "link", NULL);
+       ADD_TEXT("\n\n");
+       ADD_TEXT(_("Claws Mail is free software released "
                                "under the GPL. If you wish to donate "
                                "to the Claws Mail project you can do "
-                               "so at:\n"), -1);
+                               "so at:"));
+       ADD_TEXT("\n");
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, DONATE_URI, -1,
                                "link", NULL);
 
@@ -142,37 +158,38 @@ static GtkWidget *about_create_child_page_info(void)
                                "underline", PANGO_UNDERLINE_SINGLE,
                                NULL);
 #ifdef GENERIC_UMPC
-       gtk_text_buffer_insert(buffer, &iter, _(
-                               "\n\nCopyright (C) 1999-2011\nThe Claws Mail Team\n"
-                               " and Hiroyuki Yamamoto"), -1);
+       ADD_TEXT("\n\n");
+       ADD_TEXT(_("Copyright (C) 1999-2017\nThe Claws Mail Team\n"
+                               "and Hiroyuki Yamamoto"));
 #endif
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("\n\nSystem Information\n")), -1,
-                       "underlined-list-title", NULL);
+       ADD_TEXT("\n\n");
+       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter,
+                       (_("System Information\n")), -1, "underlined-list-title", NULL);
 
 #if HAVE_SYS_UTSNAME_H
        uname(&utsbuf);
-       g_snprintf(buf, sizeof(buf),
-                  _("GTK+ %d.%d.%d / GLib %d.%d.%d\n"
-                    "Locale: %s (charset: %s)\n"
-                    "Operating System: %s %s (%s)"),
+       g_snprintf(buf, sizeof(buf),g_strconcat(
+                      "GTK+ %d.%d.%d / GLib %d.%d.%d\n",
+                    _("Locale: %s (charset: %s)\n"
+                    "Operating System: %s %s (%s)"), NULL),
                   gtk_major_version, gtk_minor_version, gtk_micro_version,
                   glib_major_version, glib_minor_version, glib_micro_version,
                   conv_get_current_locale(), conv_get_locale_charset_str(),
                   utsbuf.sysname, utsbuf.release, utsbuf.machine);
 #elif defined(G_OS_WIN32)
-       g_snprintf(buf, sizeof(buf),
-                  _("GTK+ %d.%d.%d / GLib %d.%d.%d\n"
-                    "Locale: %s (charset: %s)\n"
-                    "Operating System: %s"),
+       g_snprintf(buf, sizeof(buf),g_strconcat(
+                      "GTK+ %d.%d.%d / GLib %d.%d.%d\n",
+                    _("Locale: %s (charset: %s)\n"
+                    "Operating System: %s"), NULL),
                   gtk_major_version, gtk_minor_version, gtk_micro_version,
                   glib_major_version, glib_minor_version, glib_micro_version,
                   conv_get_current_locale(), conv_get_locale_charset_str(),
                   "Win32");
 #else
-       g_snprintf(buf, sizeof(buf),
-                  _("GTK+ %d.%d.%d / GLib %d.%d.%d\n"
-                    "Locale: %s (charset: %s)\n"
-                    "Operating System: unknown"),
+       g_snprintf(buf, sizeof(buf),g_strconcat(
+                      "GTK+ %d.%d.%d / GLib %d.%d.%d\n",
+                    _("Locale: %s (charset: %s)\n"
+                    "Operating System: unknown"), NULL),
                   gtk_major_version, gtk_minor_version, gtk_micro_version,
                   glib_major_version, glib_minor_version, glib_micro_version,
                   conv_get_current_locale(), conv_get_locale_charset_str());
@@ -180,8 +197,7 @@ static GtkWidget *about_create_child_page_info(void)
 
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, buf, -1,
                                                 "indented-list-item", NULL);
-
-       gtk_text_buffer_insert(buffer, &iter, "\n", -1);
+       ADD_TEXT("\n");
 
        g_signal_connect(G_OBJECT(tag), "event",
                                G_CALLBACK(about_textview_uri_clicked), text);
@@ -219,7 +235,7 @@ static GtkWidget *about_create_child_page_authors(void)
        buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
        gtk_text_buffer_get_iter_at_offset(buffer, &iter, 0);
 
-       /* init formatting tag: indentation  for list items */
+       /* init formatting tag: indentation for list items */
        gtk_text_buffer_create_tag(buffer, "indented-list-item",
                                "indent", 8,
                                NULL);
@@ -227,8 +243,8 @@ static GtkWidget *about_create_child_page_authors(void)
                                "underline", PANGO_UNDERLINE_SINGLE,
                                NULL);
 
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("The Claws Mail Team")), -1,
-                       "underlined-list-title", NULL);
+       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter,
+                       (_("The Claws Mail Team")), -1, "underlined-list-title", NULL);
        gtk_text_buffer_insert(buffer, &iter, "\n", 1);
 
        for (i = 0; TEAM_LIST[i] != NULL; i++) {
@@ -245,10 +261,10 @@ static GtkWidget *about_create_child_page_authors(void)
                gtk_text_buffer_insert(buffer, &iter, "\n", 1);
        }
 
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("Previous team members")), -1,
-                       "underlined-list-title", NULL);
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       ADD_TEXT("\n");
+       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter,
+                       (_("Previous team members")), -1, "underlined-list-title", NULL);
+       ADD_TEXT("\n");
 
        for (i = 0; EX_TEAM_LIST[i] != NULL; i++) {
                if (g_utf8_validate(EX_TEAM_LIST[i], -1, NULL))
@@ -261,13 +277,13 @@ static GtkWidget *about_create_child_page_authors(void)
                                                "indented-list-item", NULL);
                        g_free(conv);
                }
-               gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+               ADD_TEXT("\n");
        }
 
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("The translation team")), -1,
-                       "underlined-list-title", NULL);
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       ADD_TEXT("\n");
+       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter,
+                       (_("The translation team")), -1, "underlined-list-title", NULL);
+       ADD_TEXT("\n");
 
        for (i = 0; TRANS_TEAM_LIST[i] != NULL; i++) {
                if (g_utf8_validate(TRANS_TEAM_LIST[i], -1, NULL))
@@ -280,13 +296,13 @@ static GtkWidget *about_create_child_page_authors(void)
                                                "indented-list-item", NULL);
                        g_free(conv);
                }
-               gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+               ADD_TEXT("\n");
        }
 
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("Documentation team")), -1,
-                       "underlined-list-title", NULL);
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       ADD_TEXT("\n");
+       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter,
+                       (_("Documentation team")), -1, "underlined-list-title", NULL);
+       ADD_TEXT("\n");
 
        for (i = 0; DOC_TEAM_LIST[i] != NULL; i++) {
                if (g_utf8_validate(DOC_TEAM_LIST[i], -1, NULL))
@@ -299,13 +315,13 @@ static GtkWidget *about_create_child_page_authors(void)
                                                "indented-list-item", NULL);
                        g_free(conv);
                }
-               gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+               ADD_TEXT("\n");
        }
 
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       ADD_TEXT("\n");
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("Logo")), -1,
                        "underlined-list-title", NULL);
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       ADD_TEXT("\n");
 
        for (i = 0; LOGO_LIST[i] != NULL; i++) {
                if (g_utf8_validate(LOGO_LIST[i], -1, NULL))
@@ -318,13 +334,13 @@ static GtkWidget *about_create_child_page_authors(void)
                                                "indented-list-item", NULL);
                        g_free(conv);
                }
-               gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+               ADD_TEXT("\n");
        }
 
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       ADD_TEXT("\n");
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("Icons")), -1,
                        "underlined-list-title", NULL);
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       ADD_TEXT("\n");
 
        for (i = 0; ICONS_LIST[i] != NULL; i++) {
                if (g_utf8_validate(ICONS_LIST[i], -1, NULL))
@@ -337,13 +353,13 @@ static GtkWidget *about_create_child_page_authors(void)
                                                "indented-list-item", NULL);
                        g_free(conv);
                }
-               gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+               ADD_TEXT("\n");
        }
 
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       ADD_TEXT("\n");
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("Contributors")), -1,
                        "underlined-list-title", NULL);
-       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       ADD_TEXT("\n");
 
        for (i = 0; CONTRIBS_LIST[i] != NULL; i++) {
                if (g_utf8_validate(CONTRIBS_LIST[i], -1, NULL))
@@ -356,7 +372,7 @@ static GtkWidget *about_create_child_page_authors(void)
                                                "indented-list-item", NULL);
                        g_free(conv);
                }
-               gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+               ADD_TEXT("\n");
        }
 
        return scrolledwin;
@@ -389,13 +405,14 @@ static GtkWidget *about_create_child_page_features(void)
        buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
        gtk_text_buffer_get_iter_at_offset(buffer, &iter, 0);
 
-       gtk_text_buffer_insert(buffer, &iter, _("Compiled-in Features\n"), -1);
+       ADD_TEXT(_("Compiled-in Features"));
+       ADD_TEXT("\n");
 
        gtk_text_buffer_create_tag(buffer, "bold", "weight", PANGO_WEIGHT_BOLD,
                                   NULL);
 
-       stock_pixbuf_gdk(window, STOCK_PIXMAP_CHECKBOX_ON, &active_pixbuf);
-       stock_pixbuf_gdk(window, STOCK_PIXMAP_CHECKBOX_OFF, &inactive_pixbuf);
+       stock_pixbuf_gdk(STOCK_PIXMAP_CHECKBOX_ON, &active_pixbuf);
+       stock_pixbuf_gdk(STOCK_PIXMAP_CHECKBOX_OFF, &inactive_pixbuf);
 
 #if HAVE_LIBCOMPFACE
        gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
@@ -405,7 +422,7 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" compface "), -1,
                                                 "bold", NULL);
        gtk_text_buffer_insert(buffer, &iter, 
-               (gchar *)Q_("compface|adds support for the X-Face header\n"), -1);
+               (gchar *)C_("compface", "adds support for the X-Face header\n"), -1);
 
 #if USE_ENCHANT
        gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
@@ -415,7 +432,7 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" Enchant "), -1,
                                                 "bold", NULL);
        gtk_text_buffer_insert(buffer, &iter, 
-               (gchar *)Q_("Enchant|adds support for spell checking\n"), -1);
+               (gchar *)C_("Enchant", "adds support for spell checking\n"), -1);
 
 #if USE_GNUTLS
        gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
@@ -425,7 +442,7 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" GnuTLS "), -1,
                                                 "bold", NULL);
        gtk_text_buffer_insert(buffer, &iter, 
-               (gchar *)Q_("GnuTLS|adds support for encrypted connections to servers\n"), -1);
+               (gchar *)C_("GnuTLS", "adds support for encrypted connections to servers\n"), -1);
 
 #if INET6
        gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
@@ -435,7 +452,7 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" IPv6 "), -1,
                                                 "bold", NULL);
        gtk_text_buffer_insert(buffer, &iter, 
-               (gchar *)Q_("IPv6|adds support for IPv6 addresses, the new Internet "
+               (gchar *)C_("IPv6", "adds support for IPv6 addresses, the new Internet "
                            "addressing protocol\n"), -1);
 
 #if HAVE_ICONV
@@ -446,7 +463,7 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" iconv "), -1,
                                                 "bold", NULL);
        gtk_text_buffer_insert(buffer, &iter, 
-               (gchar *)Q_("iconv|allows converting to and from different character sets\n"), -1);
+               (gchar *)C_("iconv", "allows converting to and from different character sets\n"), -1);
 
 #if USE_JPILOT
        gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
@@ -456,7 +473,7 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" JPilot "), -1,
                                                 "bold", NULL);
        gtk_text_buffer_insert(buffer, &iter, 
-               (gchar *)Q_("JPilot|adds support for PalmOS addressbooks\n"), -1);
+               (gchar *)C_("JPilot", "adds support for PalmOS addressbooks\n"), -1);
 
 #if USE_LDAP
        gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
@@ -466,7 +483,7 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" LDAP "), -1,
                                                 "bold", NULL);
        gtk_text_buffer_insert(buffer, &iter, 
-               (gchar *)Q_("LDAP|adds support for LDAP shared addressbooks\n"), -1);
+               (gchar *)C_("LDAP", "adds support for LDAP shared addressbooks\n"), -1);
 
 #if HAVE_LIBETPAN
        gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
@@ -476,7 +493,7 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" libetpan "), -1,
                                                 "bold", NULL);
        gtk_text_buffer_insert(buffer, &iter, 
-               (gchar *)Q_("libetpan|adds support for IMAP and NNTP servers\n"), -1);
+               (gchar *)C_("libetpan", "adds support for IMAP and NNTP servers\n"), -1);
 
 #if HAVE_LIBSM
        gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
@@ -486,7 +503,7 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" libSM "), -1,
                                                 "bold", NULL);
        gtk_text_buffer_insert(buffer, &iter, 
-               (gchar *)Q_("libSM|adds support for session handling\n"), -1);
+               (gchar *)C_("libSM", "adds support for session handling\n"), -1);
 
 #if HAVE_NETWORKMANAGER_SUPPORT
        gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
@@ -496,7 +513,17 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" NetworkManager "), -1,
                                                 "bold", NULL);
        gtk_text_buffer_insert(buffer, &iter,
-               (gchar *)Q_("NetworkManager|adds support for detection of network connection changes\n"), -1);
+               (gchar *)C_("NetworkManager", "adds support for detection of network connection changes\n"), -1);
+
+#if HAVE_SVG
+       gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
+#else
+       gtk_text_buffer_insert_pixbuf(buffer, &iter, inactive_pixbuf);
+#endif
+       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" librSVG "), -1,
+                                                "bold", NULL);
+       gtk_text_buffer_insert(buffer, &iter,
+               (gchar *)C_("librSVG", "adds support for SVG themes\n"), -1);
 
        return scrolledwin;
 }
@@ -527,20 +554,22 @@ static GtkWidget *about_create_child_page_license(void)
        buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
        gtk_text_buffer_get_iter_at_offset(buffer, &iter, 0);
 
-       gtk_text_buffer_insert(buffer, &iter,
+       ADD_TEXT(
                _("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 "
                  "the Free Software Foundation; either version 3, or (at your option) "
-                 "any later version.\n\n"), -1);
+                 "any later version."));
+       ADD_TEXT("\n\n");
 
-       gtk_text_buffer_insert(buffer, &iter,
+       ADD_TEXT(
                _("This program is distributed in the hope that it will be useful, "
                  "but WITHOUT ANY WARRANTY; without even the implied warranty of "
                  "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "
-                 "See the GNU General Public License for more details.\n\n"), -1);
+                 "See the GNU General Public License for more details."));
+       ADD_TEXT("\n\n");
 
        /* textview link style (based upon main prefs) */
-       gtkut_convert_int_to_gdk_color(prefs_common.uri_col,
+       gtkut_convert_int_to_gdk_color(prefs_common.color[COL_URI],
                        (GdkColor*)&uri_color);
 
        tag = gtk_text_buffer_create_tag(buffer, "link",
@@ -551,13 +580,13 @@ static GtkWidget *about_create_child_page_license(void)
                "underline", PANGO_UNDERLINE_SINGLE,
                NULL);
 
-       gtk_text_buffer_insert(buffer, &iter,
+       gtk_text_buffer_insert(buffer, &iter, g_strconcat(
                _("You should have received a copy of the GNU General Public License "
-                 "along with this program. If not, see <"), -1);
+                 "along with this program. If not, see "), "<", NULL), -1);
        gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, 
                "http://www.gnu.org/licenses/", -1,
                "link", NULL);
-       gtk_text_buffer_insert(buffer, &iter, _(">. \n\n"), -1);
+       gtk_text_buffer_insert(buffer, &iter, ">. \n\n", -1);
 
        g_signal_connect(G_OBJECT(tag), "event",
                                G_CALLBACK(about_textview_uri_clicked), text);
@@ -569,6 +598,8 @@ static GtkWidget *about_create_child_page_license(void)
        return scrolledwin;
 }
 
+#undef ADD_TEXT
+
 static gboolean release_notes_available(void)
 {
        gboolean ret = FALSE;
@@ -621,7 +652,7 @@ static GtkWidget *about_create_child_page_release_notes(void)
 
                tmp = conv_codeset_strdup(buf, src_codeset, dest_codeset);
                if (!tmp) {
-                       g_warning("Failed to convert character set of action configuration\n");
+                       g_warning("Failed to convert character set of action configuration");
                        tmp = g_strdup(buf);
                }
 
@@ -633,6 +664,112 @@ static GtkWidget *about_create_child_page_release_notes(void)
        return scrolledwin;
 }
 
+static GtkWidget *about_create_child_page_session_stats(void)
+{
+       GtkWidget *scrolledwin;
+       GtkWidget *text;
+       GtkTextIter iter;
+
+       scrolledwin = gtk_scrolled_window_new(NULL, NULL);
+       gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
+                       GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+       gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin),
+                       GTK_SHADOW_IN);
+       text = gtk_text_view_new();
+       gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
+       gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
+       gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 6);
+       gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6);
+       gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
+       gtk_container_add(GTK_CONTAINER(scrolledwin), text);
+
+       stats_text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
+
+       gtk_text_buffer_get_iter_at_offset(stats_text_buffer, &iter, 0);
+       gtk_text_buffer_create_tag(stats_text_buffer, "indented-list-item",
+                               "indent", 8,
+                               NULL);
+       gtk_text_buffer_create_tag(stats_text_buffer, "underlined-list-title",
+                               "underline", PANGO_UNDERLINE_SINGLE,
+                               NULL);
+       gtk_text_buffer_create_tag(stats_text_buffer, "bold", "weight", PANGO_WEIGHT_BOLD,
+                                  NULL);
+
+       about_update_stats();
+
+       return scrolledwin;
+}
+
+static void about_update_stats(void)
+{
+       if (stats_text_buffer != NULL)
+       {
+               GtkTextIter start, end, iter;
+               gchar buf[1024];
+
+               gtk_text_buffer_get_start_iter(stats_text_buffer, &start);
+               gtk_text_buffer_get_end_iter(stats_text_buffer, &end);
+               gtk_text_buffer_delete(stats_text_buffer, &start, &end);
+
+               gtk_text_buffer_get_iter_at_offset(stats_text_buffer, &iter, 0);
+
+               gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter,
+                               (_("Session statistics\n")), -1,
+                               "underlined-list-title", NULL);
+
+               if (prefs_common.date_format) {
+                       struct tm *lt;
+                       gint len = 100;
+                       gchar date[len];
+
+                       lt = localtime(&session_stats.time_started);
+                       fast_strftime(date, len, prefs_common.date_format, lt);
+                       g_snprintf(buf, sizeof(buf), _("Started: %s\n"),
+                                               lt ? date : ctime(&session_stats.time_started));
+               } else
+                       g_snprintf(buf, sizeof(buf), _("Started: %s\n"),
+                                               ctime(&session_stats.time_started));
+               gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+                               "indented-list-item", NULL);
+
+               gtk_text_buffer_insert(stats_text_buffer, &iter, "\n", 1);
+               gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter,
+                               (_("Incoming traffic\n")), -1,
+                               "underlined-list-title", NULL);
+
+               g_snprintf(buf, sizeof(buf), _("Received messages: %d\n"),
+                                       session_stats.received);
+               gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+                               "indented-list-item", "bold", NULL);
+
+               gtk_text_buffer_insert(stats_text_buffer, &iter, "\n", 1);
+               gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter,
+                               (_("Outgoing traffic\n")), -1,
+                               "underlined-list-title", NULL);
+
+               g_snprintf(buf, sizeof(buf), _("New/redirected messages: %d\n"),
+                                       session_stats.sent);
+               gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+                               "indented-list-item", NULL);
+
+               g_snprintf(buf, sizeof(buf), _("Replied messages: %d\n"),
+                                       session_stats.replied);
+               gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+                               "indented-list-item", NULL);
+
+               g_snprintf(buf, sizeof(buf), _("Forwarded messages: %d\n"),
+                                       session_stats.forwarded);
+               gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+                               "indented-list-item", NULL);
+
+               g_snprintf(buf, sizeof(buf), _("Total outgoing messages: %d\n"),
+                                       (session_stats.sent + session_stats.replied +
+                                        session_stats.forwarded));
+               gtk_text_buffer_insert_with_tags_by_name(stats_text_buffer, &iter, buf, -1,
+                               "indented-list-item", "bold", NULL);
+       } 
+}
+
 static void about_create(void)
 {
        GtkWidget *vbox1;
@@ -648,6 +785,8 @@ static void about_create(void)
        GtkWidget *close_button;
        static GdkGeometry geometry;
 
+       stats_text_buffer = NULL;
+
        window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "about");
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER_ALWAYS);
        gtk_window_set_title(GTK_WINDOW(window), _("About Claws Mail"));
@@ -684,7 +823,7 @@ static void about_create(void)
        gtk_table_set_row_spacings (GTK_TABLE (table), 8);
        gtk_table_set_col_spacings (GTK_TABLE (table), 8);
 
-       image = stock_pixmap_widget(window, STOCK_PIXMAP_CLAWS_MAIL_LOGO);
+       image = stock_pixmap_widget(STOCK_PIXMAP_CLAWS_MAIL_LOGO);
        gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 1,
                        (GtkAttachOptions) (GTK_EXPAND),
                        (GtkAttachOptions) (0), 0, 0);
@@ -708,7 +847,7 @@ static void about_create(void)
        gtk_box_pack_start(GTK_BOX(vbox2), button, FALSE, FALSE, 0);
 #ifndef GENERIC_UMPC
        label = gtk_label_new
-               (_("Copyright (C) 1999-2011\nThe Claws Mail Team\n"
+               (_("Copyright (C) 1999-2017\nThe Claws Mail Team\n"
                 "and Hiroyuki Yamamoto"));
        gtk_label_set_selectable(GTK_LABEL(label), TRUE);
        gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
@@ -751,6 +890,12 @@ static void about_create(void)
                                gtk_label_new_with_mnemonic(_("_Release Notes")));
        }
 
+       if ((scrolledwin = about_create_child_page_session_stats()) != NULL) {
+               gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
+                               scrolledwin,
+                               gtk_label_new_with_mnemonic(_("_Statistics")));
+       }
+
        gtk_box_pack_start(GTK_BOX(vbox1), notebook, TRUE, TRUE, 0);
 
        gtkut_stock_button_set_create(&confirm_area, &close_button, GTK_STOCK_CLOSE,
@@ -768,7 +913,7 @@ static void about_create(void)
 
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event)
 {
-       if (event && event->keyval == GDK_Escape)
+       if (event && event->keyval == GDK_KEY_Escape)
                gtk_widget_hide(window);
        return FALSE;
 }