Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31699/src/gui

Modified Files:
        wxFiltersDialog.cpp 
Log Message:
added code to configure isspam() filter function argument

Index: wxFiltersDialog.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFiltersDialog.cpp,v
retrieving revision 1.122
retrieving revision 1.123
diff -b -u -2 -r1.122 -r1.123
--- wxFiltersDialog.cpp 11 Jul 2004 21:43:39 -0000      1.122
+++ wxFiltersDialog.cpp 12 Jul 2004 00:33:37 -0000      1.123
@@ -45,4 +45,5 @@
 #include "MailFolder.h"
 #include "MModule.h"
+#include "SpamFilter.h"
 
 #include "gui/wxBrowseButton.h"
@@ -498,5 +499,8 @@
       switch ( test )
       {
-         // message flags are decoded separately
+         // spam tests or message flags are decoded separately
+         case ORC_T_IsSpam:
+            return m_spamOptions;
+
          case ORC_T_HasFlag:
             switch ( m_choiceFlags->GetSelection() )
@@ -532,11 +536,7 @@
 private:
    // create the spam button and position it correctly
-   void CreateSpamButton(const String& rule);
-
-   // initialize m_checkXXX vars(called from CreateSpamButton())
-   void InitSpamOptions(const String& rule);
+   void CreateSpamButton();
 
    // the controls which are always shown
-
    wxCheckBox *m_Not;      // invert the condition if checked
    wxChoice   *m_Logical;  // corresponds to ORC_Logical
@@ -553,4 +553,7 @@
    // the parent for all these controls
    wxWindow   *m_Parent;
+
+   // the spam options (only used if m_btnSpam != NULL)
+   String m_spamOptions;
 };
 
@@ -701,10 +704,8 @@
 
 void
-OneCritControl::CreateSpamButton(const String& rule)
+OneCritControl::CreateSpamButton()
 {
    ASSERT_MSG( !m_btnSpam, _T("CreateSpamButton() called twice?") );
 
-   InitSpamOptions(rule);
-
    m_btnSpam = new CritDetailsButton(m_Parent, this);
 
@@ -745,6 +746,10 @@
    m_Where->Show(enable_target);
    m_Where->Enable(enable_target);
-   if ( enable_isspam && ! m_btnSpam )
-      CreateSpamButton(textProgram->GetValue());
+   if ( enable_isspam && !m_btnSpam )
+   {
+      CreateSpamButton();
+      m_spamOptions = m_Argument->GetValue();
+   }
+
    if ( m_btnSpam )
    {
@@ -803,18 +808,7 @@
 
 void
-OneCritControl::InitSpamOptions(const String& /* rule */)
-{
-#if 0
-   CHECK_RET( m_Argument, _T("no argument control in the spam test?") );
-
-   m_spam->FromString(m_Argument->GetValue());
-#endif
-}
-
-void
 OneCritControl::ShowDetails()
 {
-#if 0
-   if ( m_spam->ShowDialog(GetFrame(m_Parent)) )
+   if ( SpamFilter::Configure(GetFrame(m_Parent), &m_spamOptions) )
    {
       wxOneFilterDialog *dlg =
@@ -825,5 +819,4 @@
    }
    //else: cancelled
-#endif // 0
 }
 



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to