Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv15623/src/gui
Modified Files:
wxFiltersDialog.cpp
Log Message:
added more anti-spam filter tests
Index: wxFiltersDialog.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFiltersDialog.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -b -u -2 -r1.85 -r1.86
--- wxFiltersDialog.cpp 1 Apr 2002 21:10:24 -0000 1.85
+++ wxFiltersDialog.cpp 18 Jun 2002 14:48:12 -0000 1.86
@@ -107,13 +107,14 @@
gettext_noop("Older than"),
gettext_noop("Newer than"),
- gettext_noop("Is RBL filtered (SPAM)"),
+ gettext_noop("Seems to be SPAM"),
gettext_noop("Python"),
gettext_noop("Match RegExp"),
gettext_noop("Score above"),
- gettext_noop("Score below")
+ gettext_noop("Score below"),
+ gettext_noop("Sent to me"),
+ gettext_noop("Has 8 bit subject"),
};
-static const
-size_t ORC_TypesCount = WXSIZEOF(ORC_Types);
+static const size_t ORC_TypesCount = WXSIZEOF(ORC_Types);
static const
@@ -272,5 +273,5 @@
// ----------------------------------------------------------------------------
-// OneCritControl: a control handling one test from MFDialogSettings
+// OneCritControl: a control handling one criterium from MFDialogSettings
// ----------------------------------------------------------------------------
@@ -444,19 +445,25 @@
OneCritControl::UpdateUI()
{
- int type = m_Type->GetSelection();
- m_Argument->Enable(
- !(type == ORC_T_Always
- || type == ORC_T_IsSpam
- || type == ORC_T_Python
- )
- );
- m_Where->Enable(
- type == ORC_T_Match
- || type == ORC_T_Contains
- || type == ORC_T_MatchRegEx
- || type == ORC_T_MatchC
- || type == ORC_T_ContainsC
- || type == ORC_T_MatchRegExC
- );
+ int test = m_Type->GetSelection();
+ if ( test != -1 )
+ {
+ bool enableArg = FilterTestNeedsArgument(test);
+ if ( !enableArg )
+ {
+ // don't leave anything in this field if it's not needed for the
+ // current test
+ //
+ // NB: don't call SetValue() unconditionally because it results in
+ // another callback generated by wxGTK even if the text control is
+ // already empty!
+ if ( !m_Argument->GetValue().empty() )
+ {
+ m_Argument->SetValue("");
+ }
+ }
+
+ m_Argument->Enable(enableArg);
+ m_Where->Enable(FilterTestNeedsTarget(test));
+ }
}
----------------------------------------------------------------------------
Bringing you mounds of caffeinated joy
>>> http://thinkgeek.com/sf <<<
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates