From d52a0207588b77159ed788889fada455c809fabe Mon Sep 17 00:00:00 2001 From: "ducarroz%netscape.com" Date: Tue, 17 Apr 2001 23:38:44 +0000 Subject: [PATCH] Fix for bug 76215. Need to start progressmeters even when we don't show the progress dialog. R=varada, SR=sspitzer --- mailnews/compose/src/nsMsgCompose.cpp | 4 +++- mailnews/compose/src/nsMsgComposeProgress.cpp | 9 +++++++++ mailnews/compose/src/nsMsgComposeProgress.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mailnews/compose/src/nsMsgCompose.cpp b/mailnews/compose/src/nsMsgCompose.cpp index 165f6709e15e..5a905e02c504 100644 --- a/mailnews/compose/src/nsMsgCompose.cpp +++ b/mailnews/compose/src/nsMsgCompose.cpp @@ -686,9 +686,10 @@ nsresult nsMsgCompose::SendMsg(MSG_DeliverMode deliverMode, nsIMsgIdentity *ide { mProgress->OpenProgress(m_window, (const PRUnichar*)msgSubject, deliverMode != nsIMsgSend::nsMsgDeliverNow); mProgress->GetPrompter(getter_AddRefs(prompt)); - mProgress->OnStateChange(nsnull, nsnull, nsIWebProgressListener::STATE_START, 0); } } + + mProgress->OnStateChange(nsnull, nsnull, nsIWebProgressListener::STATE_START, 0); } // i'm assuming the compose window is still up at this point... @@ -2023,6 +2024,7 @@ nsMsgDocumentStateListener::NotifyDocumentCreated(void) return compose->BuildBodyMessageAndSignature(); } } + return NS_OK; } nsresult diff --git a/mailnews/compose/src/nsMsgComposeProgress.cpp b/mailnews/compose/src/nsMsgComposeProgress.cpp index 05e6bd6a07b9..a660d5a7dd23 100644 --- a/mailnews/compose/src/nsMsgComposeProgress.cpp +++ b/mailnews/compose/src/nsMsgComposeProgress.cpp @@ -36,6 +36,8 @@ nsMsgComposeProgress::nsMsgComposeProgress() NS_INIT_ISUPPORTS(); m_closeProgress = PR_FALSE; m_processCanceled = PR_FALSE; + m_pendingStateFlags = -1; + m_pendingStateValue = 0; } nsMsgComposeProgress::~nsMsgComposeProgress() @@ -142,7 +144,11 @@ NS_IMETHODIMP nsMsgComposeProgress::RegisterListener(nsIWebProgressListener * li if (m_closeProgress || m_processCanceled) listener->OnStateChange(nsnull, nsnull, nsIWebProgressListener::STATE_STOP, 0); else + { listener->OnStatusChange(nsnull, nsnull, 0, m_pendingStatus.GetUnicode()); + if (m_pendingStateFlags != -1) + listener->OnStateChange(nsnull, nsnull, m_pendingStateFlags, m_pendingStateValue); + } } return NS_OK; @@ -162,6 +168,9 @@ NS_IMETHODIMP nsMsgComposeProgress::OnStateChange(nsIWebProgress *aWebProgress, { nsresult rv = NS_OK; + m_pendingStateFlags = aStateFlags; + m_pendingStateValue = aStatus; + if (m_listenerList) { PRUint32 count; diff --git a/mailnews/compose/src/nsMsgComposeProgress.h b/mailnews/compose/src/nsMsgComposeProgress.h index c25ca4f143b0..1328939abc94 100644 --- a/mailnews/compose/src/nsMsgComposeProgress.h +++ b/mailnews/compose/src/nsMsgComposeProgress.h @@ -42,6 +42,8 @@ private: PRBool m_closeProgress; PRBool m_processCanceled; nsString m_pendingStatus; + PRInt32 m_pendingStateFlags; + PRInt32 m_pendingStateValue; nsCOMPtr m_dialog; nsCOMPtr m_listenerList; };