diff --git a/mozilla/mailnews/base/public/nsIMsgWindow.idl b/mozilla/mailnews/base/public/nsIMsgWindow.idl index 0ce64842ba0..b77391b5dda 100644 --- a/mozilla/mailnews/base/public/nsIMsgWindow.idl +++ b/mozilla/mailnews/base/public/nsIMsgWindow.idl @@ -35,10 +35,20 @@ interface nsIAuthPrompt; * This interface can be used to set data specific to a window. */ +/* nsIMsgMessagePaneController is used to control the visiblity of the message pane + including the header overlay and the body. +*/ + +[scriptable, uuid(923DE63D-EEB9-4574-850B-322C1A4667ED)] +interface nsIMsgMessagePaneController : nsISupports { + void clearMsgPane(); +}; + [scriptable, uuid(BD85A416-5433-11d3-8AC5-0060B0FC04D2)] interface nsIMsgWindow : nsISupports { + attribute nsIMsgMessagePaneController messagePaneController; attribute nsIMsgStatusFeedback statusFeedback; attribute nsIMsgHeaderSink msgHeaderSink; attribute nsITransactionManager transactionManager; diff --git a/mozilla/mailnews/base/resources/content/mail-offline.js b/mozilla/mailnews/base/resources/content/mail-offline.js index eba81b55a0d..9caca20f48e 100644 --- a/mozilla/mailnews/base/resources/content/mail-offline.js +++ b/mozilla/mailnews/base/resources/content/mail-offline.js @@ -27,6 +27,7 @@ var gOfflineManager; function MailOfflineStateChanged(goingOffline) { // tweak any mail UI here that needs to change when we go offline or come back online + gFolderJustSwitched = true; } function MsgSettingsOffline() diff --git a/mozilla/mailnews/base/resources/content/mailWindow.js b/mozilla/mailnews/base/resources/content/mailWindow.js index fc45561de3c..0bf0616fde9 100644 --- a/mozilla/mailnews/base/resources/content/mailWindow.js +++ b/mozilla/mailnews/base/resources/content/mailWindow.js @@ -31,6 +31,7 @@ var msgWindowContractID = "@mozilla.org/messenger/msgwindow;1"; var messenger; var pref; var statusFeedback; +var messagePaneController; var msgWindow; var msgComposeService; @@ -165,6 +166,7 @@ function CreateMailWindowGlobals() function InitMsgWindow() { + msgWindow.messagePaneController = new nsMessagePaneController(); msgWindow.statusFeedback = statusFeedback; msgWindow.msgHeaderSink = messageHeaderSink; msgWindow.SetDOMWindow(window); @@ -393,6 +395,25 @@ nsMsgWindowCommands.prototype = } } +function nsMessagePaneController() +{ +} + +nsMessagePaneController.prototype = +{ + QueryInterface : function(iid) + { + if(iid.equals(Components.interfaces.nsIMsgMessagePaneController)) + return this; + throw Components.results.NS_NOINTERFACE; + return null; + }, + clearMsgPane: function() + { + ClearMessagePane(); + } +} + function StopUrls() { msgWindow.StopUrls(); diff --git a/mozilla/mailnews/base/src/nsMsgWindow.cpp b/mozilla/mailnews/base/src/nsMsgWindow.cpp index 84caab0fdbf..ba3c29fdd5b 100644 --- a/mozilla/mailnews/base/src/nsMsgWindow.cpp +++ b/mozilla/mailnews/base/src/nsMsgWindow.cpp @@ -138,8 +138,7 @@ NS_IMETHODIMP nsMsgWindow::SelectMessage(const char *messageUri) NS_IMETHODIMP nsMsgWindow::CloseWindow() { nsresult rv = NS_OK; - nsCOMPtr dispatcher = - do_GetService(NS_URI_LOADER_CONTRACTID, &rv); + nsCOMPtr dispatcher = do_GetService(NS_URI_LOADER_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) rv = dispatcher->UnRegisterContentListener(this); @@ -149,6 +148,8 @@ NS_IMETHODIMP nsMsgWindow::CloseWindow() if (mStatusFeedback) mStatusFeedback->CloseWindow(); + mMsgPaneController = nsnull; + StopUrls(); nsCOMPtr rootShell(do_QueryReferent(mRootDocShellWeak)); @@ -192,6 +193,21 @@ NS_IMETHODIMP nsMsgWindow::SetStatusFeedback(nsIMsgStatusFeedback * aStatusFeedb return NS_OK; } +NS_IMETHODIMP nsMsgWindow::GetMessagePaneController(nsIMsgMessagePaneController * * aMsgPaneController) +{ + NS_ENSURE_ARG(aMsgPaneController); + + *aMsgPaneController = mMsgPaneController; + NS_IF_ADDREF(*aMsgPaneController); + return NS_OK; +} + +NS_IMETHODIMP nsMsgWindow::SetMessagePaneController(nsIMsgMessagePaneController * aMsgPaneController) +{ + mMsgPaneController = aMsgPaneController; + return NS_OK; +} + NS_IMETHODIMP nsMsgWindow::GetMsgHeaderSink(nsIMsgHeaderSink * *aMsgHdrSink) { if(!aMsgHdrSink) @@ -517,6 +533,9 @@ nsMsgWindow::DisplayHTMLInMessagePane(const PRUnichar *title, const PRUnichar *b { nsresult rv; + if (mMsgPaneController) + mMsgPaneController->ClearMsgPane(); + nsString htmlStr; htmlStr.Append(NS_LITERAL_STRING("").get()); htmlStr.Append(body);