Bug 391701: Cleanup UI code for deleting messages; p=Bruno 'Aqualon' Escherl <aqualon@aquachan.de>, r=me, sr=neil

This commit is contained in:
mnyromyr%tprac.de 2007-08-30 19:24:45 +00:00
Родитель 3c231bd73e
Коммит 3a9325ea08
3 изменённых файлов: 24 добавлений и 67 удалений

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

@ -49,6 +49,7 @@ var FolderPaneController =
switch ( command )
{
case "cmd_delete":
case "cmd_shiftDelete":
case "button_delete":
//case "cmd_selectAll": the folder pane currently only handles single selection
case "cmd_cut":
@ -73,6 +74,7 @@ var FolderPaneController =
case "cmd_paste":
return false;
case "cmd_delete":
case "cmd_shiftDelete":
case "button_delete":
if ( command == "cmd_delete" )
goSetMenuValue(command, 'valueFolder');
@ -125,7 +127,7 @@ var FolderPaneController =
switch ( command )
{
case "cmd_delete":
case "button_delete":
case "cmd_shiftDelete":
MsgDeleteFolder();
break;
}
@ -488,27 +490,12 @@ var DefaultController =
case "cmd_createFilterFromPopup":
CreateFilter(document.popupNode);
break;
case "button_delete":
case "cmd_delete":
// if the user deletes a message before its mark as read timer goes off, we should mark it as read
// this ensures that we clear the biff indicator from the system tray when the user deletes the new message
if (gMarkViewedMessageAsReadTimer)
{
MarkCurrentMessageAsRead();
ClearPendingReadTimer();
}
SetNextMessageAfterDelete();
gDBView.doCommand(nsMsgViewCommandType.deleteMsg);
break;
case "cmd_shiftDelete":
if (gMarkViewedMessageAsReadTimer)
{
MarkCurrentMessageAsRead();
ClearPendingReadTimer();
}
SetNextMessageAfterDelete();
gDBView.doCommand(nsMsgViewCommandType.deleteNoTrash);
break;
case "cmd_delete":
MsgDeleteMessage(false);
break;
case "cmd_shiftDelete":
MsgDeleteMessage(true);
break;
case "cmd_killThread":
/* kill thread kills the thread and then does a next unread */
GoNextMessage(nsMsgNavigationType.toggleThreadKilled, true);

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

@ -907,22 +907,17 @@ function MsgGetNextNMessages()
if(folder) {
GetNextNMessages(folder);
}
}
}
}
}
function MsgDeleteMessage(reallyDelete, fromToolbar)
function MsgDeleteMessage(reallyDelete)
{
// if from the toolbar, return right away if this is a news message
// only allow cancel from the menu: "Edit | Cancel / Delete Message"
if (fromToolbar)
// if the user deletes a message before its mark as read timer goes off, we should mark it as read
// this ensures that we clear the biff indicator from the system tray when the user deletes the new message
if (gMarkViewedMessageAsReadTimer)
{
var srcFolder = GetLoadedMsgFolder();
var folderResource = srcFolder.QueryInterface(Components.interfaces.nsIRDFResource);
var uri = folderResource.Value;
if (isNewsURI(uri)) {
// if news, don't delete
return;
}
MarkCurrentMessageAsRead();
ClearPendingReadTimer();
}
SetNextMessageAfterDelete();

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

@ -583,28 +583,6 @@ function ReloadMessage()
gDBView.reloadMessage();
}
function MsgDeleteMessageFromMessageWindow(reallyDelete, fromToolbar)
{
// if from the toolbar, return right away if this is a news message
// only allow cancel from the menu: "Edit | Cancel / Delete Message"
if (fromToolbar)
{
if (isNewsURI(gCurrentFolderUri))
{
// if news, don't delete
return;
}
}
// before we delete
SetNextMessageAfterDelete();
if (reallyDelete)
gDBView.doCommand(nsMsgViewCommandType.deleteNoTrash);
else
gDBView.doCommand(nsMsgViewCommandType.deleteMsg);
}
// MessageWindowController object (handles commands when one of the trees does not have focus)
var MessageWindowController =
{
@ -851,19 +829,16 @@ var MessageWindowController =
break;
case "cmd_createFilterFromMenu":
MsgCreateFilter();
break;
case "cmd_delete":
MsgDeleteMessageFromMessageWindow(false, false);
break;
case "cmd_shiftDelete":
MsgDeleteMessageFromMessageWindow(true, false);
break;
break;
case "cmd_delete":
MsgDeleteMessage(false);
break;
case "cmd_shiftDelete":
MsgDeleteMessage(true);
break;
case "button_junk":
MsgJunk();
break;
case "button_delete":
MsgDeleteMessageFromMessageWindow(false, true);
break;
case "cmd_printSetup":
NSPrintSetup();
break;