2006-03-12 [paul] 2.0.0cvs134
[claws.git] / src / plugins / dillo_viewer / dillo_viewer.c
index 89dafde20f2f0f67b2a0922bfb504f86a7ede579..bd08e62b9f247182e65ad956846ae298e51d2477 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto and the Sylpheed-Claws Team
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws 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
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #ifdef HAVE_CONFIG_H
 #include <unistd.h>
 
 #include <glib.h>
+#include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
 
 #include "common/sylpheed.h"
 #include "common/version.h"
-#include "intl.h"
 #include "plugin.h"
 #include "utils.h"
 #include "mimeview.h"
@@ -74,13 +74,13 @@ static void dillo_show_mimepart(MimeViewer *_viewer,
        debug_print("dillo_show_mimepart\n");
 
        if (viewer->filename != NULL) {
-               unlink(viewer->filename);
+               g_unlink(viewer->filename);
                g_free(viewer->filename);
        }
 
        viewer->filename = procmime_get_tmp_file_name(partinfo);
        
-       if (!(procmime_get_part(viewer->filename, infile, partinfo) < 0)) {
+       if (!(procmime_get_part(viewer->filename, partinfo) < 0)) {
                gchar *cmd;
 
                if (viewer->socket)
@@ -91,10 +91,8 @@ static void dillo_show_mimepart(MimeViewer *_viewer,
                                  viewer->socket);
                gtk_widget_realize(viewer->socket);
                gtk_widget_show(viewer->socket);
-               gtk_signal_connect(GTK_OBJECT(viewer->socket), 
-                                  "destroy", 
-                                  GTK_SIGNAL_FUNC(socket_destroy_cb),
-                                  viewer);
+               g_signal_connect(G_OBJECT(viewer->socket), "destroy", 
+                                G_CALLBACK(socket_destroy_cb), viewer);
 
                cmd = g_strdup_printf("dillo %s%s-x %d \"%s\"",
                                      (dillo_prefs.local ? "-l " : ""),
@@ -126,7 +124,7 @@ static void dillo_destroy_viewer(MimeViewer *_viewer)
        debug_print("dillo_destroy_viewer\n");
 
        gtk_widget_unref(GTK_WIDGET(viewer->widget));
-       unlink(viewer->filename);
+       g_unlink(viewer->filename);
        g_free(viewer->filename);
        g_free(viewer);
 }
@@ -167,12 +165,12 @@ static MimeViewerFactory dillo_viewer_factory =
 gint plugin_init(gchar **error)
 {
        if ((sylpheed_get_version() > VERSION_NUMERIC)) {
-               *error = g_strdup("Your sylpheed version is newer than the version the plugin was built with");
+               *error = g_strdup("Your version of Sylpheed-Claws is newer than the version the Dillo plugin was built with");
                return -1;
        }
 
        if ((sylpheed_get_version() < MAKE_NUMERIC_VERSION(0, 9, 3, 86))) {
-               *error = g_strdup("Your sylpheed version is too old");
+               *error = g_strdup("Your version of Sylpheed-Claws is too old for the Dillo plugin");
                return -1;
        }
 
@@ -198,10 +196,22 @@ const gchar *plugin_name(void)
 const gchar *plugin_desc(void)
 {
        return _("This plugin renders HTML mail using the Dillo "
-               "web browser.");
+               "web browser.\n"
+               "\n"
+               "Options can be found in /Configuration/Preferences/Plugins/Dillo Browser");
 }
 
 const gchar *plugin_type(void)
 {
-       return "GTK";
+       return "GTK2";
+}
+
+const gchar *plugin_licence(void)
+{
+       return "GPL";
+}
+
+const gchar *plugin_version(void)
+{
+       return VERSION;
 }