diff --git a/mozilla/mailnews/compose/public/nsIMsgCompFields.idl b/mozilla/mailnews/compose/public/nsIMsgCompFields.idl index 5516531a95a..7aca5bf4c18 100644 --- a/mozilla/mailnews/compose/public/nsIMsgCompFields.idl +++ b/mozilla/mailnews/compose/public/nsIMsgCompFields.idl @@ -116,6 +116,9 @@ interface nsIMsgCompFields : nsISupports { void SetUUEncodeAttachments(in boolean value); boolean GetUUEncodeAttachments(); + void SetUseMultipartAlternativeFlag(in boolean value); + boolean GetUseMultipartAlternativeFlag(); + void SetTheForcePlainText(in boolean value); boolean GetTheForcePlainText(); }; diff --git a/mozilla/mailnews/compose/resources/content/MsgComposeCommands.js b/mozilla/mailnews/compose/resources/content/MsgComposeCommands.js index a208aa83133..5d54ec70f90 100644 --- a/mozilla/mailnews/compose/resources/content/MsgComposeCommands.js +++ b/mozilla/mailnews/compose/resources/content/MsgComposeCommands.js @@ -464,7 +464,34 @@ function UUEncodeMenuSelect() function OutputFormatMenuSelect(target) { -// dump(target.getAttribute('id') + "\n"); + dump("Set Message Format to " + target.getAttribute('id') + "\n"); + if (msgCompose) + { + var msgCompFields = msgCompose.compFields; + + if (msgCompFields) + { + switch (target.getAttribute('id')) + { + case "1": + break; + case "2": + msgCompFields.SetTheForcePlainText(true); + msgCompFields.SetUseMultipartAlternativeFlag(false); + break; + case "3": + msgCompFields.SetTheForcePlainText(false); + msgCompFields.SetUseMultipartAlternativeFlag(false); + break; + case "4": + msgCompFields.SetTheForcePlainText(false); + msgCompFields.SetUseMultipartAlternativeFlag(true); + break; + default: + break; + } + } + } } function SelectAddress() diff --git a/mozilla/mailnews/compose/resources/locale/en-US/messengercompose.dtd b/mozilla/mailnews/compose/resources/locale/en-US/messengercompose.dtd index 68cc24dec4a..de7f5de9faf 100644 --- a/mozilla/mailnews/compose/resources/locale/en-US/messengercompose.dtd +++ b/mozilla/mailnews/compose/resources/locale/en-US/messengercompose.dtd @@ -77,11 +77,11 @@ - + - - - + + + diff --git a/mozilla/mailnews/compose/src/nsMsgCompFields.cpp b/mozilla/mailnews/compose/src/nsMsgCompFields.cpp index f1c5020c7f4..464de2a4d1f 100644 --- a/mozilla/mailnews/compose/src/nsMsgCompFields.cpp +++ b/mozilla/mailnews/compose/src/nsMsgCompFields.cpp @@ -483,6 +483,20 @@ nsMsgCompFields::GetTheForcePlainText(PRBool *_retval) return NS_OK; } +nsresult +nsMsgCompFields::SetUseMultipartAlternativeFlag(PRBool value) +{ + m_multipart_alt = value; + return NS_OK; +} + +nsresult +nsMsgCompFields::GetUseMultipartAlternativeFlag(PRBool *_retval) +{ + *_retval = m_multipart_alt; + return NS_OK; +} + HJ36954 { diff --git a/mozilla/mailnews/compose/src/nsMsgCompFields.h b/mozilla/mailnews/compose/src/nsMsgCompFields.h index eb3838c3800..9e75c6e866b 100644 --- a/mozilla/mailnews/compose/src/nsMsgCompFields.h +++ b/mozilla/mailnews/compose/src/nsMsgCompFields.h @@ -215,6 +215,9 @@ public: void SetForcePlainText(PRBool value) {m_force_plain_text = value;} PRBool GetForcePlainText() {return m_force_plain_text;} + NS_IMETHOD SetUseMultipartAlternativeFlag(PRBool value); + NS_IMETHOD GetUseMultipartAlternativeFlag(PRBool *_retval); + void SetUseMultipartAlternative(PRBool value) {m_multipart_alt = value;} PRBool GetUseMultipartAlternative() {return m_multipart_alt;} diff --git a/mozilla/mailnews/compose/src/nsMsgSend.cpp b/mozilla/mailnews/compose/src/nsMsgSend.cpp index fa9d31c667d..6a3f93ea4cf 100644 --- a/mozilla/mailnews/compose/src/nsMsgSend.cpp +++ b/mozilla/mailnews/compose/src/nsMsgSend.cpp @@ -687,28 +687,42 @@ nsMsgComposeAndSend::GatherMimeAttachments() // Setup the maincontainer stuff... status = maincontainer->SetType(MULTIPART_ALTERNATIVE); if (status < 0) - goto FAIL; + goto FAIL; - mpartcontainer = new nsMsgSendPart(this); - if (!mpartcontainer) - goto FAILMEM; + // Only create multipart related if its really necessary... + if (mMultipartRelatedAttachmentCount > 0) + { + mpartcontainer = new nsMsgSendPart(this); + if (!mpartcontainer) + goto FAILMEM; - status = mpartcontainer->SetType(MULTIPART_RELATED); - if (status < 0) - goto FAIL; + status = mpartcontainer->SetType(MULTIPART_RELATED); + if (status < 0) + goto FAIL; - status = mpartcontainer->AddChild(htmlpart); - if (status < 0) - goto FAIL; + status = mpartcontainer->AddChild(htmlpart); + if (status < 0) + goto FAIL; - // Hang stuff off of the maincontainer... - status = maincontainer->AddChild(plainpart); - if (status < 0) - goto FAIL; + // Hang stuff off of the maincontainer... + status = maincontainer->AddChild(plainpart); + if (status < 0) + goto FAIL; - status = maincontainer->AddChild(mpartcontainer); - if (status < 0) - goto FAIL; + status = maincontainer->AddChild(mpartcontainer); + if (status < 0) + goto FAIL; + } + else // Just a single HTML doc for the HTML mail + { + status = maincontainer->AddChild(plainpart); + if (status < 0) + goto FAIL; + + status = maincontainer->AddChild(htmlpart); + if (status < 0) + goto FAIL; + } // Create the encoder for the plaintext part here, // because we aren't the main part (attachment1). diff --git a/mozilla/mailnews/mime/emitters/resources/skin/addcard.gif b/mozilla/mailnews/mime/emitters/resources/skin/addcard.gif index ff5491e984d..4f0d3e55807 100644 Binary files a/mozilla/mailnews/mime/emitters/resources/skin/addcard.gif and b/mozilla/mailnews/mime/emitters/resources/skin/addcard.gif differ diff --git a/mozilla/mailnews/mime/emitters/resources/skin/attach.gif b/mozilla/mailnews/mime/emitters/resources/skin/attach.gif index 828ebe335fa..40cfbf24ecb 100644 Binary files a/mozilla/mailnews/mime/emitters/resources/skin/attach.gif and b/mozilla/mailnews/mime/emitters/resources/skin/attach.gif differ diff --git a/mozilla/suite/locales/en-US/chrome/mailnews/compose/messengercompose.dtd b/mozilla/suite/locales/en-US/chrome/mailnews/compose/messengercompose.dtd index 68cc24dec4a..de7f5de9faf 100644 --- a/mozilla/suite/locales/en-US/chrome/mailnews/compose/messengercompose.dtd +++ b/mozilla/suite/locales/en-US/chrome/mailnews/compose/messengercompose.dtd @@ -77,11 +77,11 @@ - + - - - + + +