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

Modified Files:
        wxMsgCmdProc.cpp 
Log Message:
bounce several messages at once; give more messages about what happens

Index: wxMsgCmdProc.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMsgCmdProc.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -b -u -2 -r1.22 -r1.23
--- wxMsgCmdProc.cpp    11 Jun 2002 20:22:28 -0000      1.22
+++ wxMsgCmdProc.cpp    12 Jun 2002 00:03:40 -0000      1.23
@@ -152,4 +152,6 @@
    void EditMessages(const UIdArray& selections);
 
+   void BounceMessages(const UIdArray& selections);
+
    void PrintOrPreviewMessages(const UIdArray& selections, bool preview);
    void PrintMessages(const UIdArray& selections);
@@ -788,38 +790,5 @@
 
       case WXMENU_MSG_BOUNCE:
-         {
-            // FIXME: bounce all messages, not just one
-            Message *msg = GetMessage(messages[0]);
-
-            if ( !msg )
-               break;
-
-            // TODO: should use a generic address entry control
-            String address;
-            if ( !MInputBox(&address,
-                            _("Please enter the address"),
-                            _("Bounce the message to:"),
-                            GetFrame(),
-                            "BounceAddress") )
-            {
-               // cancelled by user
-               break;
-            }
-
-            SendMessage_obj sendMsg = SendMessage::CreateResent
-                                      (
-                                       m_asmf->GetProfile(),
-                                       msg,
-                                       GetFrame()
-                                      );
-
-            sendMsg->SetAddresses(address);
-            if ( !sendMsg->SendOrQueue() )
-            {
-               ERRORMESSAGE((_("Failed to bounce the message.")));
-            }
-
-            msg->DecRef();
-         }
+         BounceMessages(messages);
          break;
 
@@ -998,4 +967,50 @@
 
       status->Monitor(t, _("Failed to retrieve messages to edit them."));
+   }
+}
+
+void
+MsgCmdProcImpl::BounceMessages(const UIdArray& messages)
+{
+   // TODO: should use a generic address entry control
+   String address;
+   if ( !MInputBox(&address,
+                   _("Please enter the address"),
+                   _("Bounce the message to:"),
+                   GetFrame(),
+                   "BounceAddress") )
+   {
+      // cancelled by user
+      return;
+   }
+
+   size_t count = messages.GetCount();
+   for ( size_t n = 0; n < count; n++ )
+   {
+      Message *msg = GetMessage(messages[n]);
+      if ( !msg )
+      {
+         ERRORMESSAGE((_("Failed to bounce the message %ld"), messages[n]));
+         continue;
+      }
+
+      SendMessage_obj sendMsg = SendMessage::CreateResent
+                                (
+                                 m_asmf->GetProfile(),
+                                 msg,
+                                 GetFrame()
+                                );
+
+      sendMsg->SetAddresses(address);
+      if ( !sendMsg->SendOrQueue() )
+      {
+         ERRORMESSAGE((_("Failed to bounce the message.")));
+      }
+      else
+      {
+         STATUSMESSAGE((_("Message bounced to '%s'."), address.c_str()));
+      }
+
+      msg->DecRef();
    }
 }


_______________________________________________________________

Multimillion Dollar Computer Inventory
Live Webcast Auctions Thru Aug. 2002 - http://www.cowanalexander.com/calendar



_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to