Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv5457/src/gui
Modified Files:
wxComposeView.cpp
Log Message:
various small but important fixes to allow posting the messages to the news
Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.265
retrieving revision 1.266
diff -b -u -2 -r1.265 -r1.266
--- wxComposeView.cpp 29 Mar 2002 00:01:11 -0000 1.265
+++ wxComposeView.cpp 29 Mar 2002 10:34:06 -0000 1.266
@@ -61,4 +61,5 @@
#include <wx/process.h>
#include <wx/mimetype.h>
+#include <wx/tokenzr.h>
#include "wx/persctrl.h"
@@ -717,4 +718,10 @@
Composer::RecipientType wxAddressTextCtrl::DoExpand(bool quiet)
{
+ // don't do anything for the newsgroups (TODO-NEWS: expand using .newsrc?)
+ if ( m_composeView->GetMode() == wxComposeView::Mode_News )
+ {
+ return Composer::Recipient_Newsgroup;
+ }
+
// try to expand the last component
String text = GetValue();
@@ -1433,7 +1440,11 @@
sizerRcpt->Add(m_txtRecipient, 1, wxEXPAND | wxALIGN_CENTRE_VERTICAL);
+ // TODO-NEWS: expanding the news groups doesn't work yet
+ if ( m_mode != Mode_News )
+ {
wxButton *btn = new wxButton(m_panel, IDB_EXPAND, "&Expand");
btn->SetToolTip(_("Expand the address using address books"));
sizerRcpt->Add(btn, 0, wxLEFT | wxALIGN_CENTRE_VERTICAL, LAYOUT_MARGIN);
+ }
sizerHeaders->Add(sizerRcpt, 1, wxEXPAND | wxALIGN_CENTRE_VERTICAL);
@@ -1453,5 +1464,5 @@
sizerTop->Add(m_panelRecipients, 1, wxEXPAND);
- // this number is completely arbitrary (FIXME)
+ // this number is completely arbitrary
sizerTop->SetItemMinSize(m_panelRecipients, 0, 80);
@@ -1676,4 +1687,17 @@
}
+ if ( addrType == Recipient_Newsgroup )
+ {
+ // tokenize the string possibly containing several newsgroups
+ wxArrayString groups = wxStringTokenize(address, ",; \t", wxTOKEN_STRTOK);
+
+ size_t count = groups.GetCount();
+ for ( size_t n = 0; n < count; n++ )
+ {
+ AddRecipient(groups[n], Recipient_Newsgroup);
+ }
+ }
+ else // email address
+ {
// split the string in addreses and add all of them
AddressList_obj addrList(address, READ_CONFIG(m_Profile, MP_HOSTNAME));
@@ -1692,4 +1716,5 @@
}
}
+ }
}
@@ -3172,5 +3197,6 @@
wxBusyCursor bc;
- wxLogStatus(this, _("Sending message..."));
+ wxLogStatus(this, m_mode == Mode_News ? _("Posting message")
+ : _("Sending message..."));
Disable();
@@ -3226,7 +3252,13 @@
// show the recipients of the message
- //
- // NB: don't show BCC as the message might be saved in the log file
String msg;
+ if ( m_mode == Mode_News )
+ {
+ msg.Printf(_("Message has been posted to %s"),
+ GetRecipients(Recipient_Newsgroup).c_str());
+ }
+ else // email message
+ {
+ // NB: don't show BCC as the message might be saved in the log file
msg.Printf(_("Message has been sent to %s"),
GetRecipients(Recipient_To).c_str());
@@ -3241,4 +3273,5 @@
{
msg += '.';
+ }
}
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates