From a01b35f59b3bcfddada8087b53e2ba7f3517eb58 Mon Sep 17 00:00:00 2001 From: "varada%netscape.com" Date: Fri, 27 Apr 2001 20:54:29 +0000 Subject: [PATCH] fix for bugs-70392-prettying send format prefs panel;52328-quitting while sending message; 71361- wrapping signature in compose;76330-focus on to field in reply;77798-UI should use Msgcompose abort and not msgsend;r=ducarroz;sr=bienvenu --- .../resources/content/pref-formatting.xul | 15 ++++++--------- mailnews/compose/public/nsIMsgCompose.idl | 3 +++ .../resources/content/MsgComposeCommands.js | 18 ++++++++++++++++-- .../content/addressingWidgetOverlay.js | 2 +- .../locale/en-US/composeMsgs.properties | 4 ++++ mailnews/compose/src/nsMsgCompose.cpp | 10 +++++++++- 6 files changed, 39 insertions(+), 13 deletions(-) diff --git a/mailnews/compose/prefs/resources/content/pref-formatting.xul b/mailnews/compose/prefs/resources/content/pref-formatting.xul index 31a7133a63d1..af42be7f5b2b 100644 --- a/mailnews/compose/prefs/resources/content/pref-formatting.xul +++ b/mailnews/compose/prefs/resources/content/pref-formatting.xul @@ -39,8 +39,6 @@ - - &sendMaildesc.label; &override.label; - + diff --git a/mailnews/compose/public/nsIMsgCompose.idl b/mailnews/compose/public/nsIMsgCompose.idl index b7c003b6e4a4..2a720caf8622 100644 --- a/mailnews/compose/public/nsIMsgCompose.idl +++ b/mailnews/compose/public/nsIMsgCompose.idl @@ -124,6 +124,9 @@ interface nsIMsgCompose : nsISupports { /* ... */ void CloseWindow(); + + /* ... */ + void Abort(); /* AttachmentPrettyName will return only the leafName if the it's a file URL. diff --git a/mailnews/compose/resources/content/MsgComposeCommands.js b/mailnews/compose/resources/content/MsgComposeCommands.js index 4211da5a2e78..5dc89e0281ca 100644 --- a/mailnews/compose/resources/content/MsgComposeCommands.js +++ b/mailnews/compose/resources/content/MsgComposeCommands.js @@ -1454,8 +1454,22 @@ function SetComposeWindowTitle(event) function ComposeCanClose() { if (sendOrSaveOperationInProgress) - return false; - + { + if (promptService) + { + var promptTitle = gComposeMsgsBundle.getString("quitComposeWindowTitle"); + var promptMsg = gComposeMsgsBundle.getString("quitComposeWindowMessage"); + if (promptService.confirm(window, promptTitle, promptMsg)) + { + msgCompose.Abort(); + return true; + } + else + { + return false; + } + } + } // Returns FALSE only if user cancels save action if (contentChanged || msgCompose.bodyModified) { diff --git a/mailnews/compose/resources/content/addressingWidgetOverlay.js b/mailnews/compose/resources/content/addressingWidgetOverlay.js index 3fa023b043ba..a41de007fd09 100644 --- a/mailnews/compose/resources/content/addressingWidgetOverlay.js +++ b/mailnews/compose/resources/content/addressingWidgetOverlay.js @@ -136,7 +136,7 @@ function CompFields2Recipients(msgCompFields, msgType) //If it's a new message, we need to add an extrat empty recipient. var msgComposeType = Components.interfaces.nsIMsgCompType; - if (msgType == msgComposeType.New || top.MAX_RECIPIENTS == 0) + if (msgType == msgComposeType.New || msgComposeType.ForwardAsAttachment || msgComposeType.ForwardInline || top.MAX_RECIPIENTS == 0) _awSetInputAndPopup("", "addr_to", newTreeChildrenNode, templateNode); dump("replacing child in comp fields 2 recips \n"); var parent = treeChildren.parentNode; diff --git a/mailnews/compose/resources/locale/en-US/composeMsgs.properties b/mailnews/compose/resources/locale/en-US/composeMsgs.properties index e895e7a99935..d2ff484e5e1c 100644 --- a/mailnews/compose/resources/locale/en-US/composeMsgs.properties +++ b/mailnews/compose/resources/locale/en-US/composeMsgs.properties @@ -204,3 +204,7 @@ SaveDialogTitle=Save Message ## LOCALIZATION NOTE (SaveDialogMsg): %1$S is folder name, %2$S is host name SaveDialogMsg=Your message has been saved to the folder %1$S on %2$S. CheckMsg=Do not show me this dialog box again. + +## Strings used by prompt when Quitting while in progress +quitComposeWindowTitle=Close Mail Window +quitComposeWindowMessage="There is mail being sent, do you want to quit now or cancel and quit after the mail is sent?" diff --git a/mailnews/compose/src/nsMsgCompose.cpp b/mailnews/compose/src/nsMsgCompose.cpp index eb4fa47ce63d..66e9e26f5a94 100644 --- a/mailnews/compose/src/nsMsgCompose.cpp +++ b/mailnews/compose/src/nsMsgCompose.cpp @@ -775,6 +775,14 @@ nsresult nsMsgCompose::CloseWindow() return rv; } +nsresult nsMsgCompose::Abort() +{ + if (mMsgSend) + mMsgSend->Abort(); + + return NS_OK; +} + nsresult nsMsgCompose::GetEditor(nsIEditorShell * *aEditor) { *aEditor = m_editor; @@ -2226,7 +2234,7 @@ nsMsgCompose::ProcessSignature(nsIMsgIdentity *identity, nsString *aMsgBody) 4.x' HTML editor, it will not be able to break this HTML sig, if quoted (for the user to interleave a comment). */ - static const char preopen[] = "
";
+  static const char      preopen[] = "
";
   static const char      preclose[] = "
"; if (imageSig)