[Commits] [SCM] claws branch, master, updated. 3.18.0-76-ge5d14dc9f
mones at claws-mail.org
mones at claws-mail.org
Fri Sep 3 16:57:16 UTC 2021
The branch, master has been updated
via e5d14dc9f2f1e30f35507bc88b11beab4186828a (commit)
from 6010dca56c8214b71f153ddfa56416ea8faa2017 (commit)
Summary of changes:
src/plugins/attachwarner/attachwarner.c | 32 +++++-----
src/plugins/attachwarner/attachwarner.h | 27 ++++----
src/plugins/attachwarner/attachwarner_prefs.c | 90 ++++++++++++++-------------
src/plugins/attachwarner/attachwarner_prefs.h | 12 ++--
4 files changed, 83 insertions(+), 78 deletions(-)
- Log -----------------------------------------------------------------
commit e5d14dc9f2f1e30f35507bc88b11beab4186828a
Author: Ricardo Mones <ricardo at mones.org>
Date: Fri Sep 3 18:54:11 2021 +0200
Use plugin name consistently
diff --git a/src/plugins/attachwarner/attachwarner.c b/src/plugins/attachwarner/attachwarner.c
index 913260406..8454ae9a8 100644
--- a/src/plugins/attachwarner/attachwarner.c
+++ b/src/plugins/attachwarner/attachwarner.c
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2006-2015 Ricardo Mones and the Claws Mail Team
+ * Copyright (C) 2006-2021 Ricardo Mones and the Claws Mail 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
@@ -82,7 +82,7 @@ static AttachWarnerMention *aw_matcherlist_string_match(MatcherList *matchers, g
}
}
if (ret != FALSE) {
- awm = g_new0(AttachWarnerMention, 1);
+ awm = g_new0(AttachWarnerMention, 1);
awm->line = i; /* usual humans count lines from 1 */
awm->context = g_strdup(lines[i - 1]);
debug_print("found at line %d, context \"%s\"\n", awm->line, awm->context);
@@ -143,14 +143,14 @@ AttachWarnerMention *are_attachments_mentioned(Compose *compose)
gboolean does_not_have_attachments(Compose *compose)
{
GtkTreeView *tree_view = GTK_TREE_VIEW(compose->attach_clist);
- GtkTreeModel *model;
- GtkTreeIter iter;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
- model = gtk_tree_view_get_model(tree_view);
+ model = gtk_tree_view_get_model(tree_view);
debug_print("checking for attachments existence\n");
- if (!gtk_tree_model_get_iter_first(model, &iter))
- return TRUE;
+ if (!gtk_tree_model_get_iter_first(model, &iter))
+ return TRUE;
return FALSE;
}
@@ -191,7 +191,7 @@ static gboolean attwarn_before_send_hook(gpointer source, gpointer data)
Compose *compose = (Compose *)source;
AttachWarnerMention *mention = NULL;
- debug_print("attachwarner invoked\n");
+ debug_print("AttachWarner invoked\n");
if (compose->batch)
return FALSE; /* do not check while queuing */
@@ -242,12 +242,12 @@ static gboolean attwarn_before_send_hook(gpointer source, gpointer data)
gint plugin_init(gchar **error)
{
if (!check_plugin_version(MAKE_NUMERIC_VERSION(2,9,2,72),
- VERSION_NUMERIC, _("Attach warner"), error))
+ VERSION_NUMERIC, "AttachWarner", error))
return -1;
- hook_id = hooks_register_hook(COMPOSE_CHECK_BEFORE_SEND_HOOKLIST,
- attwarn_before_send_hook, NULL);
-
+ hook_id = hooks_register_hook(COMPOSE_CHECK_BEFORE_SEND_HOOKLIST,
+ attwarn_before_send_hook, NULL);
+
if (hook_id == HOOK_NONE) {
*error = g_strdup(_("Failed to register check before send hook"));
return -1;
@@ -255,7 +255,7 @@ gint plugin_init(gchar **error)
attachwarner_prefs_init();
- debug_print("Attachment warner plugin loaded\n");
+ debug_print("AttachWarner plugin loaded\n");
return 0;
}
@@ -268,7 +268,7 @@ gboolean plugin_done(void)
{
hooks_unregister_hook(COMPOSE_CHECK_BEFORE_SEND_HOOKLIST, hook_id);
attachwarner_prefs_done();
- debug_print("Attachment warner plugin unloaded\n");
+ debug_print("AttachWarner plugin unloaded\n");
return TRUE;
}
@@ -279,7 +279,7 @@ gboolean plugin_done(void)
*/
const gchar *plugin_name(void)
{
- return _("Attach warner");
+ return _("AttachWarner");
}
/**
@@ -331,7 +331,7 @@ const gchar *plugin_version(void)
struct PluginFeature *plugin_provides(void)
{
static struct PluginFeature features[] =
- { {PLUGIN_OTHER, N_("Attach warner")},
+ { {PLUGIN_OTHER, N_("AttachWarner")},
{PLUGIN_NOTHING, NULL}};
return features;
diff --git a/src/plugins/attachwarner/attachwarner.h b/src/plugins/attachwarner/attachwarner.h
index eee9b9b3c..26bbdf049 100644
--- a/src/plugins/attachwarner/attachwarner.h
+++ b/src/plugins/attachwarner/attachwarner.h
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2006-2015 Ricardo Mones and the Claws Mail Team
+ * Copyright (C) 2006-2021 Ricardo Mones and the Claws Mail 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
@@ -37,19 +37,18 @@ struct _AttachWarnerMention {
typedef struct _AttachWarnerMention AttachWarnerMention;
-MatcherProp * new_matcherprop (void);
-gboolean matcherprop_string_match (MatcherProp *mp, gchar *str);
-AttachWarnerMention *are_attachments_mentioned (Compose *compose);
-gboolean does_not_have_attachments (Compose *compose);
+MatcherProp * new_matcherprop (void);
+gboolean matcherprop_string_match (MatcherProp *mp, gchar *str);
+AttachWarnerMention * are_attachments_mentioned (Compose *compose);
+gboolean does_not_have_attachments (Compose *compose);
-gint plugin_init (gchar **error);
-gboolean plugin_done (void);
-const gchar * plugin_name (void);
-const gchar * plugin_desc (void);
-const gchar * plugin_type (void);
-const gchar * plugin_licence (void);
-const gchar * plugin_version (void);
-struct PluginFeature *plugin_provides (void);
+gint plugin_init (gchar **error);
+gboolean plugin_done (void);
+const gchar * plugin_name (void);
+const gchar * plugin_desc (void);
+const gchar * plugin_type (void);
+const gchar * plugin_licence (void);
+const gchar * plugin_version (void);
+struct PluginFeature * plugin_provides (void);
#endif
-
diff --git a/src/plugins/attachwarner/attachwarner_prefs.c b/src/plugins/attachwarner/attachwarner_prefs.c
index 3466f6ca7..ed4a0fe97 100644
--- a/src/plugins/attachwarner/attachwarner_prefs.c
+++ b/src/plugins/attachwarner/attachwarner_prefs.c
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2006-2015 Ricardo Mones and the Claws Mail Team
+ * Copyright (C) 2006-2021 Ricardo Mones and the Claws Mail 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
@@ -38,7 +38,7 @@ AttachWarnerPrefs attwarnerprefs;
struct AttachWarnerPrefsPage
{
PrefsPage page;
-
+
GtkWidget *regexp_text;
GtkWidget *skip_quotes_checkbox;
GtkWidget *skip_forwards_and_redirections;
@@ -63,8 +63,8 @@ static PrefParam param[] = {
};
static void attwarner_prefs_create_widget_func(PrefsPage * _page,
- GtkWindow * window,
- gpointer data)
+ GtkWindow * window,
+ gpointer data)
{
struct AttachWarnerPrefsPage *page = (struct AttachWarnerPrefsPage *) _page;
GtkWidget *vbox, *vbox1, *vbox2;
@@ -79,14 +79,15 @@ static void attwarner_prefs_create_widget_func(PrefsPage * _page,
vbox1 = gtk_vbox_new(FALSE, 6);
vbox2 = gtk_vbox_new(FALSE, 6);
-
+
label = gtk_label_new(_("One of the following regular expressions is matched (one per line)"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gtk_misc_set_padding(GTK_MISC(label), 2, 0);
case_sensitive_checkbox = gtk_check_button_new_with_label(_("Expressions are case sensitive"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(case_sensitive_checkbox),
- attwarnerprefs.case_sensitive);
+ gtk_toggle_button_set_active(
+ GTK_TOGGLE_BUTTON(case_sensitive_checkbox),
+ attwarnerprefs.case_sensitive);
gtk_widget_show(case_sensitive_checkbox);
CLAWS_SET_TIP(case_sensitive_checkbox,
@@ -96,13 +97,13 @@ static void attwarner_prefs_create_widget_func(PrefsPage * _page,
page->regexp_text = gtk_text_view_new();
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(page->regexp_text));
gtk_text_buffer_set_text(buffer, attwarnerprefs.match_strings, -1);
-
+
scrolledwin = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy
- (GTK_SCROLLED_WINDOW (scrolledwin),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type
- (GTK_SCROLLED_WINDOW (scrolledwin), GTK_SHADOW_IN);
+ gtk_scrolled_window_set_policy(
+ GTK_SCROLLED_WINDOW (scrolledwin),
+ GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type(
+ GTK_SCROLLED_WINDOW (scrolledwin), GTK_SHADOW_IN);
gtk_container_set_border_width(GTK_CONTAINER(scrolledwin), 3);
gtk_container_add(GTK_CONTAINER(scrolledwin), page->regexp_text);
@@ -111,35 +112,40 @@ static void attwarner_prefs_create_widget_func(PrefsPage * _page,
gtk_box_pack_start(GTK_BOX(vbox1), label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox1), scrolledwin, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox1), case_sensitive_checkbox, FALSE, FALSE, 0);
-
+
skip_quotes_checkbox = gtk_check_button_new_with_label(_("Lines starting with quotation marks"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(skip_quotes_checkbox),
- attwarnerprefs.skip_quotes);
+ gtk_toggle_button_set_active(
+ GTK_TOGGLE_BUTTON(skip_quotes_checkbox),
+ attwarnerprefs.skip_quotes);
gtk_box_pack_start(GTK_BOX(vbox2), skip_quotes_checkbox, FALSE, FALSE, 0);
gtk_widget_show(skip_quotes_checkbox);
CLAWS_SET_TIP(skip_quotes_checkbox,
- _("Exclude quoted lines from checking for the regular expressions above. Note that handmade quotes cannot be distinguished from quotes generated by replying."));
+ _("Exclude quoted lines from checking for the regular "
+ "expressions above. Note that handmade quotes cannot "
+ "be distinguished from quotes generated by replying."));
page->skip_quotes_checkbox = skip_quotes_checkbox;
skip_fwd_redir_checkbox = gtk_check_button_new_with_label(_("Forwarded or redirected messages"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(skip_fwd_redir_checkbox),
- attwarnerprefs.skip_forwards_and_redirections);
+ gtk_toggle_button_set_active(
+ GTK_TOGGLE_BUTTON(skip_fwd_redir_checkbox),
+ attwarnerprefs.skip_forwards_and_redirections);
gtk_box_pack_start(GTK_BOX(vbox2), skip_fwd_redir_checkbox, FALSE, FALSE, 0);
gtk_widget_show(skip_fwd_redir_checkbox);
CLAWS_SET_TIP(skip_fwd_redir_checkbox,
- _("Don't check for missing attachments when forwarding or redirecting messages"));
+ _("Don't check for missing attachments when forwarding or redirecting messages"));
page->skip_forwards_and_redirections = skip_fwd_redir_checkbox;
skip_signature_checkbox = gtk_check_button_new_with_label(_("Signatures"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(skip_signature_checkbox),
- attwarnerprefs.skip_signature);
+ attwarnerprefs.skip_signature);
gtk_box_pack_start(GTK_BOX(vbox2), skip_signature_checkbox, FALSE, FALSE, 0);
gtk_widget_show(skip_signature_checkbox);
CLAWS_SET_TIP(skip_signature_checkbox,
- _("Exclude lines from the first signature-separator onwards from checking for the regular expressions above"));
+ _("Exclude lines from the first signature-separator onwards "
+ "from checking for the regular expressions above"));
page->skip_signature = skip_signature_checkbox;
vbox = gtk_vbox_new(FALSE, VSPACING);
@@ -154,7 +160,7 @@ static void attwarner_prefs_create_widget_func(PrefsPage * _page,
gtk_container_add(GTK_CONTAINER(frame), vbox2);
gtk_widget_show_all(vbox);
-
+
page->page.widget = vbox;
}
@@ -176,15 +182,15 @@ static void attwarner_save_config(void)
return;
if (prefs_write_param(param, pfile->fp) < 0) {
- g_warning("failed to write Attach warner configuration to file");
+ g_warning("failed to write AttachWarner configuration to file");
prefs_file_close_revert(pfile);
return;
}
- if (fprintf(pfile->fp, "\n") < 0) {
+ if (fprintf(pfile->fp, "\n") < 0) {
FILE_OP_ERROR(rcpath, "fprintf");
prefs_file_close_revert(pfile);
} else
- prefs_file_close(pfile);
+ prefs_file_close(pfile);
}
@@ -195,25 +201,25 @@ static void attwarner_prefs_save_func(PrefsPage * _page)
GtkTextIter start, end;
gchar *tmp;
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(page->regexp_text));
-
+
g_free(attwarnerprefs.match_strings);
-
+
gtk_text_buffer_get_start_iter(buffer, &start);
gtk_text_buffer_get_end_iter(buffer, &end);
-
+
tmp = gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
-
+
attwarnerprefs.match_strings = g_malloc(2*strlen(tmp)+1);
pref_get_escaped_pref(attwarnerprefs.match_strings, tmp);
- attwarnerprefs.skip_quotes = gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON(page->skip_quotes_checkbox));
- attwarnerprefs.skip_forwards_and_redirections = gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON(page->skip_forwards_and_redirections));
- attwarnerprefs.skip_signature = gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON(page->skip_signature));
- attwarnerprefs.case_sensitive = gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON(page->case_sensitive_checkbox));
+ attwarnerprefs.skip_quotes = gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(page->skip_quotes_checkbox));
+ attwarnerprefs.skip_forwards_and_redirections = gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(page->skip_forwards_and_redirections));
+ attwarnerprefs.skip_signature = gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(page->skip_signature));
+ attwarnerprefs.case_sensitive = gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(page->case_sensitive_checkbox));
attwarner_save_config();
g_free(attwarnerprefs.match_strings);
@@ -225,9 +231,9 @@ void attachwarner_prefs_init(void)
static gchar *path[3];
gchar *rcpath;
gchar *tmp;
-
+
path[0] = _("Plugins");
- path[1] = _("Attach Warner");
+ path[1] = _("AttachWarner");
path[2] = NULL;
prefs_set_default(param);
@@ -237,10 +243,10 @@ void attachwarner_prefs_init(void)
tmp = g_malloc(strlen(attwarnerprefs.match_strings)+1);
pref_get_unescaped_pref(tmp, attwarnerprefs.match_strings);
-
+
g_free(attwarnerprefs.match_strings);
attwarnerprefs.match_strings = tmp;
-
+
attwarnerprefs_page.page.path = path;
attwarnerprefs_page.page.create_widget = attwarner_prefs_create_widget_func;
attwarnerprefs_page.page.destroy_widget = attwarner_prefs_destroy_widget_func;
diff --git a/src/plugins/attachwarner/attachwarner_prefs.h b/src/plugins/attachwarner/attachwarner_prefs.h
index 8ef0e9b55..93b7215e4 100644
--- a/src/plugins/attachwarner/attachwarner_prefs.h
+++ b/src/plugins/attachwarner/attachwarner_prefs.h
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2006-2015 Ricardo Mones and the Claws Mail Team
+ * Copyright (C) 2006-2021 Ricardo Mones and the Claws Mail 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
@@ -25,11 +25,11 @@ typedef struct _AttachWarnerPrefs AttachWarnerPrefs;
struct _AttachWarnerPrefs
{
- gchar *match_strings;
- gboolean skip_quotes;
- gboolean skip_forwards_and_redirections;
- gboolean skip_signature;
- gboolean case_sensitive;
+ gchar * match_strings;
+ gboolean skip_quotes;
+ gboolean skip_forwards_and_redirections;
+ gboolean skip_signature;
+ gboolean case_sensitive;
};
extern AttachWarnerPrefs attwarnerprefs;
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list