bug 133615 : remove ISO-2022-KR/Visual Hebrew from 'Save As Charset' menu

in Composer. (r=neil, sr=jag)
This commit is contained in:
jshin%mailaps.org 2003-06-04 06:19:35 +00:00
parent 82a0a41d0d
commit 705c95a9ff
4 changed files with 53 additions and 4 deletions

View File

@ -56,7 +56,7 @@
<groupbox flex="1"><caption label="&documentCharsetTitle.label;"/>
<label value="&documentCharsetDesc.label;"/>
<tree id="CharsetTree" height="148" hidecolumnpicker="true" onselect="SelectCharset();"
datasources="rdf:charset-menu" ref="NC:DecodersRoot" flags="dont-build-content">
datasources="rdf:charset-menu" ref="NC:EncodersRoot" flags="dont-build-content">
<treecols>
<treecol id="CharsetCol" flex="1" hideheader="true"/>
</treecols>

View File

@ -26,6 +26,8 @@
##
## charset_name.notForBrowser = anything - specifies that this charset is
## not to be used in the browser
## charset_name.notForOutgoing = anything - specifies that this charset is
## not to be used for exporting files ('SaveAsCharset' in composer)
##
## charset_name.LangGroup =
##
@ -52,6 +54,27 @@ iso-8859-6-i.notForBrowser = true
ibm864i.notForBrowser = true
iso-8859-8-e.notForBrowser = true
t.61-8bit.notForOutgoing = true
utf-32le.notForOutgoing = true
utf-32be.notForOutgoing = true
utf-16le.notForOutgoing = true
utf-16be.notForOutgoing = true
x-imap4-modified-utf7.notForOutgoing = true
x-u-escaped.notForOutgoing = true
windows-936.notForOutgoing = true
us-ascii.notForOutgoing = true
x-obsoleted-euc-jp.notForOutgoing = true
x-obsoleted-iso-2022-jp.notForOutgoing = true
x-obsoleted-shift_jis.notForOutgoing = true
iso-8859-6-e.notForOutgoing = true
iso-8859-6-i.notForOutgoing = true
ibm864i.notForOutgoing = true
iso-8859-8-e.notForOutgoing = true
iso-8859-8.notForOutgoing = true
iso-2022-kr.notForOutgoing = true
x-windows-949.notForOutgoing = true
x-johab.notForOutgoing = true
adobe-symbol-encoding.LangGroup = el
big5.LangGroup = zh-TW

View File

@ -88,6 +88,7 @@ static const char kURINC_MaileditCharsetMenuRoot[] = "NC:MaileditCharsetMenuRoot
static const char kURINC_MailviewCharsetMenuRoot[] = "NC:MailviewCharsetMenuRoot";
static const char kURINC_ComposerCharsetMenuRoot[] = "NC:ComposerCharsetMenuRoot";
static const char kURINC_DecodersRoot[] = "NC:DecodersRoot";
static const char kURINC_EncodersRoot[] = "NC:EncodersRoot";
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Name);
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Checked);
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, BookmarkSeparator);
@ -162,6 +163,7 @@ private:
static nsIRDFResource * kNC_MailviewCharsetMenuRoot;
static nsIRDFResource * kNC_ComposerCharsetMenuRoot;
static nsIRDFResource * kNC_DecodersRoot;
static nsIRDFResource * kNC_EncodersRoot;
static nsIRDFResource * kNC_Name;
static nsIRDFResource * kNC_Checked;
static nsIRDFResource * kNC_CharsetDetector;
@ -428,6 +430,7 @@ nsIRDFResource * nsCharsetMenu::kNC_MaileditCharsetMenuRoot = NULL;
nsIRDFResource * nsCharsetMenu::kNC_MailviewCharsetMenuRoot = NULL;
nsIRDFResource * nsCharsetMenu::kNC_ComposerCharsetMenuRoot = NULL;
nsIRDFResource * nsCharsetMenu::kNC_DecodersRoot = NULL;
nsIRDFResource * nsCharsetMenu::kNC_EncodersRoot = NULL;
nsIRDFResource * nsCharsetMenu::kNC_Name = NULL;
nsIRDFResource * nsCharsetMenu::kNC_Checked = NULL;
nsIRDFResource * nsCharsetMenu::kNC_CharsetDetector = NULL;
@ -658,6 +661,8 @@ nsresult nsCharsetMenu::Init()
&kNC_ComposerCharsetMenuRoot);
mRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_DecodersRoot),
&kNC_DecodersRoot);
mRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_EncodersRoot),
&kNC_EncodersRoot);
mRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_Name),
&kNC_Name);
mRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_Checked),
@ -697,6 +702,8 @@ nsresult nsCharsetMenu::Init()
if (NS_FAILED(res)) goto done;
res = rdfUtil->MakeSeq(mInner, kNC_DecodersRoot, NULL);
if (NS_FAILED(res)) goto done;
res = rdfUtil->MakeSeq(mInner, kNC_EncodersRoot, NULL);
if (NS_FAILED(res)) goto done;
done:
if (rdfUtil != NULL) nsServiceManager::ReleaseService(kRDFContainerUtilsCID,rdfUtil);
@ -723,6 +730,7 @@ nsresult nsCharsetMenu::Done()
NS_IF_RELEASE(kNC_MailviewCharsetMenuRoot);
NS_IF_RELEASE(kNC_ComposerCharsetMenuRoot);
NS_IF_RELEASE(kNC_DecodersRoot);
NS_IF_RELEASE(kNC_EncodersRoot);
NS_IF_RELEASE(kNC_Name);
NS_IF_RELEASE(kNC_Checked);
NS_IF_RELEASE(kNC_CharsetDetector);
@ -843,6 +851,10 @@ nsresult nsCharsetMenu::InitMaileditMenu()
if (NS_FAILED(res)) return res;
//enumerate encoders
// this would bring in a whole bunch of 'font encoders' as well as genuine
// charset encoders, but it's safe because we rely on prefs to filter
// them out. Moreover, 'customize' menu lists only genuine charset
// encoders further guarding against 'font encoders' sneaking in.
nsCOMPtr<nsISupportsArray> maileditEncoderList;
res = mCCManager->GetEncoderList(getter_AddRefs(maileditEncoderList));
if (NS_FAILED(res)) return res;
@ -964,6 +976,16 @@ nsresult nsCharsetMenu::InitOthers()
if (NS_FAILED(res)) return res;
res = InitMoreMenu(othersDecoderList, kNC_DecodersRoot, ".notForBrowser");
if (NS_FAILED(res)) return res;
// Using mDecoderList instead of GetEncoderList(), we can avoid having to
// tag a whole bunch of 'font encoders' with '.notForOutgoing' in
// charsetData.properties file.
nsCOMPtr<nsISupportsArray> othersEncoderList;
res = mDecoderList->Clone(getter_AddRefs(othersEncoderList));
if (NS_FAILED(res)) return res;
res = InitMoreMenu(othersEncoderList, kNC_EncodersRoot, ".notForOutgoing");
if (NS_FAILED(res)) return res;
}

View File

@ -29,7 +29,11 @@ function Init()
AddRemoveLatin1('add');
}
LoadAvailableCharSets();
if (applicationArea.indexOf("mail") != -1) { // mailedit
LoadAvailableCharSets("NC:EncodersRoot");
} else { // browser, mailview, composer
LoadAvailableCharSets("NC:DecodersRoot");
}
LoadActiveCharSets();
}
@ -44,12 +48,12 @@ function readRDFString(aDS,aRes,aProp)
}
function LoadAvailableCharSets()
function LoadAvailableCharSets(converterRoot)
{
try {
var available_charsets_listbox = document.getElementById('available_charsets');
var rdf=Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
var kNC_Root = rdf.GetResource("NC:DecodersRoot");
var kNC_Root = rdf.GetResource(converterRoot);
var kNC_name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name");
var rdfDataSource = rdf.GetDataSource("rdf:charset-menu");
var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer);