Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv14028/src/gui

Modified Files:
        wxFiltersDialog.cpp 
Log Message:
added spam test for the subject in caps only; fixed memory leak and a UI update 
problem in the filter editing dialog

Index: wxFiltersDialog.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFiltersDialog.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -b -u -2 -r1.91 -r1.92
--- wxFiltersDialog.cpp 1 Jul 2002 16:08:38 -0000       1.91
+++ wxFiltersDialog.cpp 4 Jul 2002 00:05:52 -0000       1.92
@@ -189,4 +189,7 @@
 // ----------------------------------------------------------------------------
 
+class OneCritControl;
+class OneActionControl;
+
 // ----------------------------------------------------------------------------
 // wxOneFilterDialog - dialog for exactly one filter rule
@@ -201,4 +204,5 @@
    // ctor & dtor
    wxOneFilterDialog(class MFilterDesc *fd, wxWindow *parent);
+   virtual ~wxOneFilterDialog();
 
    // transfer data to/from dialog
@@ -253,6 +257,6 @@
 
    size_t      m_nControls;
-   class OneCritControl *m_CritControl[MAX_CONTROLS];
-   class OneActionControl *m_ActionControl;
+   OneCritControl *m_CritControl[MAX_CONTROLS];
+   OneActionControl *m_ActionControl;
 
    wxTextCtrl *m_textProgram;
@@ -393,4 +397,5 @@
    bool m_checkSpamAssassin:1;
    bool m_check8bit:1;
+   bool m_checkCaps:1;
    bool m_checkKorean:1;
    bool m_checkXAuthWarn:1;
@@ -615,4 +620,7 @@
 #define MP_SPAM_8BIT_SUBJECT_D 1l
 
+#define MP_SPAM_CAPS_SUBJECT "SpamCapsSubject"
+#define MP_SPAM_CAPS_SUBJECT_D 1l
+
 #define MP_SPAM_KOREAN_CSET  "SpamKoreanCharset"
 #define MP_SPAM_KOREAN_CSET_D  1l
@@ -637,4 +645,5 @@
    CONFIG_ENTRY(MP_SPAM_SPAM_ASSASSIN),
    CONFIG_ENTRY(MP_SPAM_8BIT_SUBJECT),
+   CONFIG_ENTRY(MP_SPAM_CAPS_SUBJECT),
    CONFIG_ENTRY(MP_SPAM_KOREAN_CSET),
    CONFIG_ENTRY(MP_SPAM_X_AUTH_WARN),
@@ -656,6 +665,7 @@
                   "So the message is considered to be spam if it has..."),
                   wxOptionsPage::Field_Message, -1 },
-   { gettext_noop("been tagged as spam by Spam&Assassin"), wxOptionsPage::Field_Bool, 
-1 },
+   { gettext_noop("Been tagged as spam by Spam&Assassin"), wxOptionsPage::Field_Bool, 
+-1 },
    { gettext_noop("Too many &8 bit characters in subject"), 
wxOptionsPage::Field_Bool, -1 },
+   { gettext_noop("Only &capitals in subject"), wxOptionsPage::Field_Bool, -1 },
    { gettext_noop("&Korean charset"), wxOptionsPage::Field_Bool, -1 },
    { gettext_noop("X-Authentication-&Warning header"), wxOptionsPage::Field_Bool, -1 
},
@@ -688,4 +698,5 @@
    m_checkSpamAssassin = MP_SPAM_SPAM_ASSASSIN_D;
    m_check8bit = MP_SPAM_8BIT_SUBJECT_D;
+   m_checkCaps = MP_SPAM_CAPS_SUBJECT_D;
    m_checkKorean = MP_SPAM_KOREAN_CSET_D;
 
@@ -708,4 +719,5 @@
    profile->writeEntry(MP_SPAM_SPAM_ASSASSIN, m_checkSpamAssassin);
    profile->writeEntry(MP_SPAM_8BIT_SUBJECT, m_check8bit);
+   profile->writeEntry(MP_SPAM_CAPS_SUBJECT, m_checkCaps);
    profile->writeEntry(MP_SPAM_KOREAN_CSET, m_checkKorean);
    profile->writeEntry(MP_SPAM_X_AUTH_WARN, m_checkXAuthWarn);
@@ -719,4 +731,5 @@
       m_checkSpamAssassin = profile->readEntry(MP_SPAM_SPAM_ASSASSIN, 0l) != 0;
       m_check8bit = profile->readEntry(MP_SPAM_8BIT_SUBJECT, 0l) != 0;
+      m_checkCaps = profile->readEntry(MP_SPAM_CAPS_SUBJECT, 0l) != 0;
       m_checkKorean = profile->readEntry(MP_SPAM_KOREAN_CSET, 0l) != 0;
       m_checkXAuthWarn = profile->readEntry(MP_SPAM_X_AUTH_WARN, 0l) != 0;
@@ -736,4 +749,5 @@
    profile->DeleteEntry(MP_SPAM_SPAM_ASSASSIN);
    profile->DeleteEntry(MP_SPAM_8BIT_SUBJECT);
+   profile->DeleteEntry(MP_SPAM_CAPS_SUBJECT);
    profile->DeleteEntry(MP_SPAM_KOREAN_CSET);
    profile->DeleteEntry(MP_SPAM_X_AUTH_WARN);
@@ -763,4 +777,6 @@
    if ( m_check8bit )
       AddToSpamArgument(s, SPAM_TEST_SUBJ8BIT);
+   if ( m_checkCaps )
+      AddToSpamArgument(s, SPAM_TEST_SUBJCAPS);
    if ( m_checkKorean )
       AddToSpamArgument(s, SPAM_TEST_KOREAN);
@@ -1037,4 +1053,14 @@
 }
 
+wxOneFilterDialog::~wxOneFilterDialog()
+{
+   for ( size_t idx = 0; idx < m_nControls; idx++ )
+   {
+      delete m_CritControl[idx];
+   }
+
+   delete m_ActionControl;
+}
+
 void
 wxOneFilterDialog::LayoutControls()
@@ -1105,5 +1131,6 @@
 wxOneFilterDialog::RemoveOneControl()
 {
-   ASSERT(m_nControls > 1);
+   ASSERT_MSG( m_nControls > 1, "can't remove control -- no more left" );
+
    m_nControls--;
    delete m_CritControl[m_nControls];
@@ -1112,9 +1139,9 @@
 void wxOneFilterDialog::UpdateProgram()
 {
-   if ( !m_initializing )
-   {
       // show/create the appropriate controls first
       DoUpdateUI();
 
+   if ( !m_initializing )
+   {
       // next update the program text
       MFilterDesc filterData;



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to