зеркало из https://github.com/mozilla/gecko-dev.git
88171 r=bienvenu sr=sspitzer; make undo work for multiple 3 pane and/or multiple stand alone
windows.
This commit is contained in:
Родитель
3910a46d58
Коммит
38a5354a29
|
@ -675,61 +675,7 @@ function FocusRingUpdate_Mail()
|
|||
// dump('current focused element matched last focused element\n');
|
||||
}
|
||||
|
||||
function SetupUndoRedoCommand(command)
|
||||
{
|
||||
// dump ("--- SetupUndoRedoCommand: " + command + "\n");
|
||||
var canUndoOrRedo = false;
|
||||
var txnType = 0;
|
||||
|
||||
if (command == "cmd_undo")
|
||||
{
|
||||
canUndoOrRedo = messenger.CanUndo();
|
||||
txnType = messenger.GetUndoTransactionType();
|
||||
}
|
||||
else
|
||||
{
|
||||
canUndoOrRedo = messenger.CanRedo();
|
||||
txnType = messenger.GetRedoTransactionType();
|
||||
}
|
||||
|
||||
if (canUndoOrRedo)
|
||||
{
|
||||
switch (txnType)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
goSetMenuValue(command, 'valueDefault');
|
||||
break;
|
||||
case 1:
|
||||
goSetMenuValue(command, 'valueDeleteMsg');
|
||||
break;
|
||||
case 2:
|
||||
goSetMenuValue(command, 'valueMoveMsg');
|
||||
break;
|
||||
case 3:
|
||||
goSetMenuValue(command, 'valueCopyMsg');
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
goSetMenuValue(command, 'valueDefault');
|
||||
}
|
||||
return canUndoOrRedo;
|
||||
}
|
||||
|
||||
|
||||
function CommandUpdate_UndoRedo()
|
||||
{
|
||||
ShowMenuItem("menu_undo", true);
|
||||
EnableMenuItem("menu_undo", SetupUndoRedoCommand("cmd_undo"));
|
||||
ShowMenuItem("menu_redo", true);
|
||||
EnableMenuItem("menu_redo", SetupUndoRedoCommand("cmd_redo"));
|
||||
}
|
||||
|
||||
|
||||
function MessagePaneHasFocus()
|
||||
|
||||
{
|
||||
// message pane has focus if the iframe has focus OR if the message pane box
|
||||
// has focus....
|
||||
|
|
|
@ -1121,3 +1121,53 @@ function IsOfflineSettingsEnabled()
|
|||
return false;
|
||||
}
|
||||
|
||||
function CommandUpdate_UndoRedo()
|
||||
{
|
||||
ShowMenuItem("menu_undo", true);
|
||||
EnableMenuItem("menu_undo", SetupUndoRedoCommand("cmd_undo"));
|
||||
ShowMenuItem("menu_redo", true);
|
||||
EnableMenuItem("menu_redo", SetupUndoRedoCommand("cmd_redo"));
|
||||
}
|
||||
|
||||
function SetupUndoRedoCommand(command)
|
||||
{
|
||||
var canUndoOrRedo = false;
|
||||
var txnType = 0;
|
||||
|
||||
if (command == "cmd_undo")
|
||||
{
|
||||
canUndoOrRedo = messenger.CanUndo();
|
||||
txnType = messenger.GetUndoTransactionType();
|
||||
}
|
||||
else
|
||||
{
|
||||
canUndoOrRedo = messenger.CanRedo();
|
||||
txnType = messenger.GetRedoTransactionType();
|
||||
}
|
||||
|
||||
if (canUndoOrRedo)
|
||||
{
|
||||
switch (txnType)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
goSetMenuValue(command, 'valueDefault');
|
||||
break;
|
||||
case 1:
|
||||
goSetMenuValue(command, 'valueDeleteMsg');
|
||||
break;
|
||||
case 2:
|
||||
goSetMenuValue(command, 'valueMoveMsg');
|
||||
break;
|
||||
case 3:
|
||||
goSetMenuValue(command, 'valueCopyMsg');
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
goSetMenuValue(command, 'valueDefault');
|
||||
}
|
||||
return canUndoOrRedo;
|
||||
}
|
||||
|
||||
|
|
|
@ -424,6 +424,8 @@ var MessageWindowController =
|
|||
case "cmd_forwardAttachment":
|
||||
case "cmd_editAsNew":
|
||||
case "cmd_delete":
|
||||
case "cmd_undo":
|
||||
case "cmd_redo":
|
||||
case "cmd_killThread":
|
||||
case "cmd_watchThread":
|
||||
case "button_delete":
|
||||
|
@ -499,7 +501,6 @@ var MessageWindowController =
|
|||
case "cmd_forwardInline":
|
||||
case "cmd_forwardAttachment":
|
||||
case "cmd_editAsNew":
|
||||
|
||||
case "button_delete":
|
||||
case "cmd_shiftDelete":
|
||||
case "cmd_print":
|
||||
|
@ -539,6 +540,9 @@ var MessageWindowController =
|
|||
return true;
|
||||
case "cmd_findAgain":
|
||||
return MsgCanFindAgain();
|
||||
case "cmd_undo":
|
||||
case "cmd_redo":
|
||||
return SetupUndoRedoCommand(command);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -560,6 +564,12 @@ var MessageWindowController =
|
|||
case "cmd_getNewMessages":
|
||||
MsgGetMessage();
|
||||
break;
|
||||
case "cmd_undo":
|
||||
messenger.Undo(msgWindow);
|
||||
break;
|
||||
case "cmd_redo":
|
||||
messenger.Redo(msgWindow);
|
||||
break;
|
||||
case "cmd_getMsgsForAuthAccounts":
|
||||
MsgGetMessagesForAllAuthenticatedAccounts();
|
||||
break;
|
||||
|
@ -699,12 +709,8 @@ function SetupCommandUpdateHandlers()
|
|||
top.controllers.insertControllerAt(0, MessageWindowController);
|
||||
}
|
||||
|
||||
function CommandUpdate_UndoRedo()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function GetDBView()
|
||||
{
|
||||
return gDBView;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче