display status during send unsent messages 134624 r=ducarroz, sr=sspitzer, a=asa

This commit is contained in:
bienvenu%netscape.com 2002-04-05 14:43:20 +00:00
Родитель 56a8fb0151
Коммит ca75db33eb
8 изменённых файлов: 17 добавлений и 5 удалений

Просмотреть файл

@ -93,7 +93,7 @@ interface nsIMessenger : nsISupports {
unsigned long GetRedoTransactionType();
void Undo(in nsIMsgWindow msgWindow);
void Redo(in nsIMsgWindow msgWindow);
void SendUnsentMessages(in nsIMsgIdentity aIdentity);
void sendUnsentMessages(in nsIMsgIdentity aIdentity, in nsIMsgWindow aMsgWindow);
void SetDocumentCharset(in wstring characterSet);
void saveAs(in string url, in boolean asFile, in nsIMsgIdentity identity, in nsIMsgWindow aMsgWindow);
void openAttachment(in string contentTpe, in string url, in string displayName, in string messageUri);

Просмотреть файл

@ -1456,7 +1456,7 @@ function SendUnsentMessages()
if(msgFolder) {
numMessages = msgFolder.getTotalMessages(false /* include subfolders */);
if(numMessages > 0) {
messenger.SendUnsentMessages(currentIdentity);
messenger.sendUnsentMessages(currentIdentity, msgWindow);
// right now, all identities point to the same unsent messages
// folder, so to avoid sending multiple copies of the
// unsent messages, we only call messenger.SendUnsentMessages() once

Просмотреть файл

@ -1485,7 +1485,7 @@ SendLaterListener::OnStopSending(nsresult aStatus, const PRUnichar *aMsg, PRUint
}
NS_IMETHODIMP
nsMessenger::SendUnsentMessages(nsIMsgIdentity *aIdentity)
nsMessenger::SendUnsentMessages(nsIMsgIdentity *aIdentity, nsIMsgWindow *aMsgWindow)
{
nsresult rv;
nsCOMPtr<nsIMsgSendLater> pMsgSendLater;
@ -1503,6 +1503,7 @@ nsMessenger::SendUnsentMessages(nsIMsgIdentity *aIdentity)
NS_ADDREF(sendLaterListener);
pMsgSendLater->AddListener(sendLaterListener);
pMsgSendLater->SetMsgWindow(aMsgWindow);
pMsgSendLater->SendUnsentMessages(aIdentity);
NS_RELEASE(sendLaterListener);

Просмотреть файл

@ -70,6 +70,7 @@ interface nsIMsgHdr;
interface nsIDocShell;
interface nsIFileSpec;
interface nsIMsgComposeSecure;
interface nsIMsgStatusFeedback;
typedef long nsMsgDeliverMode;
@ -213,6 +214,7 @@ interface nsIMsgSend : nsISupports
in nsMsgDeliverMode mode,
in nsIMsgDBHdr msgToReplace,
in nsIMsgSendListener aListener,
in nsIMsgStatusFeedback aStatusFeedback,
in string password
);

Просмотреть файл

@ -3246,6 +3246,9 @@ nsMsgComposeAndSend::DeliverFileAsMail()
mComposeBundle->GetStringByID(NS_MSG_SENDING_MESSAGE, getter_Copies(msg));
SetStatusMessage( msg );
nsCOMPtr<nsIMsgStatusFeedback> msgStatus (do_QueryInterface(mSendProgress));
// if the sendProgress isn't set, let's use the member variable.
if (!msgStatus)
msgStatus = do_QueryInterface(mStatusFeedback);
rv = smtpService->SendMailMessage(aFileSpec, buf, mUserIdentity,
mSmtpPassword.get(), uriListener, msgStatus,
@ -3775,6 +3778,7 @@ nsMsgComposeAndSend::SendMessageFile(
nsMsgDeliverMode mode,
nsIMsgDBHdr *msgToReplace,
nsIMsgSendListener *aListener,
nsIMsgStatusFeedback *aStatusFeedback,
const char *password
)
{
@ -3787,6 +3791,7 @@ nsMsgComposeAndSend::SendMessageFile(
if (!fields)
return NS_ERROR_INVALID_ARG;
mStatusFeedback = aStatusFeedback;
//
// First check to see if the external file we are sending is a valid file.
//

Просмотреть файл

@ -310,7 +310,7 @@ public:
nsCOMPtr<nsIDOMWindowInternal> mParentWindow;
nsCOMPtr<nsIMsgProgress> mSendProgress;
nsCOMPtr<nsIMsgSendListener> mListener;
nsCOMPtr<nsIMsgStatusFeedback> mStatusFeedback;
nsCOMPtr<nsIRequest> mRunningRequest;
PRBool mSendMailAlso;
nsIFileSpec *mReturnFileSpec; // a holder for file spec's to be returned to caller

Просмотреть файл

@ -541,6 +541,9 @@ nsCOMPtr<nsIMsgSend> pMsgSend = nsnull;
// set this object for use on completion...
sendListener->SetSendLaterObject(this);
nsCOMPtr <nsIMsgStatusFeedback> statusFeedback;
if (m_window)
m_window->GetStatusFeedback(getter_AddRefs(statusFeedback));
NS_ADDREF(this); //TODO: We should remove this!!!
rv = pMsgSend->SendMessageFile(mIdentity,
compFields, // nsIMsgCompFields *fields,
@ -550,6 +553,7 @@ nsCOMPtr<nsIMsgSend> pMsgSend = nsnull;
nsIMsgSend::nsMsgSendUnsent, // nsMsgDeliverMode mode,
nsnull, // nsIMsgDBHdr *msgToReplace,
sendListener,
statusFeedback,
nsnull);
NS_IF_RELEASE(sendListener);
return rv;