зеркало из https://github.com/mozilla/gecko-dev.git
Added mail folder charset dialog, bug 32714, r=sspitzer@netscape.com,r=brendan@mozilla.org,sr=bienvenu.
This commit is contained in:
Родитель
3dd1ca61c0
Коммит
561bdc86b8
|
@ -668,16 +668,6 @@ function GetSelectedFolderResource()
|
|||
|
||||
}
|
||||
|
||||
function SetFolderCharset(folderResource, aCharset)
|
||||
{
|
||||
var db = GetFolderDatasource();
|
||||
|
||||
var charsetResource = RDF.GetLiteral(aCharset);
|
||||
var charsetProperty = RDF.GetResource("http://home.netscape.com/NC-rdf#Charset");
|
||||
|
||||
db.Assert(folderResource, charsetProperty, charsetResource, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function ToggleMessageRead(treeItem)
|
||||
|
|
|
@ -208,6 +208,7 @@ var DefaultController =
|
|||
case "cmd_saveAsFile":
|
||||
case "cmd_saveAsTemplate":
|
||||
case "cmd_viewPageSource":
|
||||
case "cmd_setFolderCharset":
|
||||
case "cmd_reload":
|
||||
case "cmd_getNewMessages":
|
||||
case "cmd_getNextNMessages":
|
||||
|
@ -325,6 +326,8 @@ var DefaultController =
|
|||
return IsEmptyTrashEnabled();
|
||||
case "cmd_compactFolder":
|
||||
return IsCompactFolderEnabled();
|
||||
case "cmd_setFolderCharset":
|
||||
return IsFolderCharsetEnabled();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -436,6 +439,9 @@ var DefaultController =
|
|||
case "cmd_viewPageSource":
|
||||
MsgViewPageSource();
|
||||
return;
|
||||
case "cmd_setFolderCharset":
|
||||
MsgSetFolderCharset();
|
||||
return;
|
||||
case "cmd_reload":
|
||||
MsgReload();
|
||||
return;
|
||||
|
@ -536,6 +542,7 @@ function CommandUpdate_Mail()
|
|||
goUpdateCommand('cmd_expandAllThreads');
|
||||
goUpdateCommand('cmd_collapseAllThreads');
|
||||
goUpdateCommand('cmd_renameFolder');
|
||||
goUpdateCommand('cmd_setFolderCharset');
|
||||
goUpdateCommand('cmd_getNewMessages');
|
||||
goUpdateCommand('cmd_getNextNMessages');
|
||||
goUpdateCommand('cmd_find');
|
||||
|
@ -749,6 +756,11 @@ function IsRenameFolderEnabled()
|
|||
|
||||
}
|
||||
|
||||
function IsFolderCharsetEnabled()
|
||||
{
|
||||
return IsFolderSelected();
|
||||
}
|
||||
|
||||
function IsViewNavigationItemEnabled()
|
||||
{
|
||||
return IsFolderSelected();
|
||||
|
|
|
@ -105,6 +105,7 @@ Rights Reserved.
|
|||
<broadcaster id="cmd_saveAsFile" oncommand="goDoCommand('cmd_saveAsFile')" disabled="true"/>
|
||||
<broadcaster id="cmd_saveAsTemplate" oncommand="goDoCommand('cmd_saveAsTemplate')" disabled="true"/>
|
||||
<broadcaster id="cmd_viewPageSource" oncommand="goDoCommand('cmd_viewPageSource')" disabled="true"/>
|
||||
<broadcaster id="cmd_setFolderCharset" oncommand="goDoCommand('cmd_setFolderCharset')" />
|
||||
<broadcaster id="cmd_reload" oncommand="goDoCommand('cmd_reload')" disabled="true"/>
|
||||
<broadcaster id="cmd_getNewMessages" oncommand="goDoCommand('cmd_getNewMessages')" disabled="true"/>
|
||||
<broadcaster id="cmd_getNextNMessages" oncommand="goDoCommand('cmd_getNextNMessages')" disabled="true"/>
|
||||
|
@ -786,6 +787,7 @@ Rights Reserved.
|
|||
<menuseparator/>
|
||||
<menuitem value="&pageSourceCmd.label;" key="key_viewPageSource" accesskey="&pageSourceCmd.accesskey;" observes="cmd_viewPageSource"/>
|
||||
<menuseparator/>
|
||||
<menuitem value="&folderCharset.label;" accesskey="&folderCharset.accesskey;" observes="cmd_setFolderCharset"/>
|
||||
<menu id = "mailviewCharsetMenu" />
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
|
|
@ -310,4 +310,39 @@ function LastToClose()
|
|||
return false;
|
||||
}
|
||||
|
||||
function MsgSetFolderCharset()
|
||||
{
|
||||
var preselectedURI = GetSelectedFolderURI();
|
||||
var selectedFolder = GetResourceFromUri(preselectedURI);
|
||||
var msgFolder = selectedFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
|
||||
|
||||
// dump("preselectedURI = " + preselectedURI + "\n");
|
||||
var dialog = window.openDialog(
|
||||
"chrome://messenger/content/folderCharsetDialog.xul",
|
||||
"",
|
||||
"chrome,centerscreen,titlebar,modal",
|
||||
{preselectedURI: preselectedURI,
|
||||
okCallback: SetFolderCharset,
|
||||
folderCharset: msgFolder.charset,
|
||||
folderCharsetOverride: msgFolder.charsetOverride});
|
||||
}
|
||||
|
||||
function SetFolderCharset(override, charset, uri)
|
||||
{
|
||||
// dump("uri,charset,override = " + uri + "," + charset + "," + override + "\n");
|
||||
var folderTree = GetFolderTree();
|
||||
if (folderTree) {
|
||||
if (uri && charset) {
|
||||
var selectedFolder = GetResourceFromUri(uri);
|
||||
var msgFolder = selectedFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
|
||||
if (msgFolder) {
|
||||
msgFolder.charset = charset;
|
||||
msgFolder.charsetOverride = override;
|
||||
}
|
||||
|
||||
ClearThreadPane();
|
||||
ClearMessagePane();
|
||||
folderTree.clearItemSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,6 +169,8 @@ Rights Reserved.
|
|||
<!ENTITY pageSourceCmd.label "Message Source">
|
||||
<!ENTITY pageSourceCmd.accesskey "o">
|
||||
<!ENTITY pageSourceCmd.key "u">
|
||||
<!ENTITY folderCharset.label "Folder Character Coding...">
|
||||
<!ENTITY folderCharset.accesskey "f">
|
||||
<!ENTITY translateMenu.label ".Translate">
|
||||
<!ENTITY dcharMenu.label "Character Set ISO">
|
||||
<!ENTITY dcharMenu1.label "Character Set Multibyte">
|
||||
|
|
|
@ -104,6 +104,8 @@ messenger.jar:
|
|||
content/messenger/msgFolderPickerOverlay.xul (base/resources/content/msgFolderPickerOverlay.xul)
|
||||
content/messenger/renameFolderDialog.xul (base/resources/content/renameFolderDialog.xul)
|
||||
content/messenger/renameFolderDialog.js (base/resources/content/renameFolderDialog.js)
|
||||
content/messenger/folderCharsetDialog.xul (base/resources/content/folderCharsetDialog.xul)
|
||||
content/messenger/folderCharsetDialog.js (base/resources/content/folderCharsetDialog.js)
|
||||
content/messenger/messengerdnd.js (base/resources/content/messengerdnd.js)
|
||||
content/messenger/mailContextMenus.js (base/resources/content/mailContextMenus.js)
|
||||
content/messenger/msgPrintEngine.js (base/resources/content/msgPrintEngine.js)
|
||||
|
@ -176,6 +178,7 @@ en-US.jar:
|
|||
locale/en-US/messenger/folderpane.dtd (base/resources/locale/en-US/folderpane.dtd)
|
||||
locale/en-US/messenger/newFolderDialog.dtd (base/resources/locale/en-US/newFolderDialog.dtd)
|
||||
locale/en-US/messenger/renameFolderDialog.dtd (base/resources/locale/en-US/renameFolderDialog.dtd)
|
||||
locale/en-US/messenger/folderCharsetDialog.dtd (base/resources/locale/en-US/folderCharsetDialog.dtd)
|
||||
locale/en-US/messenger/folderProps.dtd (base/resources/locale/en-US/folderProps.dtd)
|
||||
locale/en-US/messenger/subscribe.dtd (base/resources/locale/en-US/subscribe.dtd)
|
||||
locale/en-US/messenger/subscribe.properties (base/resources/locale/en-US/subscribe.properties)
|
||||
|
|
Загрузка…
Ссылка в новой задаче