2005-12-07 [colin] 1.9.100cvs73

* src/action.c
	* src/compose.c
	* src/compose.h
		Fix bug #839 (Quoted text isn't colored after
		executing an action)
	* src/common/plugin.c
		Require plugins to declare their licence in plugin_licence()
		Refuse to load non-GPL plugins as they'd be illegal (as
		derived works of Sylpheed-Claws, they must be GPL).
	* 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
		Add plugin_licence()
This commit is contained in:
Colin Leroy 2005-12-07 18:18:10 +00:00
parent 00075adb7c
commit 9d77ca8232
15 changed files with 110 additions and 6 deletions

View file

@ -1,3 +1,24 @@
2005-12-07 [colin] 1.9.100cvs73
* src/action.c
* src/compose.c
* src/compose.h
Fix bug #839 (Quoted text isn't colored after
executing an action)
* src/common/plugin.c
Require plugins to declare their licence in plugin_licence()
Refuse to load non-GPL plugins as they'd be illegal (as
derived works of Sylpheed-Claws, they must be GPL).
* 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
Add plugin_licence()
2005-12-07 [paul] 1.9.100cvs72
* configure.ac

File diff suppressed because one or more lines are too long

View file

@ -11,7 +11,7 @@ MINOR_VERSION=9
MICRO_VERSION=100
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=72
EXTRA_VERSION=73
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -99,6 +99,8 @@ struct _ChildInfo
gint new_out;
GString *output;
void (*callback)(void *data);
void *data;
};
static void action_update_menu (GtkItemFactory *ifactory,
@ -125,7 +127,9 @@ static gboolean execute_actions (gchar *action,
GSList *msg_list,
GtkWidget *text,
gint body_pos,
MimeInfo *partinfo);
MimeInfo *partinfo,
void (*callback)(void *data),
void *data);
static gchar *parse_action_cmd (gchar *action,
MsgInfo *msginfo,
@ -512,7 +516,8 @@ static void compose_actions_execute_cb(Compose *compose, guint action_nb,
return;
}
execute_actions(action, NULL, compose->text, 0, NULL);
execute_actions(action, NULL, compose->text, 0, NULL,
compose_action_cb, compose);
}
static void mainwin_actions_execute_cb(MainWindow *mainwin, guint action_nb,
@ -574,7 +579,8 @@ static void message_actions_execute(MessageView *msgview, guint action_nb,
* filtering */
execute_filtering_actions(action, msg_list);
else
execute_actions(action, msg_list, text, body_pos, partinfo);
execute_actions(action, msg_list, text, body_pos, partinfo,
NULL, NULL);
}
static gboolean execute_filtering_actions(gchar *action, GSList *msglist)
@ -606,7 +612,8 @@ static gboolean execute_filtering_actions(gchar *action, GSList *msglist)
static gboolean execute_actions(gchar *action, GSList *msg_list,
GtkWidget *text,
gint body_pos, MimeInfo *partinfo)
gint body_pos, MimeInfo *partinfo,
void (*callback)(void *data), void *data)
{
GSList *children_list = NULL;
gint is_ok = TRUE;
@ -752,6 +759,8 @@ static gboolean execute_actions(gchar *action, GSList *msg_list,
for (cur = children_list; cur; cur = cur->next) {
child_info = (ChildInfo *) cur->data;
child_info->callback = callback;
child_info->data = data;
child_info->tag_status =
gdk_input_add(child_info->chld_status,
GDK_INPUT_READ,
@ -760,7 +769,6 @@ static gboolean execute_actions(gchar *action, GSList *msg_list,
create_io_dialog(children);
}
return is_ok;
}
@ -1062,6 +1070,8 @@ static void childinfo_close_pipes(ChildInfo *child_info)
static void free_children(Children *children)
{
ChildInfo *child_info;
void (*callback)(void *data) = NULL;
void *data = NULL;
debug_print("Freeing children data %p\n", children);
@ -1071,8 +1081,14 @@ static void free_children(Children *children)
g_free(child_info->cmd);
g_string_free(child_info->output, TRUE);
children->list = g_slist_remove(children->list, child_info);
callback = child_info->callback;
data = child_info->data;
g_free(child_info);
}
if (callback)
callback(data);
g_free(children);
}

View file

@ -35,6 +35,7 @@ struct _Plugin
const gchar *(*name) (void);
const gchar *(*desc) (void);
const gchar *(*type) (void);
const gchar *(*licence) (void);
GSList *rdeps;
};
@ -192,6 +193,7 @@ Plugin *plugin_load(const gchar *filename, gchar **error)
gint (*plugin_init) (gchar **error);
gpointer plugin_name, plugin_desc;
const gchar *(*plugin_type)(void);
const gchar *(*plugin_licence)(void);
gint ok;
g_return_val_if_fail(filename != NULL, NULL);
@ -221,6 +223,7 @@ Plugin *plugin_load(const gchar *filename, gchar **error)
if (!g_module_symbol(plugin->module, "plugin_name", &plugin_name) ||
!g_module_symbol(plugin->module, "plugin_desc", &plugin_desc) ||
!g_module_symbol(plugin->module, "plugin_type", (gpointer)&plugin_type) ||
!g_module_symbol(plugin->module, "plugin_licence", (gpointer)&plugin_licence) ||
!g_module_symbol(plugin->module, "plugin_init", (gpointer)&plugin_init)) {
*error = g_strdup(g_module_error());
g_module_close(plugin->module);
@ -228,6 +231,13 @@ Plugin *plugin_load(const gchar *filename, gchar **error)
return NULL;
}
if (strcmp(plugin_licence(), "GPL")) {
*error = g_strdup(_("This module is not licenced under the GPL."));
g_module_close(plugin->module);
g_free(plugin);
return NULL;
}
if (!strcmp(plugin_type(), "GTK")) {
*error = g_strdup(_("This module is for Sylpheed-Claws GTK1."));
g_module_close(plugin->module);
@ -244,6 +254,7 @@ Plugin *plugin_load(const gchar *filename, gchar **error)
plugin->name = plugin_name;
plugin->desc = plugin_desc;
plugin->type = plugin_type;
plugin->licence = plugin_licence;
plugin->filename = g_strdup(filename);
plugins = g_slist_append(plugins, plugin);

View file

@ -3450,6 +3450,12 @@ colorize:
compose->autowrap = prev_autowrap;
}
void compose_action_cb(void *data)
{
Compose *compose = (Compose *)data;
compose_wrap_all(compose);
}
static void compose_wrap_all(Compose *compose)
{
compose_wrap_all_full(compose, FALSE);

View file

@ -293,5 +293,6 @@ void compose_toolbar_cb (gint action,
void compose_reply_from_messageview (MessageView *msgview,
GSList *msginfo_list,
guint action);
void compose_action_cb (void *data);
#endif /* __COMPOSE_H__ */

View file

@ -263,3 +263,9 @@ const gchar *plugin_type(void)
{
return "GTK2";
}
const gchar *plugin_licence(void)
{
return "GPL";
}

View file

@ -86,3 +86,9 @@ const gchar *plugin_type(void)
{
return "Common";
}
const gchar *plugin_licence(void)
{
return "GPL";
}

View file

@ -203,3 +203,9 @@ const gchar *plugin_type(void)
{
return "GTK2";
}
const gchar *plugin_licence(void)
{
return "GPL";
}

View file

@ -70,3 +70,9 @@ const gchar *plugin_type(void)
{
return "GTK2";
}
const gchar *plugin_licence(void)
{
return "GPL";
}

View file

@ -71,3 +71,9 @@ const gchar *plugin_type(void)
{
return "GTK2";
}
const gchar *plugin_licence(void)
{
return "GPL";
}

View file

@ -71,3 +71,9 @@ const gchar *plugin_type(void)
{
return "GTK2";
}
const gchar *plugin_licence(void)
{
return "GPL";
}

View file

@ -346,3 +346,9 @@ const gchar *plugin_type(void)
{
return "GTK2";
}
const gchar *plugin_licence(void)
{
return "GPL";
}

View file

@ -325,6 +325,12 @@ const gchar *plugin_type(void)
return "GTK2";
}
const gchar *plugin_licence(void)
{
return "GPL";
}
/* popup menu callbacks */
static void trayicon_get_all_cb( gpointer data, guint action, GtkWidget *widget )
{