2
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3
* Copyright (C) 1999-2015 the Claws Mail Team
4
* Copyright (C) 2014-2015 Charles Lehner
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 3 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
#include <glib/gi18n.h>
30
#include "mainwindow.h"
32
#include "sieve_prefs.h"
33
#include "sieve_manager.h"
35
#define PLUGIN_NAME (_("ManageSieve"))
37
static gint main_menu_id = 0;
39
static void manage_cb(GtkAction *action, gpointer data) {
43
static GtkActionEntry sieve_main_menu[] = {{
44
"Tools/ManageSieveFilters",
45
NULL, N_("Manage Sieve Filters..."), NULL, NULL, G_CALLBACK(manage_cb)
51
* @param error For storing the returned error message.
53
* @return 0 if initialization succeeds, -1 on failure.
55
gint plugin_init(gchar **error)
57
MainWindow *mainwin = mainwindow_get_mainwindow();
59
if (!check_plugin_version(MAKE_NUMERIC_VERSION(2,9,2,72),
60
VERSION_NUMERIC, PLUGIN_NAME, error))
63
gtk_action_group_add_actions(mainwin->action_group, sieve_main_menu, 1,
65
MENUITEM_ADDUI_ID_MANAGER(mainwin->ui_manager,
66
"/Menu/Tools", "ManageSieveFilters", "Tools/ManageSieveFilters",
67
GTK_UI_MANAGER_MENUITEM, main_menu_id)
71
debug_print("ManageSieve plugin loaded\n");
77
* Destructor for the plugin.
78
* Unregister callback functions and free stuff.
80
* @return Always TRUE.
82
gboolean plugin_done(void)
84
MainWindow *mainwin = mainwindow_get_mainwindow();
87
sieve_sessions_close();
90
MENUITEM_REMUI_MANAGER(mainwin->ui_manager,
91
mainwin->action_group,
92
"Tools/ManageSieveFilters", main_menu_id);
94
debug_print("ManageSieve plugin unloaded\n");
99
const gchar *plugin_name(void)
105
* Get the description of the plugin.
107
* @return The plugin's description, maybe translated.
109
const gchar *plugin_desc(void)
111
return _("Manage sieve filters on a server using the ManageSieve protocol.");
115
* Get the kind of plugin.
117
* @return The "GTK2" constant.
119
const gchar *plugin_type(void)
124
* Get the license acronym the plugin is released under.
126
* @return The "GPL3+" constant.
128
const gchar *plugin_licence(void)
134
* Get the version of the plugin.
136
* @return The current version string.
138
const gchar *plugin_version(void)
144
* Get the features implemented by the plugin.
146
* @return A constant PluginFeature structure with the features.
148
struct PluginFeature *plugin_provides(void)
150
static struct PluginFeature features[] =
151
{ {PLUGIN_UTILITY, N_("ManageSieve")},
152
{PLUGIN_NOTHING, NULL}};