Update of /cvsroot/mahogany/M/src/mail
In directory usw-pr-cvs1:/tmp/cvs-serv1332/src/mail
Modified Files:
MailFolder.cpp MailFolderCmn.cpp
Log Message:
implemented collective reply/forward
Index: MailFolder.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolder.cpp,v
retrieving revision 1.278
retrieving revision 1.279
diff -b -u -2 -r1.278 -r1.279
--- MailFolder.cpp 1 May 2002 22:11:59 -0000 1.278
+++ MailFolder.cpp 13 May 2002 00:27:39 -0000 1.279
@@ -1015,18 +1015,23 @@
}
-void
+/* static */
+Composer *
MailFolder::ReplyMessage(Message *msg,
const MailFolder::Params& params,
Profile *profile,
- wxWindow *parent)
+ wxWindow *parent,
+ Composer *cv)
{
- CHECK_RET(msg, "no message to reply to");
+ CHECK( msg, NULL, "no message to reply to");
if(! profile)
profile = mApplication->GetProfile();
- Composer *cv = Composer::CreateReplyMessage(params,
- profile,
- msg);
+ if ( !cv )
+ {
+ cv = Composer::CreateReplyMessage(params, profile, msg);
+
+ CHECK( cv, NULL, "failed to create composer" );
+ }
InitRecipients(cv, msg, params, profile);
@@ -1191,19 +1196,26 @@
cv->InitText(msg, params.msgview);
+
+ return cv;
}
/* static */
-void
+Composer *
MailFolder::ForwardMessage(Message *msg,
const MailFolder::Params& params,
Profile *profile,
- wxWindow *parent)
+ wxWindow *parent,
+ Composer *cv)
{
- CHECK_RET(msg, "no message to forward");
+ CHECK(msg, NULL, "no message to forward");
if ( !profile )
profile = mApplication->GetProfile();
- Composer *cv = Composer::CreateFwdMessage(params, profile, msg);
+ if ( !cv )
+ {
+ cv = Composer::CreateFwdMessage(params, profile, msg);
+ CHECK( cv, NULL, "failed to create composer" );
+ }
// FIXME: we shouldn't assume that all headers have the same encoding
@@ -1213,4 +1225,6 @@
DecodeHeader(msg->Subject()));
cv->InitText(msg, params.msgview);
+
+ return cv;
}
Index: MailFolderCmn.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolderCmn.cpp,v
retrieving revision 1.90
retrieving revision 1.91
diff -b -u -2 -r1.90 -r1.91
--- MailFolderCmn.cpp 10 May 2002 14:14:25 -0000 1.90
+++ MailFolderCmn.cpp 13 May 2002 00:27:39 -0000 1.91
@@ -57,8 +57,9 @@
#include <wx/datetime.h>
#include <wx/file.h>
+#include <wx/utils.h> // for wxExecute()
#include "wx/persctrl.h" // for wxPFileSelector
-#include <wx/utils.h> // for wxExecute()
+#include "Composer.h"
#include "MailFolderCmn.h"
@@ -873,4 +874,6 @@
wxWindow *parent)
{
+ Composer *composer = NULL;
+
int n = selections->Count();
for( int i = 0; i < n; i++ )
@@ -879,8 +882,11 @@
if ( msg )
{
- ReplyMessage(msg, params, GetProfile(), parent);
+ composer = ReplyMessage(msg, params, GetProfile(), parent, composer);
msg->DecRef();
}
}
+
+ if ( composer )
+ composer->Launch();
}
@@ -891,14 +897,19 @@
wxWindow *parent)
{
- int i;
- Message *msg;
+ Composer *composer = NULL;
int n = selections->Count();
- for(i = 0; i < n; i++)
+ for ( int i = 0; i < n; i++ )
{
- msg = GetMessage((*selections)[i]);
- ForwardMessage(msg, params, GetProfile(), parent);
+ Message *msg = GetMessage((*selections)[i]);
+ if ( msg )
+ {
+ composer = ForwardMessage(msg, params, GetProfile(), parent, composer);
msg->DecRef();
}
+ }
+
+ if ( composer )
+ composer->Launch();
}
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates