1 /* vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: */
4 * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
5 * Copyright (C) 1999-2008 Michael Rasmussen and the Claws Mail Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include "claws-features.h"
28 #include <glib/gi18n.h>
32 #include "common/claws.h"
33 #include "common/version.h"
37 #include "alertpanel.h"
38 #include "statusbar.h"
40 #include "archiver_prefs.h"
43 #define PLUGIN_NAME (_("Mail Archiver"))
45 static void create_archive_cb(GtkAction *action, gpointer data) {
47 debug_print("Call-back function called\n");
52 static GtkActionEntry archiver_main_menu[] = {{
53 "Tools/CreateArchive",
54 NULL, N_("Create Archive..."), NULL, NULL, G_CALLBACK(create_archive_cb)
57 static gint main_menu_id = 0;
58 static char *plugin_description = NULL;
60 gint plugin_init(gchar** error)
62 MainWindow *mainwin = mainwindow_get_mainwindow();
64 if (!check_plugin_version(MAKE_NUMERIC_VERSION(3,4,0,65),
65 VERSION_NUMERIC, PLUGIN_NAME, error))
68 gtk_action_group_add_actions(mainwin->action_group, archiver_main_menu,
69 1, (gpointer)mainwin);
70 MENUITEM_ADDUI_ID_MANAGER(mainwin->ui_manager, "/Menu/Tools", "CreateArchive",
71 "Tools/CreateArchive", GTK_UI_MANAGER_MENUITEM,
74 archiver_prefs_init();
76 debug_print("archive plugin loaded\n");
81 gboolean plugin_done(void)
83 MainWindow *mainwin = mainwindow_get_mainwindow();
88 MENUITEM_REMUI_MANAGER(mainwin->ui_manager,mainwin->action_group, "Tools/CreateArchive", main_menu_id);
91 if (plugin_description != NULL) {
92 g_free(plugin_description);
93 plugin_description = NULL;
96 archiver_prefs_done();
97 debug_print("archive plugin unloaded\n");
102 const gchar* plugin_licence(void) {
106 const gchar* plugin_version(void) {
110 const gchar* plugin_type(void) {
114 const gchar* plugin_name(void) {
118 #define ARCHIVER_COMPRESS_FORMATS "\tGZIP/ZIP\n\tBZIP2\n\tCOMPRESS\n"
120 const gchar* plugin_desc(void) {
121 if (plugin_description == NULL) {
122 plugin_description = g_strdup_printf(_("This plugin adds archiving features to Claws Mail.\n"
124 "It enables you to select a mail folder that you want "
125 "to be archived, and then choose a name, format and "
126 "location for the archive. Subfolders can be included "
127 "and MD5 checksums can be added for each file in the "
128 "archive. Several archiving options are also available.\n"
130 "The archive can be stored as:\n"
131 "\tTAR\n\tPAX\n\tSHAR\n\tCPIO\n"
133 "The archive can be compressed using:\n%s"
135 "The archives can be restored with any standard tool "
136 "that supports the chosen format and compression.\n"
138 "The supported folder types are MH, IMAP, RSSyl and "
141 "To activate the archiving feature go to /Tools/Create Archive\n"
143 "Default options can be set in /Configuration/Preferences/Plugins"
145 ), ARCHIVER_COMPRESS_FORMATS);
147 return plugin_description;
150 struct PluginFeature* plugin_provides(void) {
151 static struct PluginFeature features[] =
152 { {PLUGIN_UTILITY, N_("Archiver")},
153 {PLUGIN_NOTHING, NULL} };