mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Changes for bug #13098 - Reviewer: jefft
This commit is contained in:
parent
3414502b7d
commit
caeb86a08f
@ -11,6 +11,9 @@ box[name=header-part1] { background-color: #EFEFEF; border: 0px solid #EFEF
|
||||
box[name=header-part2] { background-color: #DEDEDE; border: 0px solid #DEDEDE; border-left-width: 4px; }
|
||||
box[name=header-part3] { background-color: #DEDEDE; border: 0px solid #DEDEDE; border-left-width: 4px; }
|
||||
|
||||
menubar[name=attachment-menubar] { background-color: #EFEFEF; border: 0px solid #EFEFEF; }
|
||||
menu[name=attachment-menu] { background-color: #EFEFEF; border: 0px solid #EFEFEF; }
|
||||
|
||||
/**************************************************
|
||||
* These are all the headers that are displayed
|
||||
* for the normal header display. This is accomplished
|
||||
|
@ -11,6 +11,9 @@ box[name=header-part1] { background-color: #EFEFEF; border: 0px solid #EFEF
|
||||
box[name=header-part2] { background-color: #DEDEDE; border: 0px solid #DEDEDE; border-left-width: 4px; }
|
||||
box[name=header-part3] { background-color: #DEDEDE; border: 0px solid #DEDEDE; border-left-width: 4px; }
|
||||
|
||||
menubar[name=attachment-menubar] { background-color: #EFEFEF; border: 0px solid #EFEFEF; }
|
||||
menu[name=attachment-menu] { background-color: #EFEFEF; border: 0px solid #EFEFEF; }
|
||||
|
||||
/**************************************************
|
||||
* These are all the headers that are displayed
|
||||
* for the normal header display. This is accomplished
|
||||
|
@ -11,6 +11,9 @@ box[name=header-part1] { background-color: #EFEFEF; border: 0px solid #EFEF
|
||||
box[name=header-part2] { background-color: #DEDEDE; border: 0px solid #DEDEDE; border-left-width: 4px; }
|
||||
box[name=header-part3] { background-color: #DEDEDE; border: 0px solid #DEDEDE; border-left-width: 4px; }
|
||||
|
||||
menubar[name=attachment-menubar] { background-color: #EFEFEF; border: 0px solid #EFEFEF; }
|
||||
menu[name=attachment-menu] { background-color: #EFEFEF; border: 0px solid #EFEFEF; }
|
||||
|
||||
/**************************************************
|
||||
* These are all the headers that are displayed
|
||||
* for the normal header display. This is accomplished
|
||||
|
@ -525,22 +525,14 @@ nsMimeXULEmitter::Complete()
|
||||
nsresult
|
||||
nsMimeXULEmitter::DumpAttachmentMenu()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if ( (!mAttachArray) || (mAttachArray->Count() <= 0) )
|
||||
return NS_OK;
|
||||
|
||||
// RICHIE SHERRY - Hard coded string...evil...need to use string bundle when they work on
|
||||
// non UI threads.
|
||||
char *i18nString = nsnull;
|
||||
nsresult rv;
|
||||
|
||||
if (mAttachArray->Count() == 1)
|
||||
i18nString = "Attachment";
|
||||
else
|
||||
i18nString = "Attachments";
|
||||
|
||||
char *buttonXUL = PR_smprintf(
|
||||
"<titledbutton src=\"chrome://messenger/skin/attach.gif\" value=\"%d %s\" align=\"right\" class=\"popup\" popup=\"attachmentPopup\"/>",
|
||||
mAttachArray->Count(), i18nString);
|
||||
"<titledbutton src=\"chrome://messenger/skin/attach.gif\" value=\"%d\" align=\"right\"/>",
|
||||
mAttachArray->Count());
|
||||
|
||||
if ( (!buttonXUL) || (!*buttonXUL) )
|
||||
return NS_OK;
|
||||
@ -554,16 +546,18 @@ nsMimeXULEmitter::DumpAttachmentMenu()
|
||||
// Now we can finally write out the attachment information...
|
||||
if (mAttachArray->Count() > 0)
|
||||
{
|
||||
UtilityWriteCRLF("<popup id=\"attachmentPopup\">");
|
||||
UtilityWriteCRLF("<menu>");
|
||||
PRInt32 i;
|
||||
|
||||
UtilityWriteCRLF("<menubar name=\"attachment-menubar\">");
|
||||
UtilityWriteCRLF("<menu name=\"attachment-menu\">");
|
||||
UtilityWriteCRLF(buttonXUL);
|
||||
UtilityWriteCRLF("<menupopup>");
|
||||
|
||||
for (i=0; i<mAttachArray->Count(); i++)
|
||||
{
|
||||
attachmentInfoType *attachInfo = (attachmentInfoType *)mAttachArray->ElementAt(i);
|
||||
if (!attachInfo)
|
||||
continue;
|
||||
|
||||
|
||||
UtilityWrite("<menuitem value=\"");
|
||||
UtilityWrite(attachInfo->displayName);
|
||||
UtilityWrite("\" oncommand=\"OpenAttachURL('");
|
||||
@ -577,10 +571,11 @@ nsMimeXULEmitter::DumpAttachmentMenu()
|
||||
{
|
||||
UtilityWrite(attachInfo->urlSpec);
|
||||
}
|
||||
|
||||
UtilityWrite("','");
|
||||
UtilityWrite(attachInfo->displayName);
|
||||
UtilityWrite("','");
|
||||
|
||||
|
||||
nsCOMPtr<nsIMsgMessageUrl> messageUrl = do_QueryInterface(mURL, &rv);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = messageUrl->GetURI(&urlString);
|
||||
@ -592,66 +587,12 @@ nsMimeXULEmitter::DumpAttachmentMenu()
|
||||
}
|
||||
UtilityWriteCRLF("' );\" />");
|
||||
}
|
||||
UtilityWriteCRLF("</menupopup>");
|
||||
UtilityWriteCRLF("</menu>");
|
||||
UtilityWriteCRLF("</popup>");
|
||||
|
||||
UtilityWriteCRLF("</menubar>");
|
||||
}
|
||||
|
||||
#if 1
|
||||
|
||||
// **** jefft - this is a temporary implementation
|
||||
if (mAttachArray->Count() > 0)
|
||||
{
|
||||
PRInt32 i;
|
||||
|
||||
UtilityWriteCRLF("<menubar>");
|
||||
|
||||
UtilityWriteCRLF("<menu value=\"Save Attachment(s)\">");
|
||||
UtilityWriteCRLF("<menupopup>");
|
||||
|
||||
for (i=0; i<mAttachArray->Count(); i++)
|
||||
{
|
||||
attachmentInfoType *attachInfo = (attachmentInfoType
|
||||
*)mAttachArray->ElementAt(i);
|
||||
if (!attachInfo)
|
||||
continue;
|
||||
|
||||
UtilityWrite("<menuitem value=\"");
|
||||
UtilityWrite(attachInfo->displayName);
|
||||
UtilityWrite("\" oncommand=\"OpenAttachURL('");
|
||||
escapedUrl = nsEscape(attachInfo->urlSpec, url_Path);
|
||||
if (escapedUrl)
|
||||
{
|
||||
UtilityWrite(escapedUrl);
|
||||
nsCRT::free(escapedUrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilityWrite(attachInfo->urlSpec);
|
||||
}
|
||||
UtilityWrite("','");
|
||||
UtilityWrite(attachInfo->displayName);
|
||||
UtilityWrite("','");
|
||||
|
||||
nsCOMPtr<nsIMsgMessageUrl> messageUrl = do_QueryInterface(mURL, &rv);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = messageUrl->GetURI(&urlString);
|
||||
if (NS_SUCCEEDED(rv) && urlString)
|
||||
{
|
||||
UtilityWrite(urlString);
|
||||
nsCRT::free(urlString);
|
||||
urlString = nsnull;
|
||||
}
|
||||
UtilityWriteCRLF("' );\" />");
|
||||
}
|
||||
UtilityWriteCRLF("</menupopup>");
|
||||
UtilityWriteCRLF("</menu>");
|
||||
|
||||
UtilityWriteCRLF("</menubar>");
|
||||
}
|
||||
|
||||
#endif
|
||||
UtilityWriteCRLF(buttonXUL);
|
||||
|
||||
UtilityWriteCRLF("</box>");
|
||||
PR_FREEIF(buttonXUL);
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 839 B After Width: | Height: | Size: 872 B |
Binary file not shown.
Before Width: | Height: | Size: 840 B After Width: | Height: | Size: 858 B |
Loading…
Reference in New Issue
Block a user