add 'score equal to' option
authorPaul Mangan <paul@claws-mail.org>
Tue, 18 Sep 2001 11:02:34 +0000 (11:02 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 18 Sep 2001 11:02:34 +0000 (11:02 +0000)
AUTHORS
ChangeLog.claws
src/matcher.c
src/matcher.h
src/prefs_matcher.c

diff --git a/AUTHORS b/AUTHORS
index 4873150..b516e9b 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -7,6 +7,7 @@ claws-branch (http://sylpheed-claws.sourceforge.net)
 
        Hoa viet Dinh           <dinh.viet.hoa@free.fr>
        Match Grun              <match@dimensional.com>
+       Melvin Hadasht          <melvin.hadasht@free.fr>
        Christoph Hohmann       <reboot@gmx.ch>
        Alfons Hoogervorst      <alfons@proteus.demon.nl>
        Darko Koruga            <darko.koruga@hermes.si>
@@ -79,4 +80,4 @@ contributors (beside the above; based on Changelog)
        Don Quijote
        David Looney
        Eric Limpens
-       Melvin Hadasht
+       Paul Evans
index 4e1f55f..64a4aea 100644 (file)
@@ -2,7 +2,12 @@
 
        * configure.in
                change to version 0.6.2claws1
-       * sync with sylpheed 0.6.2cvs1 
+       * sync with sylpheed 0.6.2cvs1
+
+       * src/matcher.c 
+       * src/prefs_matcher.c
+               add 'score equal to' option, submitted by
+               Paul Evans <nerd@freeuk.com>
 
 2001-09-15 [christoph]
 
index 9a671c5..fdcd379 100644 (file)
@@ -79,6 +79,7 @@ static MatchParser matchparser_tab[] = {
        {MATCHING_NOT_REFERENCES, "~references"},
        {MATCHING_SCORE_GREATER, "score_greater"},
        {MATCHING_SCORE_LOWER, "score_lower"},
+       {MATCHING_SCORE_EQUAL, "score_equal"},
 
        /* content have to be read */
        {MATCHING_HEADER, "header"},
@@ -170,6 +171,7 @@ MatcherProp * matcherprop_parse(gchar ** str)
        case MATCHING_AGE_GREATER:
        case MATCHING_SCORE_LOWER:
        case MATCHING_SCORE_GREATER:
+       case MATCHING_SCORE_EQUAL:
                value = matcher_parse_number(&tmp);
                if (tmp == NULL) {
                        * str = NULL;
@@ -646,6 +648,8 @@ gboolean matcherprop_match(MatcherProp * prop, MsgInfo * info)
                return info->score >= prop->value;
        case MATCHING_SCORE_LOWER:
                return info->score <= prop->value;
+       case MATCHING_SCORE_EQUAL:
+               return info->score == prop->value;
        case MATCHING_NEWSGROUPS:
                return matcherprop_string_match(prop, info->newsgroups);
        case MATCHING_NOT_NEWSGROUPS:
@@ -1088,6 +1092,7 @@ gboolean matcherlist_match(MatcherList * matchers, MsgInfo * info)
                case MATCHING_NOT_REFERENCES:
                case MATCHING_SCORE_GREATER:
                case MATCHING_SCORE_LOWER:
+               case MATCHING_SCORE_EQUAL:
                case MATCHING_EXECUTE:
                case MATCHING_NOT_EXECUTE:
                        if (matcherprop_match(matcher, info)) {
@@ -1183,6 +1188,7 @@ gchar * matcherprop_to_string(MatcherProp * matcher)
        case MATCHING_AGE_LOWER:
        case MATCHING_SCORE_GREATER:
        case MATCHING_SCORE_LOWER:
+       case MATCHING_SCORE_EQUAL:
                return g_strdup_printf("%s %i", criteria_str, matcher->value);
                break;
        case MATCHING_ALL:
index 54d253e..1bae409 100644 (file)
@@ -44,6 +44,7 @@ enum {
        MATCHING_NOT_REFERENCES,
        MATCHING_SCORE_GREATER,
        MATCHING_SCORE_LOWER,
+       MATCHING_SCORE_EQUAL,
 
        /* file content */
        MATCHING_HEADER,
index 9cdb370..c231b1e 100644 (file)
@@ -104,8 +104,9 @@ enum {
 
        CRITERIA_SCORE_GREATER = 21,
        CRITERIA_SCORE_LOWER = 22,
+       CRITERIA_SCORE_EQUAL = 23,
 
-       CRITERIA_EXECUTE = 23
+       CRITERIA_EXECUTE = 24
 };
 
 enum {
@@ -146,6 +147,7 @@ gchar * criteria_text [] = {
        N_("Marked flag"), N_("Deleted flag"),
        N_("Replied flag"), N_("Forwarded flag"),
        N_("Score greater than"), N_("Score lower than"),
+       N_("Score equal to"),
        N_("Execute")
 };
 
@@ -769,6 +771,8 @@ static gint prefs_matcher_get_criteria_from_matching(gint matching_id)
                return CRITERIA_SCORE_GREATER;
        case MATCHING_SCORE_LOWER:
                return CRITERIA_SCORE_LOWER;
+       case MATCHING_SCORE_EQUAL:
+               return CRITERIA_SCORE_EQUAL;
        case MATCHING_NOT_EXECUTE:
        case MATCHING_EXECUTE:
                return CRITERIA_EXECUTE;
@@ -819,6 +823,8 @@ static gint prefs_matcher_get_matching_from_criteria(gint criteria_id)
                return MATCHING_SCORE_GREATER;
        case CRITERIA_SCORE_LOWER:
                return MATCHING_SCORE_LOWER;
+       case CRITERIA_SCORE_EQUAL:
+               return MATCHING_SCORE_EQUAL;
        case CRITERIA_HEADER:
                return MATCHING_HEADER;
        case CRITERIA_HEADERS_PART:
@@ -988,6 +994,7 @@ static MatcherProp * prefs_matcher_dialog_to_matcher()
        case CRITERIA_AGE_LOWER:
        case CRITERIA_SCORE_GREATER:
        case CRITERIA_SCORE_LOWER:
+       case CRITERIA_SCORE_EQUAL:
                value_str = gtk_entry_get_text(GTK_ENTRY(matcher.value_entry));
 
                if (*value_str == '\0') {
@@ -1195,6 +1202,7 @@ static void prefs_matcher_select(GtkCList *clist, gint row, gint column,
        case MATCHING_AGE_LOWER:
        case MATCHING_SCORE_GREATER:
        case MATCHING_SCORE_LOWER:
+       case MATCHING_SCORE_EQUAL:
                gtk_entry_set_text(GTK_ENTRY(matcher.value_entry), itos(prop->value));
                break;
 
@@ -1321,6 +1329,7 @@ static void prefs_matcher_criteria_select(GtkList *list,
        case CRITERIA_AGE_LOWER:
        case CRITERIA_SCORE_GREATER:
        case CRITERIA_SCORE_LOWER:
+       case CRITERIA_SCORE_EQUAL:
                gtk_widget_set_sensitive(matcher.header_combo, FALSE);
                gtk_widget_set_sensitive(matcher.header_label, FALSE);
                gtk_widget_set_sensitive(matcher.value_label, TRUE);