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

Modified Files:
        wxFiltersDialog.cpp 
Log Message:
fixed the default values of the spam dialog fields and an assert when setting the test 
type to "spam"

Index: wxFiltersDialog.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFiltersDialog.cpp,v
retrieving revision 1.90
retrieving revision 1.91
diff -b -u -2 -r1.90 -r1.91
--- wxFiltersDialog.cpp 30 Jun 2002 23:50:15 -0000      1.90
+++ wxFiltersDialog.cpp 1 Jul 2002 16:08:38 -0000       1.91
@@ -213,5 +213,4 @@
 
    // event handlers
-   void OnUpdateUI(wxUpdateUIEvent& event);
    void OnButtonMoreOrLess(wxCommandEvent& event);
    void OnProgramTextUpdate(wxCommandEvent& event);
@@ -222,4 +221,6 @@
 
 protected:
+   void DoUpdateUI();
+
    void AddOneControl();
    void RemoveOneControl();
@@ -268,6 +269,4 @@
 
 BEGIN_EVENT_TABLE(wxOneFilterDialog, wxManuallyLaidOutDialog)
-   EVT_UPDATE_UI(-1, wxOneFilterDialog::OnUpdateUI)
-
    // More/Less button
    EVT_BUTTON(Button_MoreTests, wxOneFilterDialog::OnButtonMoreOrLess)
@@ -686,15 +685,14 @@
 OneCritControl::InitSpamOptions(const String& rule)
 {
-   // this is really crude but should work in common case when there is only
-   // one spam test in the rule
-   m_checkSpamAssassin = strstr(rule, SPAM_TEST_SPAMASSASSIN) != 0;
-   m_check8bit = strstr(rule, SPAM_TEST_SUBJ8BIT) != 0;
-   m_checkKorean = strstr(rule, SPAM_TEST_KOREAN) != 0;
+   // use the default values to initialize the dialog
+   m_checkSpamAssassin = MP_SPAM_SPAM_ASSASSIN_D;
+   m_check8bit = MP_SPAM_8BIT_SUBJECT_D;
+   m_checkKorean = MP_SPAM_KOREAN_CSET_D;
 
-   m_checkXAuthWarn = strstr(rule, SPAM_TEST_XAUTHWARN) != 0;
-   m_checkHtml = strstr(rule, SPAM_TEST_HTML) != 0;
+   m_checkXAuthWarn = MP_SPAM_X_AUTH_WARN_D;
+   m_checkHtml = MP_SPAM_HTML_D;
 
 #ifdef USE_RBL
-   m_checkRBL = strstr(rule, SPAM_TEST_RBL) != 0;
+   m_checkRBL = MP_SPAM_RBL_D;
 #endif // USE_RBL
 }
@@ -1116,4 +1114,8 @@
    if ( !m_initializing )
    {
+      // show/create the appropriate controls first
+      DoUpdateUI();
+
+      // next update the program text
       MFilterDesc filterData;
       if ( DoTransferDataFromWindow(&filterData) &&
@@ -1136,5 +1138,5 @@
 
 void
-wxOneFilterDialog::OnUpdateUI(wxUpdateUIEvent& event)
+wxOneFilterDialog::DoUpdateUI()
 {
    if ( m_isSimple )
@@ -1149,6 +1151,4 @@
       m_ButtonMore->Enable(m_nControls < MAX_CONTROLS);
    }
-
-   FindWindow(wxID_OK)->Enable( m_NameCtrl->GetValue().Length() != 0 );
 }
 
@@ -1183,10 +1183,14 @@
    if ( event.GetEventObject() == m_NameCtrl )
    {
-      // avoid updating the program unnecessarily if only the filter name was
-      // changed
-      return;
-   }
+      wxWindow *btnOk = FindWindow(wxID_OK);
+      CHECK_RET( btnOk, "no [Ok] button in the dialog?" );
 
+      // the filter name can't be empty
+      btnOk->Enable( !m_NameCtrl->GetValue().empty() );
+   }
+   else
+   {
    UpdateProgram();
+   }
 }
 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to