Bug 499275 nsIMsgProgress:getPrompter always returns null - remove redundant code. r/sr=bienvenu
authorMark Banner <bugzilla@standard8.plus.com>
Fri, 19 Jun 2009 19:27:56 +0100
changeset 2892 739481e2e5cce34afeb8509953750c623f7f2fa7
parent 2891 1fbbd90413d9181fe0bfd16ac5a8341fc2bfe607
child 2893 9b0a71e2f69851f51381ed384f533b91c9addf0c
push idunknown
push userunknown
push dateunknown
bugs499275
Bug 499275 nsIMsgProgress:getPrompter always returns null - remove redundant code. r/sr=bienvenu
mailnews/base/public/nsIMsgProgress.idl
mailnews/base/src/nsMsgProgress.cpp
mailnews/base/src/nsMsgProgress.h
mailnews/compose/public/nsIMsgComposeProgress.idl
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsMsgSend.cpp
--- a/mailnews/base/public/nsIMsgProgress.idl
+++ b/mailnews/base/public/nsIMsgProgress.idl
@@ -38,17 +38,17 @@
 #include "nsISupports.idl"
 #include "domstubs.idl"
 #include "nsIPrompt.idl"
 #include "nsIWebProgressListener.idl"
 
 interface nsIDOMWindowInternal;
 interface nsIMsgWindow;
 
-[scriptable, uuid(892A9E47-853A-454A-8B02-94A7521D046D)]
+[scriptable, uuid(5aae7f1b-95f1-422e-86d5-2b1d599e2ccf)]
 interface nsIMsgProgress: nsIWebProgressListener {
 
   /** 
    * Open the progress dialog, you can specify parameters through an xpcom object
    */
   void openProgressDialog(in nsIDOMWindowInternal parent, 
                           in nsIMsgWindow aMsgWindow, 
                           in string dialogURL, 
@@ -59,18 +59,15 @@ interface nsIMsgProgress: nsIWebProgress
   void closeProgressDialog(in boolean forceClose);
   
   /* Register a Web Progress Listener */
   void registerListener(in nsIWebProgressListener listener);
 
   /* Unregister a Web Progress Listener */
   void unregisterListener(in nsIWebProgressListener listener);
   
-  /* Retrieve the prompter, needed to display modal dialog on top of progress dialog */
-  nsIPrompt getPrompter();
-
   /* Indicated if the user asked to cancel the current process */
   attribute boolean processCanceledByUser;
 
   attribute nsIMsgWindow msgWindow;
 };
 
 
--- a/mailnews/base/src/nsMsgProgress.cpp
+++ b/mailnews/base/src/nsMsgProgress.cpp
@@ -83,17 +83,16 @@ NS_IMETHODIMP nsMsgProgress::OpenProgres
   nsresult rv;
   
   if (aMsgWindow)
   {
     SetMsgWindow(aMsgWindow);
     aMsgWindow->SetStatusFeedback(this);
   }
   
-  NS_ENSURE_TRUE(!m_dialog, NS_ERROR_ALREADY_INITIALIZED);
   NS_ENSURE_ARG_POINTER(dialogURL);
   NS_ENSURE_ARG_POINTER(parent);
   
   // Set up window.arguments[0]...
   nsCOMPtr<nsISupportsArray> array;
   rv = NS_NewISupportsArray(getter_AddRefs(array));
   NS_ENSURE_SUCCESS(rv, rv);
   
@@ -122,24 +121,16 @@ NS_IMETHODIMP nsMsgProgress::OpenProgres
 
 /* void closeProgressDialog (in boolean forceClose); */
 NS_IMETHODIMP nsMsgProgress::CloseProgressDialog(PRBool forceClose)
 {
   m_closeProgress = PR_TRUE;
   return OnStateChange(nsnull, nsnull, nsIWebProgressListener::STATE_STOP, forceClose ? NS_ERROR_FAILURE : NS_OK);
 }
 
-/* nsIPrompt GetPrompter (); */
-NS_IMETHODIMP nsMsgProgress::GetPrompter(nsIPrompt **_retval)
-{
-  NS_ENSURE_ARG_POINTER(_retval);
-  *_retval = nsnull;
-  return (! m_closeProgress && m_dialog) ? m_dialog->GetPrompter(_retval) : NS_ERROR_FAILURE;
-}
-
 /* attribute boolean processCanceledByUser; */
 NS_IMETHODIMP nsMsgProgress::GetProcessCanceledByUser(PRBool *aProcessCanceledByUser)
 {
   NS_ENSURE_ARG_POINTER(aProcessCanceledByUser);
   *aProcessCanceledByUser = m_processCanceled;
   return NS_OK;
 }
 NS_IMETHODIMP nsMsgProgress::SetProcessCanceledByUser(PRBool aProcessCanceledByUser)
--- a/mailnews/base/src/nsMsgProgress.h
+++ b/mailnews/base/src/nsMsgProgress.h
@@ -68,14 +68,13 @@ public:
 private:
   nsresult ReleaseListeners(void);
   
   PRBool                             m_closeProgress;
   PRBool                             m_processCanceled;
   nsString                           m_pendingStatus;
   PRInt32                            m_pendingStateFlags;
   PRInt32                            m_pendingStateValue;
-  nsCOMPtr<nsIDOMWindowInternal>     m_dialog;
   nsWeakPtr                          m_msgWindow;
   nsCOMArray<nsIWebProgressListener> m_listenerList;
 };
 
 #endif  // nsMsgProgress_h_
deleted file mode 100644
--- a/mailnews/compose/public/nsIMsgComposeProgress.idl
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-#include "nsISupports.idl"
-#include "domstubs.idl"
-#include "nsIPrompt.idl"
-#include "nsIWebProgressListener.idl"
-
-interface nsIDOMWindowInternal;
-
-[scriptable, uuid(2080d500-149e-11d5-9daa-e276a42bc27c)]
-interface nsIMsgComposeProgress: nsIWebProgressListener {
-
-  /* Open the progress widget, usually it's a dialog
-     you can specify the subject of the message,
-     and specify if it a save or send operation
-  */
-  void openProgress(in nsIDOMWindowInternal parent, in wstring subject, in boolean itsASaveOperation);
-  
-  /* Close the progress widget, usually it's a dialog */
-  void closeProgress(in boolean forceClose);
-  
-  /* Register a Web Progress Listener */
-  void registerListener(in nsIWebProgressListener listener);
-
-  /* Unregister a Web Progress Listener */
-  void unregisterListener(in nsIWebProgressListener listener);
-  
-  /* Retrieve the prompter, needed to display modal dialog on top of progress dialog */
-  nsIPrompt getPrompter();
-
-  /* Indicated if the user asked to cancel the current process */
-  attribute boolean processCanceledByUser;
-};
-
-
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -1173,18 +1173,16 @@ NS_IMETHODIMP nsMsgCompose::SendMsg(MSG_
             return NS_ERROR_FAILURE;
 
           params->SetSubject(msgSubject.get());
           params->SetDeliveryMode(deliverMode);
 
           mProgress->OpenProgressDialog(m_window, aMsgWindow, 
                                         "chrome://messenger/content/messengercompose/sendProgress.xul", 
                                         PR_FALSE, params);
-          
-          mProgress->GetPrompter(getter_AddRefs(prompt));
         }
       }
     }
 
     mProgress->OnStateChange(nsnull, nsnull, nsIWebProgressListener::STATE_START, NS_OK);
   }
 
   PRBool attachVCard = PR_FALSE;
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -372,23 +372,16 @@ nsMsgComposeAndSend::~nsMsgComposeAndSen
 
 NS_IMETHODIMP nsMsgComposeAndSend::GetDefaultPrompt(nsIPrompt ** aPrompt)
 {
   NS_ENSURE_ARG(aPrompt);
   *aPrompt = nsnull;
 
   nsresult rv = NS_OK;
 
-  if (mSendProgress)
-  {
-    rv = mSendProgress->GetPrompter(aPrompt);
-    if (NS_SUCCEEDED(rv) && *aPrompt)
-      return NS_OK;
-  }
-
   if (mParentWindow)
   {
     rv = mParentWindow->GetPrompter(aPrompt);
     if (NS_SUCCEEDED(rv) && *aPrompt)
       return NS_OK;
   }
 
   /* If we cannot find a prompter, try the mail3Pane window */