2006-12-15 [wwp] 2.6.1cvs40
authorTristan Chabredier <wwp@claws-mail.org>
Fri, 15 Dec 2006 16:41:15 +0000 (16:41 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Fri, 15 Dec 2006 16:41:15 +0000 (16:41 +0000)
* src/wizard.c
* src/common/plugin.c
* src/common/plugin.h
* src/gtk/about.c
* src/plugins/bogofilter/bogofilter.c
* src/plugins/clamav/clamav_plugin.c
* src/plugins/demo/demo.c
* src/plugins/dillo_viewer/dillo_viewer.c
* src/plugins/pgpcore/plugin.c
* src/plugins/pgpinline/plugin.c
* src/plugins/pgpmime/plugin.c
* src/plugins/spamassassin/spamassassin.c
* src/plugins/trayicon/trayicon.c
factorize some translatable strings (plugins-related),
fix missing punctuation in several places,
remove useless translatable \n in about.c,
and factorize plugin init code w/ a new function
check_plugin_version() in common/plugin.c.
Patch by Fabien Vantard <fzzzzz@gmail.com>.

16 files changed:
ChangeLog
PATCHSETS
configure.ac
src/common/plugin.c
src/common/plugin.h
src/gtk/about.c
src/plugins/bogofilter/bogofilter.c
src/plugins/clamav/clamav_plugin.c
src/plugins/demo/demo.c
src/plugins/dillo_viewer/dillo_viewer.c
src/plugins/pgpcore/plugin.c
src/plugins/pgpinline/plugin.c
src/plugins/pgpmime/plugin.c
src/plugins/spamassassin/spamassassin.c
src/plugins/trayicon/trayicon.c
src/wizard.c

index f33565d1cfefbc2afec536840a0c91db84b18195..a346c3ed9a78c3255eca39d02de4368561556262 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2006-12-15 [wwp]       2.6.1cvs40
+
+       * src/wizard.c
+       * src/common/plugin.c
+       * src/common/plugin.h
+       * src/gtk/about.c
+       * src/plugins/bogofilter/bogofilter.c
+       * src/plugins/clamav/clamav_plugin.c
+       * src/plugins/demo/demo.c
+       * src/plugins/dillo_viewer/dillo_viewer.c
+       * src/plugins/pgpcore/plugin.c
+       * src/plugins/pgpinline/plugin.c
+       * src/plugins/pgpmime/plugin.c
+       * src/plugins/spamassassin/spamassassin.c
+       * src/plugins/trayicon/trayicon.c
+               factorize some translatable strings (plugins-related),
+               fix missing punctuation in several places,
+               remove useless translatable \n in about.c,
+               and factorize plugin init code w/ a new function
+               check_plugin_version() in common/plugin.c.
+               Patch by Fabien Vantard <fzzzzz@gmail.com>.
+
 2006-12-15 [wwp]       2.6.1cvs39
 
        * src/plugins/bogofilter/bogofilter.c
index 66a8a91ab7c006ba4c8f3ef87bfa03d9211d00d3..77b633ff2a9dc8ab5188dd33ad09f27b0b0bbb40 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.207.2.137 -r 1.207.2.138 src/folderview.c;  ) > 2.6.1cvs37.patchset
 ( cvs diff -u -r 1.1.2.16 -r 1.1.2.17 src/plugins/bogofilter/bogofilter.c;  cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/plugins/bogofilter/bogofilter.h;  cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/plugins/bogofilter/bogofilter_gtk.c;  ) > 2.6.1cvs38.patchset
 ( cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/plugins/bogofilter/bogofilter.c;  cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/plugins/bogofilter/bogofilter_gtk.c;  ) > 2.6.1cvs39.patchset
+( cvs diff -u -r 1.1.2.43 -r 1.1.2.44 src/wizard.c;  cvs diff -u -r 1.13.2.22 -r 1.13.2.23 src/common/plugin.c;  cvs diff -u -r 1.5.2.8 -r 1.5.2.9 src/common/plugin.h;  cvs diff -u -r 1.4.2.43 -r 1.4.2.44 src/gtk/about.c;  cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/plugins/bogofilter/bogofilter.c;  cvs diff -u -r 1.13.2.27 -r 1.13.2.28 src/plugins/clamav/clamav_plugin.c;  cvs diff -u -r 1.13.2.11 -r 1.13.2.12 src/plugins/demo/demo.c;  cvs diff -u -r 1.12.2.17 -r 1.12.2.18 src/plugins/dillo_viewer/dillo_viewer.c;  cvs diff -u -r 1.1.2.14 -r 1.1.2.15 src/plugins/pgpcore/plugin.c;  cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/plugins/pgpinline/plugin.c;  cvs diff -u -r 1.1.2.22 -r 1.1.2.23 src/plugins/pgpmime/plugin.c;  cvs diff -u -r 1.18.2.44 -r 1.18.2.45 src/plugins/spamassassin/spamassassin.c;  cvs diff -u -r 1.14.2.45 -r 1.14.2.46 src/plugins/trayicon/trayicon.c;  ) > 2.6.1cvs40.patchset
index efec99e0514678a6ea72449af8e2096a914416c3..bfdcb523561bc5c243d131ac4fc4e808a073a2c4 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=6
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=39
+EXTRA_VERSION=40
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 6fb99d61c0942a214bf96d68ba471b55e0af720e..55ad8ce3f28dc8443deafea194e4b0c0d2d8fbfa 100644 (file)
@@ -32,6 +32,7 @@
 #include "utils.h"
 #include "plugin.h"
 #include "prefs.h"
+#include "claws.h"
 
 struct _Plugin
 {
@@ -520,3 +521,46 @@ const gchar *plugin_get_error(Plugin *plugin)
 {
        return plugin->error;
 }
+
+/* Generally called in plugin_init() function of each plugin. It check the
+ * minimal and compiled version of claws binary required by the plugin.
+ * If (@minimum_claws_version == 0 || @compiled_claws_version == 0), don't
+ * check the corresponding version.
+ *
+ * If an error occurs {
+ *     If @error == NULL { don't allocate error string. }
+ *     If @error != NULL { error string is allocated and must be freed after 
+ *                             call function. }
+ * }
+ * Returns: FALSE if an error occurs, TRUE if all is OK.
+ */
+gint check_plugin_version(guint32 minimum_claws_version,
+                        guint32 compiled_claws_version,
+                        const gchar *plugin_name,
+                        gchar **error)
+{
+       guint32 claws_version = claws_get_version();
+
+       if (compiled_claws_version != 0 && claws_version > compiled_claws_version) {
+               if (error != NULL) {
+                       *error = (plugin_name && *plugin_name)
+                               ? g_strdup_printf(_("Your version of Claws Mail is newer than the "
+                                                       "version the '%s' plugin was built with."),
+                                               plugin_name)
+                               : g_strdup(_("Your version of Claws Mail is newer than the "
+                                                       "version the plugin was built with."));
+               }
+               return FALSE;
+       }
+
+       if (minimum_claws_version != 0 && claws_version < minimum_claws_version) {
+               if (error != NULL) {
+                       *error = (plugin_name && *plugin_name)
+                               ? g_strdup_printf(_("Your version of Claws Mail is too old for "
+                                                       "the '%s' plugin."), plugin_name)
+                               : g_strdup(_("Your version of Claws Mail is too old for the plugin."));
+               }
+               return FALSE;
+       }
+       return TRUE;
+}
index 3fa56bd7e29eb4d4c6ccccec968f1d58cb426d61..7ff4b4fefc077d374b8029667b0960767628d143 100644 (file)
@@ -63,4 +63,8 @@ const gchar *plugin_get_name  (Plugin          *plugin);
 const gchar *plugin_get_desc   (Plugin          *plugin);
 const gchar *plugin_get_version        (Plugin          *plugin);
 const gchar *plugin_get_error  (Plugin          *plugin);
+gint check_plugin_version      (guint32 minimum_claws_version,
+                                guint32 compiled_claws_version,
+                                const gchar *plugin_name,
+                                gchar **error);
 #endif
index 853d6835d4ef20c2d172a8cd554bf9682ac731a7..d029ebb0e899de3acaf4e3e5e2491d65263f0676 100644 (file)
@@ -306,8 +306,9 @@ static void about_create(void)
                                "underline", PANGO_UNDERLINE_SINGLE,
                                NULL);
 
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("The Claws Mail Team\n")), -1,
+       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++) {
                if (g_utf8_validate(TEAM_LIST[i], -1, NULL))
@@ -323,8 +324,10 @@ static void about_create(void)
                gtk_text_buffer_insert(buffer, &iter, "\n", 1);
        }
 
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("\nPrevious team members\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);
 
        for (i = 0; EX_TEAM_LIST[i] != NULL; i++) {
                if (g_utf8_validate(EX_TEAM_LIST[i], -1, NULL))
@@ -340,8 +343,10 @@ static void about_create(void)
                gtk_text_buffer_insert(buffer, &iter, "\n", 1);
        }
 
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("\nThe translation team\n")), -1,
+       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);
 
        for (i = 0; TRANS_TEAM_LIST[i] != NULL; i++) {
                if (g_utf8_validate(TRANS_TEAM_LIST[i], -1, NULL))
@@ -357,8 +362,10 @@ static void about_create(void)
                gtk_text_buffer_insert(buffer, &iter, "\n", 1);
        }
 
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("\nDocumentation team\n")), -1,
+       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);
 
        for (i = 0; DOC_TEAM_LIST[i] != NULL; i++) {
                if (g_utf8_validate(DOC_TEAM_LIST[i], -1, NULL))
@@ -374,8 +381,10 @@ static void about_create(void)
                gtk_text_buffer_insert(buffer, &iter, "\n", 1);
        }
 
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("\nLogo\n")), -1,
+       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("Logo")), -1,
                        "underlined-list-title", NULL);
+       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
 
        for (i = 0; LOGO_LIST[i] != NULL; i++) {
                if (g_utf8_validate(LOGO_LIST[i], -1, NULL))
@@ -391,8 +400,10 @@ static void about_create(void)
                gtk_text_buffer_insert(buffer, &iter, "\n", 1);
        }
 
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("\nIcons\n")), -1,
+       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("Icons")), -1,
                        "underlined-list-title", NULL);
+       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
 
        for (i = 0; ICONS_LIST[i] != NULL; i++) {
                if (g_utf8_validate(ICONS_LIST[i], -1, NULL))
@@ -408,8 +419,10 @@ static void about_create(void)
                gtk_text_buffer_insert(buffer, &iter, "\n", 1);
        }
 
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("\nContributors\n")), -1,
+       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
+       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (_("Contributors")), -1,
                        "underlined-list-title", NULL);
+       gtk_text_buffer_insert(buffer, &iter, "\n", 1);
 
        for (i = 0; CONTRIBS_LIST[i] != NULL; i++) {
                if (g_utf8_validate(CONTRIBS_LIST[i], -1, NULL))
index f63ea50fe449f6e9f6500eb56ddd010f89a13519..f8992ec57394bad9946717c3874f26c1c5b9d9dd 100644 (file)
@@ -73,6 +73,8 @@
 #include <pwd.h>
 #endif
 
+#define PLUGIN_NAME (_("Bogofilter"))
+
 static guint hook_id = -1;
 static MessageCallback message_callback;
 
@@ -760,15 +762,9 @@ gint plugin_init(gchar **error)
 
        hook_id = -1;
 
-       if ((claws_get_version() > VERSION_NUMERIC)) {
-               *error = g_strdup(_("Your version of Claws Mail is newer than the version the Bogofilter plugin was built with"));
+       if (!check_plugin_version(MAKE_NUMERIC_VERSION(0, 9, 3, 86),
+                               VERSION_NUMERIC, PLUGIN_NAME, error))
                return -1;
-       }
-
-       if ((claws_get_version() < MAKE_NUMERIC_VERSION(0, 9, 3, 86))) {
-               *error = g_strdup(_("Your version of Claws Mail is too old for the Bogofilter plugin"));
-               return -1;
-       }
 
        prefs_set_default(param);
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
@@ -811,7 +807,7 @@ void plugin_done(void)
 
 const gchar *plugin_name(void)
 {
-       return _("Bogofilter");
+       return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)
index 05ee9a227e839efe1c8cfc5283d01175c944a72e..71825b1fbb1e2d987196165a790c4c72ac8e9c86 100644 (file)
@@ -40,6 +40,8 @@
 
 #include "clamav_plugin.h"
 
+#define PLUGIN_NAME (_("Clam AntiVirus"))
+
 static guint hook_id;
 static MessageCallback message_callback;
 
@@ -194,15 +196,9 @@ gint plugin_init(gchar **error)
        int ret;
        unsigned int no;
 
-       if ((claws_get_version() > VERSION_NUMERIC)) {
-               *error = g_strdup(_("Your version of Claws Mail is newer than the version the ClamAV plugin was built with"));
+       if (!check_plugin_version(MAKE_NUMERIC_VERSION(0, 9, 3, 86),
+                               VERSION_NUMERIC, PLUGIN_NAME, error))
                return -1;
-       }
-
-       if ((claws_get_version() < MAKE_NUMERIC_VERSION(0, 9, 3, 86))) {
-               *error = g_strdup(_("Your version of Claws Mail is too old for the ClamAV plugin"));
-               return -1;
-       }
 
        hook_id = hooks_register_hook(MAIL_FILTERING_HOOKLIST, mail_filtering_hook, NULL);
        if (hook_id == -1) {
@@ -249,7 +245,7 @@ void plugin_done(void)
 
 const gchar *plugin_name(void)
 {
-       return _("Clam AntiVirus");
+       return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)
index 0aa45425288894734fcd7970dd10d6fcfe6ec1cb..71a77c23268dd7cc407b387a3449d7268e290f94 100644 (file)
@@ -17,7 +17,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
- #include <glib.h>
+#include <glib.h>
 #include <glib/gi18n.h>
 
 
@@ -28,6 +28,8 @@
 #include "hooks.h"
 #include "log.h"
 
+#define PLUGIN_NAME (_("Demo"))
+
 gboolean my_log_hook(gpointer source, gpointer data)
 {
        LogText *logtext = (LogText *)source;
@@ -41,15 +43,9 @@ static guint hook_id;
 
 gint plugin_init(gchar **error)
 {
-       if ((claws_get_version() > VERSION_NUMERIC)) {
-               *error = g_strdup(_("Your claws-mail version is newer than the version the plugin was built with"));
+       if (!check_plugin_version(MAKE_NUMERIC_VERSION(0, 8, 11, 39),
+                               VERSION_NUMERIC, PLUGIN_NAME, error))
                return -1;
-       }
-
-       if ((claws_get_version() < MAKE_NUMERIC_VERSION(0, 8, 11, 39))) {
-               *error = g_strdup(_("Your claws-mail version is too old"));
-               return -1;
-       }
 
        hook_id = hooks_register_hook(LOG_APPEND_TEXT_HOOKLIST, my_log_hook, NULL);
        if (hook_id == -1) {
@@ -71,7 +67,7 @@ void plugin_done(void)
 
 const gchar *plugin_name(void)
 {
-       return _("Demo");
+       return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)
@@ -79,7 +75,7 @@ const gchar *plugin_desc(void)
        return _("This Plugin is only a demo of how to write plugins for Claws Mail. "
                 "It installs a hook for new log output and writes it to stdout."
                 "\n\n"
-                "It is not really useful");
+                "It is not really useful.");
 }
 
 const gchar *plugin_type(void)
index f18fa45712ba30accf4c38d104a406cf5c80f66b..d8628249f09ef668bbdf99a5b4fcfe6202b906b7 100644 (file)
@@ -36,6 +36,8 @@
 
 #include "dillo_prefs.h"
 
+#define PLUGIN_NAME (_("Dillo HTML Viewer"))
+
 typedef struct _DilloViewer DilloViewer;
 
 struct _DilloViewer
@@ -165,15 +167,9 @@ static MimeViewerFactory dillo_viewer_factory =
 
 gint plugin_init(gchar **error)
 {
-       if ((claws_get_version() > VERSION_NUMERIC)) {
-               *error = g_strdup(_("Your version of Claws Mail is newer than the version the Dillo plugin was built with"));
-               return -1;
-       }
-
-       if ((claws_get_version() < MAKE_NUMERIC_VERSION(0, 9, 3, 86))) {
-               *error = g_strdup(_("Your version of Claws Mail is too old for the Dillo plugin"));
-               return -1;
-       }
+       if (!check_plugin_version(MAKE_NUMERIC_VERSION(0, 9, 3, 86),
+                               VERSION_NUMERIC, PLUGIN_NAME, error))
+               return -1;
 
         dillo_prefs_init();
 
@@ -191,7 +187,7 @@ void plugin_done(void)
 
 const gchar *plugin_name(void)
 {
-       return _("Dillo HTML Viewer");
+       return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)
index 03461e20beeb740559e5a8cbbd194d0ba2c86b56..6c4cdfddf6f1ea4fb427a6e06d7b2c25556729f2 100644 (file)
 #include "pgp_viewer.h"
 #include "plugin.h"
 
+#define PLUGIN_NAME (_("PGP/Core"))
+
 gint plugin_init(gchar **error)
 {
-       if ((claws_get_version() > VERSION_NUMERIC)) {
-               *error = g_strdup(_("Your version of Claws Mail is newer than the version the PGP/Core plugin was built with"));
-               return -1;
-       }
-
-       if ((claws_get_version() < MAKE_NUMERIC_VERSION(2, 1, 0, 1))) {
-               *error = g_strdup(_("Your version of Claws Mail is too old for the PGP/Core plugin"));
+       if (!check_plugin_version(MAKE_NUMERIC_VERSION(2, 1, 0, 1),
+                               VERSION_NUMERIC, PLUGIN_NAME, error))
                return -1;
-       }
 
        sgpgme_init();
        prefs_gpg_init();
@@ -60,7 +56,7 @@ void plugin_done(void)
 
 const gchar *plugin_name(void)
 {
-       return _("PGP/Core");
+       return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)
index 534e78e3bf781a6e892bbfdb746a3f253baef299..9e21b2799aab9aa9d1c6146a1e50a0bc17747268 100644 (file)
 #include "version.h"
 #include "pgpinline.h"
 
+#define PLUGIN_NAME (_("PGP/inline"))
+
 gint plugin_init(gchar **error)
 {
-       if ((claws_get_version() > VERSION_NUMERIC)) {
-               *error = g_strdup(_("Your version of Claws Mail is newer than the version the PGP/inline plugin was built with"));
-               return -1;
-       }
-
-       if ((claws_get_version() < MAKE_NUMERIC_VERSION(2, 1, 0, 1))) {
-               *error = g_strdup(_("Your version of Claws Mail is too old for the PGP/inline plugin"));
-               return -1;
-       }
+       if (!check_plugin_version(MAKE_NUMERIC_VERSION(2, 1, 0, 1),
+                               VERSION_NUMERIC, PLUGIN_NAME, error))
+               return -1;
 
        pgpinline_init();
 
@@ -54,7 +50,7 @@ void plugin_done(void)
 
 const gchar *plugin_name(void)
 {
-       return _("PGP/inline");
+       return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)
index 1800c53a922525c7caf89d319465bd73456f2839..3f42f9f5ff9fba4edc8f2682ee39d16a9cdf989e 100644 (file)
 #include "version.h"
 #include "common/claws.h"
 #include "pgpmime.h"
+#include "plugin.h"
+
+#define PLUGIN_NAME (_("PGP/MIME"))
 
 gint plugin_init(gchar **error)
 {
-       if ((claws_get_version() > VERSION_NUMERIC)) {
-               *error = g_strdup(_("Your version of Claws Mail is newer than the version the PGP/MIME plugin was built with"));
-               return -1;
-       }
-
-       if ((claws_get_version() < MAKE_NUMERIC_VERSION(2, 1, 0, 1))) {
-               *error = g_strdup(_("Your version of Claws Mail is too old for the PGP/MIME plugin"));
+       if (!check_plugin_version(MAKE_NUMERIC_VERSION(2, 1, 0, 1),
+                               VERSION_NUMERIC, PLUGIN_NAME, error))
                return -1;
-       }
 
        pgpmime_init();
 
@@ -53,7 +50,7 @@ void plugin_done(void)
 
 const gchar *plugin_name(void)
 {
-       return _("PGP/MIME");
+       return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)
index 6864e331fcab34dfea75b9a1da20d9e75233d086..7c8d3dd3721c95fa9eed3bba070906e3df06ce12 100644 (file)
@@ -72,6 +72,8 @@
 #include <pwd.h>
 #endif
 
+#define PLUGIN_NAME (_("SpamAssassin"))
+
 enum {
     CHILD_RUNNING = 1 << 0,
     TIMEOUT_RUNNING = 1 << 1,
@@ -465,15 +467,9 @@ gint plugin_init(gchar **error)
 
        hook_id = -1;
 
-       if ((claws_get_version() > VERSION_NUMERIC)) {
-               *error = g_strdup(_("Your version of Claws Mail is newer than the version the SpamAssassin plugin was built with"));
+       if (!check_plugin_version(MAKE_NUMERIC_VERSION(0, 9, 3, 86),
+                               VERSION_NUMERIC, PLUGIN_NAME, error))
                return -1;
-       }
-
-       if ((claws_get_version() < MAKE_NUMERIC_VERSION(0, 9, 3, 86))) {
-               *error = g_strdup(_("Your version of Claws Mail is too old for the SpamAssassin plugin"));
-               return -1;
-       }
 
        prefs_set_default(param);
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
@@ -520,7 +516,7 @@ void plugin_done(void)
 
 const gchar *plugin_name(void)
 {
-       return _("SpamAssassin");
+       return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)
index 78cc4d62c7c8adace8ffcfb2483f219f49915d09..2b7a684bce94fb003db7d6dda80bd1dab623224a 100644 (file)
@@ -56,6 +56,8 @@
 #include "unreadmail.offline.xpm"
 #include "nomail.offline.xpm"
 
+#define PLUGIN_NAME (_("Trayicon"))
+
 static guint item_hook_id;
 static guint folder_hook_id;
 static guint offline_hook_id;
@@ -350,15 +352,9 @@ static void create_trayicon()
 
 int plugin_init(gchar **error)
 {
-       if ((claws_get_version() > VERSION_NUMERIC)) {
-               *error = g_strdup(_("Your version of Claws Mail is newer than the version the Trayicon plugin was built with"));
+       if (!check_plugin_version(MAKE_NUMERIC_VERSION(0, 9, 3, 86),
+                               VERSION_NUMERIC, PLUGIN_NAME, error))
                return -1;
-       }
-
-       if ((claws_get_version() < MAKE_NUMERIC_VERSION(0, 9, 3, 86))) {
-               *error = g_strdup(_("Your version of Claws Mail is too old for the Trayicon plugin"));
-               return -1;
-       }
 
        item_hook_id = hooks_register_hook (FOLDER_ITEM_UPDATE_HOOKLIST, folder_item_update_hook, NULL);
        if (item_hook_id == -1) {
@@ -411,7 +407,7 @@ void plugin_done(void)
 
 const gchar *plugin_name(void)
 {
-       return _("Trayicon");
+       return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)
index 989e743136a4f74f8347fe3477df845c92462501..e38f1048a9c1a5f0e93975e9c822022646ba598f 100644 (file)
@@ -458,13 +458,13 @@ static void write_welcome_email(WizardWindow *wizard)
        get_rfc822_date(buf_date, sizeof(buf_date));
 
        conv_encode_header_full(enc_subject, sizeof(enc_subject), 
-                       _("Welcome to Claws Mail "),
+                       Q_("Welcome Mail Subject|Welcome to Claws Mail"),
                        strlen("Subject: "), FALSE, CS_INTERNAL);
        conv_encode_header_full(enc_to_name, sizeof(enc_to_name), 
                        gtk_entry_get_text(GTK_ENTRY(wizard->full_name)),
                        strlen("To: "), TRUE, CS_INTERNAL);
        conv_encode_header_full(enc_from_name, sizeof(enc_from_name), 
-                       _("Claws Mail Team"),
+                       _("The Claws Mail Team"),
                        strlen("From: "), TRUE, CS_INTERNAL);
 
        head = g_strdup_printf(
@@ -483,7 +483,7 @@ static void write_welcome_email(WizardWindow *wizard)
        body = g_strdup_printf(
                _("\n"
                "Welcome to Claws Mail\n"
-               "-------------------------\n"
+               "---------------------\n"
                "\n"
                "Now that you have set up your account you can fetch your\n"
                "mail by clicking the 'Get Mail' button at the left of the\n"