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"
45 #define PLUGIN_NAME (_("Mail Archiver"))
47 static void create_archive_cb(GtkAction *action, gpointer data) {
49 debug_print("Call-back function called\n");
54 static GtkActionEntry archiver_main_menu[] = {{
55 "Tools/CreateArchive",
56 NULL, N_("Create Archive..."), NULL, NULL, G_CALLBACK(create_archive_cb)
59 static gint main_menu_id = 0;
60 static char *plugin_description = NULL;
62 gint plugin_init(gchar** error)
64 MainWindow *mainwin = mainwindow_get_mainwindow();
66 if (!check_plugin_version(MAKE_NUMERIC_VERSION(3,4,0,65),
67 VERSION_NUMERIC, PLUGIN_NAME, error))
70 gtk_action_group_add_actions(mainwin->action_group, archiver_main_menu,
71 1, (gpointer)mainwin);
72 MENUITEM_ADDUI_ID_MANAGER(mainwin->ui_manager, "/Menu/Tools", "CreateArchive",
73 "Tools/CreateArchive", GTK_UI_MANAGER_MENUITEM,
76 archiver_prefs_init();
78 debug_print("archive plugin loaded\n");
83 gboolean plugin_done(void)
85 MainWindow *mainwin = mainwindow_get_mainwindow();
90 MENUITEM_REMUI_MANAGER(mainwin->ui_manager,mainwin->action_group, "Tools/CreateArchive", main_menu_id);
93 if (plugin_description != NULL) {
94 g_free(plugin_description);
95 plugin_description = NULL;
98 archiver_prefs_done();
99 debug_print("archive plugin unloaded\n");
104 const gchar* plugin_licence(void) {
108 const gchar* plugin_version(void) {
112 const gchar* plugin_type(void) {
116 const gchar* plugin_name(void) {
120 const gchar* plugin_desc(void) {
121 if (plugin_description == NULL) {
123 plugin_description = g_strdup_printf(_("This plugin adds archiving features to Claws Mail.\n"
125 "It enables you to select a mail folder that you want "
126 "to be archived, and then choose a name, format and "
127 "location for the archive. Subfolders can be included "
128 "and MD5 checksums can be added for each file in the "
129 "archive. Several archiving options are also available.\n"
131 "The archive can be stored as:\n%s"
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"
146 /* archive formats (untranslated, libarchive-version dependant) */
147 "\tTAR\n\tPAX\n\tSHAR\n\tCPIO\n",
149 /* compression formats (untranslated, libarchive-version dependant) */
150 "\tGZIP\n\tBZIP2\n\tCOMPRESS\n"
151 #if ARCHIVE_VERSION_NUMBER >= 2006990
154 #if ARCHIVE_VERSION_NUMBER >= 3000000
157 #if ARCHIVE_VERSION_NUMBER >= 3001000
158 "\tLRZIP\n\tLZOP\n\tGRZIP\n"
160 #if ARCHIVE_VERSION_NUMBER >= 3001900
165 return plugin_description;
168 struct PluginFeature* plugin_provides(void) {
169 static struct PluginFeature features[] =
170 { {PLUGIN_UTILITY, N_("Archiver")},
171 {PLUGIN_NOTHING, NULL} };