update copyright year and team list
[claws.git] / src / gtk / about.c
index e209ec5ad2d408d16767d61226a4ef51aa929b7c..95f5e602934e32e2da17cf8beef6817c17386bd9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2015 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2021 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
@@ -43,6 +43,7 @@
 #include "menu.h"
 #include "textview.h"
 #include "main.h"
+#include "file-utils.h"
 
 extern SessionStats session_stats;
 static GtkTextBuffer *stats_text_buffer;
@@ -84,6 +85,8 @@ void about_show(void)
        
 }
 
+#define ADD_TEXT(text) gtk_text_buffer_insert(buffer, &iter, text, -1)
+
 static GtkWidget *about_create_child_page_info(void)
 {
        GtkWidget *scrolledwin;
@@ -116,7 +119,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,
@@ -127,23 +130,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"
-                               "For support and discussion subscribe to the Claws Mail "
-                               "users' mailing list:\n"),-1);
+       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);
-       gtk_text_buffer_insert(buffer, &iter, _("\n\n"
-                               "Claws Mail is free software released "
+       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);
 
@@ -154,17 +159,18 @@ 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-2015\nThe Claws Mail Team\n"
-                               " and Hiroyuki Yamamoto"), -1);
+       ADD_TEXT("\n\n");
+       ADD_TEXT(_("Copyright (C) 1999-2021\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),g_strconcat(
-                      "GTK+ %d.%d.%d / GLib %d.%d.%d\n"
+                      "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,
@@ -173,7 +179,7 @@ static GtkWidget *about_create_child_page_info(void)
                   utsbuf.sysname, utsbuf.release, utsbuf.machine);
 #elif defined(G_OS_WIN32)
        g_snprintf(buf, sizeof(buf),g_strconcat(
-                      "GTK+ %d.%d.%d / GLib %d.%d.%d\n"
+                      "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,
@@ -182,7 +188,7 @@ static GtkWidget *about_create_child_page_info(void)
                   "Win32");
 #else
        g_snprintf(buf, sizeof(buf),g_strconcat(
-                      "GTK+ %d.%d.%d / GLib %d.%d.%d\n"
+                      "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,
@@ -192,8 +198,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);
@@ -239,8 +244,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++) {
@@ -257,10 +262,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))
@@ -273,13 +278,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))
@@ -292,13 +297,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))
@@ -311,13 +316,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))
@@ -330,13 +335,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))
@@ -349,13 +354,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))
@@ -368,7 +373,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;
@@ -401,13 +406,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);
@@ -510,6 +516,16 @@ static GtkWidget *about_create_child_page_features(void)
        gtk_text_buffer_insert(buffer, &iter,
                (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;
 }
 
@@ -539,20 +555,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",
@@ -581,6 +599,8 @@ static GtkWidget *about_create_child_page_license(void)
        return scrolledwin;
 }
 
+#undef ADD_TEXT
+
 static gboolean release_notes_available(void)
 {
        gboolean ret = FALSE;
@@ -619,14 +639,14 @@ static GtkWidget *about_create_child_page_release_notes(void)
        gtk_text_buffer_get_iter_at_offset(buffer, &iter, 0);
 
        path = g_strconcat(DOCDIR, G_DIR_SEPARATOR_S, RELEASE_NOTES_FILE, NULL);
-       if ((fp = g_fopen(path, "rb")) == NULL) {
-               if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
+       if ((fp = claws_fopen(path, "rb")) == NULL) {
+               if (ENOENT != errno) FILE_OP_ERROR(path, "claws_fopen");
                g_free(path);
                return scrolledwin;
        }
        g_free(path);
 
-       while (fgets(buf, sizeof(buf), fp) != NULL) {
+       while (claws_fgets(buf, sizeof(buf), fp) != NULL) {
                const gchar *src_codeset = conv_get_locale_charset_str();
                const gchar *dest_codeset = CS_UTF_8;
                gchar *tmp;
@@ -640,7 +660,7 @@ static GtkWidget *about_create_child_page_release_notes(void)
                gtk_text_buffer_insert(buffer, &iter, tmp, -1);
                g_free(tmp);
        }
-       fclose(fp);
+       claws_fclose(fp);
 
        return scrolledwin;
 }
@@ -771,6 +791,7 @@ static void about_create(void)
        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"));
+       gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG);
        gtk_container_set_border_width(GTK_CONTAINER(window), 8);
        gtk_widget_set_size_request(window, -1, -1);
        g_signal_connect(G_OBJECT(window), "size_allocate",
@@ -804,7 +825,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);
@@ -820,7 +841,7 @@ static void about_create(void)
        gtk_box_pack_start(GTK_BOX(vbox2), label, FALSE, FALSE, 0);
        markup = g_markup_printf_escaped
                ("<span weight=\"bold\" size=\"xx-large\">Claws Mail</span>\nversion %s",
-                VERSION_GIT_FULL);
+                VERSION);
        gtk_label_set_markup(GTK_LABEL(label), markup);
        g_free(markup);
 
@@ -828,7 +849,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-2015\nThe Claws Mail Team\n"
+               (_("Copyright (C) 1999-2021\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);