Changes for multipart alternative UI - Bug #: 17770 - r: jefft
git-svn-id: svn://10.0.0.236/trunk@53309 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -77,11 +77,11 @@
|
||||
<!ENTITY returnReceiptCmd.label "Return receipt">
|
||||
<!ENTITY uuEncodeCmd.label "Use uuencode instead of MIME for attachments">
|
||||
|
||||
<!ENTITY outputFormatMenu.label ".Format">
|
||||
<!ENTITY outputFormatMenu.label "Format">
|
||||
<!ENTITY askmeFormatCmd.label ".Ask me">
|
||||
<!ENTITY plainTextFormatCmd.label ".Plain Text only">
|
||||
<!ENTITY htmlFormatCmd.label ".HTML only">
|
||||
<!ENTITY bothFormatCmd.label ".Plain Text and HTML">
|
||||
<!ENTITY plainTextFormatCmd.label "Plain Text only">
|
||||
<!ENTITY htmlFormatCmd.label "HTML only">
|
||||
<!ENTITY bothFormatCmd.label "Plain Text and HTML">
|
||||
|
||||
<!ENTITY fileCarbonCopyCmd.label "File Carbon Copy">
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;}
|
||||
|
||||
|
||||
@@ -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).
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 955 B After Width: | Height: | Size: 963 B |
Binary file not shown.
|
Before Width: | Height: | Size: 879 B After Width: | Height: | Size: 887 B |
@@ -77,11 +77,11 @@
|
||||
<!ENTITY returnReceiptCmd.label "Return receipt">
|
||||
<!ENTITY uuEncodeCmd.label "Use uuencode instead of MIME for attachments">
|
||||
|
||||
<!ENTITY outputFormatMenu.label ".Format">
|
||||
<!ENTITY outputFormatMenu.label "Format">
|
||||
<!ENTITY askmeFormatCmd.label ".Ask me">
|
||||
<!ENTITY plainTextFormatCmd.label ".Plain Text only">
|
||||
<!ENTITY htmlFormatCmd.label ".HTML only">
|
||||
<!ENTITY bothFormatCmd.label ".Plain Text and HTML">
|
||||
<!ENTITY plainTextFormatCmd.label "Plain Text only">
|
||||
<!ENTITY htmlFormatCmd.label "HTML only">
|
||||
<!ENTITY bothFormatCmd.label "Plain Text and HTML">
|
||||
|
||||
<!ENTITY fileCarbonCopyCmd.label "File Carbon Copy">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user