Update of /cvsroot/mahogany/M/src/modules
In directory usw-pr-cvs1:/tmp/cvs-serv18123/src/modules
Modified Files:
Filters.cpp
Log Message:
show the result of applying the filters in the log window even if the progress dialog
had been shown
Index: Filters.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/Filters.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -b -u -2 -r1.123 -r1.124
--- Filters.cpp 2 Jul 2002 21:51:31 -0000 1.123
+++ Filters.cpp 2 Jul 2002 22:20:55 -0000 1.124
@@ -2746,5 +2746,7 @@
bool doExpunge = false;
- String textPD;
+ // the text for the progress dialog (verbose) and for the log (terse)
+ String textPD,
+ textLog;
size_t idx;
for ( idx = 0; idx < count; idx++ )
@@ -2783,5 +2785,5 @@
from = MailFolder::DecodeHeader(m_MailMessage->From());
- textPD.Printf(_("Filtering message %u/%u"), idx + 1, count);
+ textLog.Printf(_("Filtering message %u/%u"), idx + 1, count);
// make a multiline label for the progress dialog and a more concise
@@ -2789,29 +2791,29 @@
if ( pd )
{
- textPD << '\n'
+ textPD.clear();
+ textPD << textLog << '\n'
<< _("From: ") << from << '\n'
<< _("Subject: ") << subject;
}
- else // no progress dialog, text goes to the status bar
- {
- textPD << " (";
+
+ textLog << " (";
if ( !from.empty() )
{
- textPD << _("from ") << from << ' ';
+ textLog << _("from ") << from << ' ';
}
if ( !subject.empty() )
{
- textPD << _("about '") << subject << '\'';
+ textLog << _("about '") << subject << '\'';
}
else
{
- textPD << _("without subject");
+ textLog << _("without subject");
}
- textPD << ')';
- }
+ textLog << ')';
+ // and use both of them
if ( pd )
{
@@ -2828,5 +2830,5 @@
// don't pass it as the first argument because the string might
// contain '%' characters!
- wxLogStatus("%s", textPD.c_str());
+ wxLogStatus("%s", textLog.c_str());
}
@@ -2871,9 +2873,9 @@
// and show the result in the progress dialog
- textPD << " - ";
+ String textExtra = " - ";
if ( !retval.IsNumber() )
{
- textPD << _("error!");
+ textExtra << _("error!");
rc |= FilterRule::Error;
@@ -2884,5 +2886,5 @@
if ( !m_copiedTo.empty() )
{
- textPD << (wasDeleted ? _("moved to ") : _("copied to "))
+ textExtra << (wasDeleted ? _("moved to ") : _("copied to "))
<< m_copiedTo;
@@ -2891,26 +2893,35 @@
else if ( wasDeleted )
{
- textPD << _("deleted");
+ textExtra << _("deleted");
}
else // not moved/copied/deleted
{
- textPD << _("done");
+ textExtra << _("done");
}
}
+ textLog += textExtra;
+
m_MailMessage->DecRef();
if ( pd )
{
- if ( !pd->Update(idx, textPD) )
+ if ( !pd->Update(idx, textPD + textExtra) )
{
// cancelled by user
break;
}
+
+ // show it in the log window so that the user knows what has
+ // happened to the messages
+ //
+ // NB: textLog may contain '%'s itself, so don't let it be
+ // interpreted as a format string
+ wxLogGeneric(M_LOG_WINONLY, "%s", textLog.c_str());
}
else // no progress dialog
{
// see comment above
- wxLogStatus("%s", textPD.c_str());
+ wxLogStatus("%s", textLog.c_str());
}
}
-------------------------------------------------------
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