Bug 495242 cmd_close shouldn't be passed through the controllers for menu options. r=philringnalda

This commit is contained in:
Mark Banner 2009-05-29 10:32:54 +01:00
Родитель 7b75f3139f
Коммит e23a7d2077
5 изменённых файлов: 16 добавлений и 24 удалений

Просмотреть файл

@ -140,7 +140,6 @@ var DefaultController =
switch ( command )
{
case "cmd_createFilterFromPopup":
case "cmd_close":
case "cmd_archive":
case "button_archive":
case "cmd_reply":
@ -224,7 +223,6 @@ var DefaultController =
case "cmd_compactFolder":
case "button_compact":
case "cmd_settingsOffline":
case "cmd_close":
case "cmd_selectAll":
case "cmd_selectThread":
case "cmd_moveToFolderAgain":
@ -475,8 +473,6 @@ var DefaultController =
}
case "cmd_setFolderCharset":
return IsFolderCharsetEnabled();
case "cmd_close":
return true;
case "cmd_downloadFlagged":
return(IsFolderSelected() && MailOfflineMgr.isOnline());
case "cmd_downloadSelected":
@ -510,18 +506,6 @@ var DefaultController =
switch ( command )
{
case "cmd_close":
let tabmail = document.getElementById('tabmail');
if (tabmail.tabInfo.length == 1)
{
if (pref.getBoolPref("mail.tabs.closeWindowWithLastTab"))
window.close();
}
else
{
tabmail.removeCurrentTab();
}
break;
case "button_getNewMessages":
case "cmd_getNewMessages":
MsgGetMessage();
@ -807,6 +791,18 @@ var DefaultController =
}
};
function CloseTabOrWindow()
{
let tabmail = document.getElementById('tabmail');
if (tabmail.tabInfo.length == 1) {
if (pref.getBoolPref("mail.tabs.closeWindowWithLastTab"))
window.close();
}
else {
tabmail.removeCurrentTab();
}
}
function GetNumSelectedMessages()
{
return gDBView ? gDBView.numSelected : 0;

Просмотреть файл

@ -97,7 +97,6 @@
oncommandupdate="goUpdateMailMenuItems(this)">
<command id="cmd_getNewMessages" oncommand="goDoCommand('cmd_getNewMessages')" disabled="true"/>
<command id="cmd_close" oncommand="goDoCommand('cmd_close')"/>
<command id="cmd_open" oncommand="goDoCommand('cmd_open')"/>
<command id="cmd_file" disabled="true"/>

Просмотреть файл

@ -797,7 +797,6 @@ var MessageWindowController =
case "cmd_print":
case "cmd_printpreview":
case "cmd_printSetup":
case "cmd_close":
case "cmd_settingsOffline":
case "cmd_createFilterFromPopup":
case "cmd_createFilterFromMenu":
@ -889,7 +888,6 @@ var MessageWindowController =
return MailOfflineMgr.isOnline();
case "cmd_settingsOffline":
return IsAccountOfflineEnabled();
case "cmd_close":
case "cmd_nextMsg":
case "button_next":
case "cmd_nextUnreadMsg":
@ -946,9 +944,6 @@ var MessageWindowController =
switch ( command )
{
case "cmd_close":
window.close();
break;
case "cmd_getNewMessages":
MsgGetMessage();
break;

Просмотреть файл

@ -103,11 +103,12 @@
<commandset id="mailMarkMenuItems"/>
<commandset id="mailToolsMenuItems"/>
<commandset id="mailEditContextMenuItems"/>
<commandset id="tasksCommands"/>
<commandset id="tasksCommands"/>
<commandset id="commandKeys"/>
#ifdef XP_MACOSX
<commandset id="macWindowMenuItems"/>
<commandset id="macWindowMenuItems"/>
#endif
<command id="cmd_close" oncommand="window.close();"/>
</commandset>
<keyset id="mailKeys">

Просмотреть файл

@ -123,6 +123,7 @@
#ifdef XP_MACOSX
<commandset id="macWindowMenuItems"/>
#endif
<command id="cmd_close" oncommand="CloseTabOrWindow();"/>
</commandset>
<keyset id="mailKeys">