Bug 132453 - AB: Disable properties button for multiple selected contacts. r=mconley, r=Neil, a=mkmelin landing on CLOSED TREE for seamonkey
This commit is contained in:
Родитель
4e03ac3fec
Коммит
172e855fb0
|
@ -33,7 +33,7 @@ var DirPaneController =
|
|||
case "cmd_selectAll":
|
||||
case "cmd_delete":
|
||||
case "button_delete":
|
||||
case "button_edit":
|
||||
case "cmd_properties":
|
||||
case "cmd_printcard":
|
||||
case "cmd_printcardpreview":
|
||||
case "cmd_newlist":
|
||||
|
@ -94,7 +94,7 @@ var DirPaneController =
|
|||
case "cmd_printcard":
|
||||
case "cmd_printcardpreview":
|
||||
return (GetSelectedCardIndex() != -1);
|
||||
case "button_edit":
|
||||
case "cmd_properties":
|
||||
return (GetSelectedDirectory() != null);
|
||||
case "cmd_newlist":
|
||||
selectedDir = GetSelectedDirectory();
|
||||
|
@ -123,7 +123,7 @@ var DirPaneController =
|
|||
if (gDirTree)
|
||||
AbDeleteSelectedDirectory();
|
||||
break;
|
||||
case "button_edit":
|
||||
case "cmd_properties":
|
||||
AbEditSelectedDirectory();
|
||||
break;
|
||||
case "cmd_newlist":
|
||||
|
|
|
@ -11,6 +11,8 @@ function GetAbViewListener()
|
|||
|
||||
function contactsListOnClick(event)
|
||||
{
|
||||
CommandUpdate_AddressBook();
|
||||
|
||||
// we only care about button 0 (left click) events
|
||||
if (event.button != 0)
|
||||
return;
|
||||
|
@ -55,6 +57,8 @@ function AddressBookMenuListChange()
|
|||
onEnterInSearchBar();
|
||||
else
|
||||
ChangeDirectoryByURI(document.getElementById('addressbookList').value);
|
||||
|
||||
CommandUpdate_AddressBook();
|
||||
}
|
||||
|
||||
function AbPanelOnComposerClose()
|
||||
|
@ -129,6 +133,12 @@ function UpdateCardView()
|
|||
// do nothing for ab panel
|
||||
}
|
||||
|
||||
function CommandUpdate_AddressBook()
|
||||
{
|
||||
goUpdateCommand('cmd_delete');
|
||||
goUpdateCommand('cmd_properties');
|
||||
}
|
||||
|
||||
function onEnterInSearchBar()
|
||||
{
|
||||
if (!gQueryURIFormat)
|
||||
|
|
|
@ -32,7 +32,13 @@
|
|||
<script type="application/javascript" src="chrome://messenger/content/addressbook/abResultsPane.js"/>
|
||||
<script type="application/javascript" src="chrome://messenger/content/addressbook/abContactsPanel.js"/>
|
||||
|
||||
<command id="cmd_delete" oncommand="goDoCommand('cmd_delete');"/>
|
||||
<commandset id="CommandUpdate_AddressBook"
|
||||
commandupdater="true"
|
||||
events="focus,addrbook-select"
|
||||
oncommandupdate="CommandUpdate_AddressBook()">
|
||||
<command id="cmd_delete" oncommand="goDoCommand('cmd_delete');"/>
|
||||
<command id="cmd_properties" oncommand="goDoCommand('cmd_properties');"/>
|
||||
</commandset>
|
||||
|
||||
<!-- These keys do not really run any command, but they are used to show
|
||||
the hotkeys at the corresponding menuitems -->
|
||||
|
@ -45,7 +51,7 @@
|
|||
command="cmd_delete"/>
|
||||
<menuitem label="&addrBookCardProperties.label;"
|
||||
accesskey="&addrBookCardProperties.accesskey;"
|
||||
oncommand="AbEditSelectedCard();"/>
|
||||
command="cmd_properties"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&addtoToFieldMenu.label;"
|
||||
accesskey="&addtoToFieldMenu.accesskey;"
|
||||
|
@ -82,7 +88,8 @@
|
|||
<separator class="thin"/>
|
||||
|
||||
<tree id="abResultsTree" flex="1" context="cardProperties" class="plain" sortCol="GeneratedName" persist="sortCol"
|
||||
onclick="contactsListOnClick(event);">
|
||||
onclick="contactsListOnClick(event);"
|
||||
onselect="this.view.selectionChanged(); document.commandDispatcher.updateCommands('addrbook-select');">
|
||||
<treecols>
|
||||
<!-- these column ids must match up to the mork column names, see nsIAddrDatabase.idl -->
|
||||
<treecol id="GeneratedName"
|
||||
|
|
|
@ -275,6 +275,7 @@ function CommandUpdate_AddressBook()
|
|||
{
|
||||
goUpdateCommand('cmd_delete');
|
||||
goUpdateCommand('button_delete');
|
||||
goUpdateCommand('cmd_properties');
|
||||
goUpdateCommand('cmd_newlist');
|
||||
goUpdateCommand('cmd_chatWithCard');
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
<command id="cmd_newlist" oncommand="goDoCommand('cmd_newlist');"/>
|
||||
<command id="cmd_printcardpreview" oncommand="AbPrintPreviewCard();"/>
|
||||
<command id="cmd_printcard" oncommand="AbPrintCard();"/>
|
||||
<command id="cmd_properties" oncommand="goDoCommand('button_edit');"/>
|
||||
<command id="cmd_properties" oncommand="goDoCommand('cmd_properties');" disabled="true"/>
|
||||
<command id="cmd_undo" oncommand="goDoCommand('cmd_undo')" disabled="true"/>
|
||||
<command id="cmd_redo" oncommand="goDoCommand('cmd_redo')" disabled="true"/>
|
||||
<command id="cmd_cut" oncommand="goDoCommand('cmd_cut')" disabled="true"/>
|
||||
|
@ -177,7 +177,7 @@
|
|||
<menuitem id="dirTreeContext-properties"
|
||||
label="&editButton2.label;"
|
||||
accesskey="&editButton2.accesskey;"
|
||||
oncommand="goDoCommand('button_edit');"/>
|
||||
command="cmd_properties"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="dirTreeContext-newcard" label="&newContactButton.label;"
|
||||
accesskey="&newContactButton.accesskey;" oncommand="AbNewCard();"/>
|
||||
|
@ -197,7 +197,7 @@
|
|||
<menuitem id="abResultsTreeContext-properties"
|
||||
label="&editButton2.label;"
|
||||
accesskey="&editButton2.accesskey;"
|
||||
oncommand="goDoCommand('button_edit');"/>
|
||||
command="cmd_properties"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="abResultsTreeContext-newmessage"
|
||||
label="&newmsgButton.label;"
|
||||
|
@ -564,7 +564,7 @@
|
|||
<toolbarbutton class="toolbarbutton-1" id="button-editcard"
|
||||
label="&editButton2.label;"
|
||||
tooltiptext="&editButton2.tooltip;"
|
||||
oncommand="goDoCommand('button_edit');"/>
|
||||
command="cmd_properties"/>
|
||||
<toolbarbutton class="toolbarbutton-1" id="button-newmessage" label="&newmsgButton.label;" tooltiptext="&newmsgButton.tooltip;" oncommand="AbNewMessage();"/>
|
||||
<toolbarbutton class="toolbarbutton-1" id="button-newim" label="&newIM.label;" tooltiptext="&newIM.tooltip;" command="cmd_chatWithCard"/>
|
||||
<toolbarbutton class="toolbarbutton-1" id="button-abdelete"
|
||||
|
|
|
@ -330,7 +330,7 @@ var ResultsPaneController =
|
|||
case "cmd_selectAll":
|
||||
case "cmd_delete":
|
||||
case "button_delete":
|
||||
case "button_edit":
|
||||
case "cmd_properties":
|
||||
case "cmd_newlist":
|
||||
return true;
|
||||
default:
|
||||
|
@ -377,8 +377,10 @@ var ResultsPaneController =
|
|||
}
|
||||
}
|
||||
return (enabled && (numSelected > 0));
|
||||
case "button_edit":
|
||||
return (GetSelectedCardIndex() != -1);
|
||||
case "cmd_properties":
|
||||
// While "Edit Contact" dialogue is still modal (bug 115904, bug 135126),
|
||||
// only enable "Properties" button for single selection; then fix bug 119999.
|
||||
return (GetNumSelectedCards() == 1);
|
||||
case "cmd_newlist":
|
||||
var selectedDir = GetSelectedDirectory();
|
||||
if (selectedDir) {
|
||||
|
@ -404,7 +406,7 @@ var ResultsPaneController =
|
|||
case "button_delete":
|
||||
AbDelete();
|
||||
break;
|
||||
case "button_edit":
|
||||
case "cmd_properties":
|
||||
AbEditSelectedCard();
|
||||
break;
|
||||
case "cmd_newlist":
|
||||
|
|
|
@ -29,7 +29,7 @@ var DirPaneController =
|
|||
case "cmd_selectAll":
|
||||
case "cmd_delete":
|
||||
case "button_delete":
|
||||
case "button_edit":
|
||||
case "cmd_properties":
|
||||
case "cmd_newlist":
|
||||
return true;
|
||||
default:
|
||||
|
@ -85,7 +85,7 @@ var DirPaneController =
|
|||
}
|
||||
else
|
||||
return false;
|
||||
case "button_edit":
|
||||
case "cmd_properties":
|
||||
return (GetSelectedDirectory() != null);
|
||||
case "cmd_newlist":
|
||||
selectedDir = GetSelectedDirectory();
|
||||
|
@ -112,7 +112,7 @@ var DirPaneController =
|
|||
if (gDirTree)
|
||||
AbDeleteSelectedDirectory();
|
||||
break;
|
||||
case "button_edit":
|
||||
case "cmd_properties":
|
||||
AbEditSelectedDirectory();
|
||||
break;
|
||||
case "cmd_newlist":
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
<command id="cmd_printAddressBook" oncommand="AbPrintAddressBook()"/>
|
||||
<command id="cmd_printPreviewAddressBook" oncommand="AbPrintPreviewAddressBook()"/>
|
||||
<command id="cmd_close" oncommand="AbClose()"/>
|
||||
<command id="cmd_properties" oncommand="goDoCommand('button_edit');"/>
|
||||
<command id="cmd_properties" oncommand="goDoCommand('cmd_properties');"/>
|
||||
<command id="cmd_undo"/>
|
||||
<command id="cmd_redo"/>
|
||||
<command id="cmd_copy"/>
|
||||
|
@ -455,7 +455,7 @@
|
|||
label="&editItemButton.label;"
|
||||
tooltiptext="&editItemButton.tooltip;"
|
||||
removable="true"
|
||||
oncommand="goDoCommand('button_edit');"/>
|
||||
command="cmd_properties"/>
|
||||
<toolbarbutton id="button-newmessage"
|
||||
class="toolbarbutton-1"
|
||||
label="&newmsgButton.label;"
|
||||
|
|
Загрузка…
Ссылка в новой задаче