add 'Edit Metadata' menu entry

This commit is contained in:
Rolux 2016-01-05 14:02:07 +05:30
parent 9fcb7876ae
commit a00915a27d

View file

@ -430,6 +430,10 @@ oml.ui.mainMenu = function() {
oml.UI.set({listSelection: []}); oml.UI.set({listSelection: []});
oml.reloadList(); oml.reloadList();
}); });
} else if (data.id == 'editmetadata') {
(oml.$ui.editDialog || (
oml.$ui.editDialog = oml.ui.editDialog()
)).open();
} else if (data.id == 'undo') { } else if (data.id == 'undo') {
fromMenu = true; fromMenu = true;
oml.undoHistory(); oml.undoHistory();
@ -599,6 +603,8 @@ oml.ui.mainMenu = function() {
selectionItemName = ( selectionItemName = (
selectionItems > 1 ? Ox.formatNumber(selectionItems) + ' ' : '' selectionItems > 1 ? Ox.formatNumber(selectionItems) + ' ' : ''
) + Ox._(selectionItems == 1 ? 'Book' : 'Books'), ) + Ox._(selectionItems == 1 ? 'Book' : 'Books'),
editItemName = Ox.formatNumber(selectionItems) + ' '
+ Ox._(selectionItems == 1 ? 'Book' : 'Books'),
clipboardItems = oml.clipboard.items(), clipboardItems = oml.clipboard.items(),
clipboardType = oml.clipboard.type(), clipboardType = oml.clipboard.type(),
clipboardItemName = !clipboardItems ? '' clipboardItemName = !clipboardItems ? ''
@ -612,6 +618,7 @@ oml.ui.mainMenu = function() {
canPaste = listData.editable && clipboardItems, canPaste = listData.editable && clipboardItems,
canAdd = canCopy && clipboardItems && clipboardType == 'book', canAdd = canCopy && clipboardItems && clipboardType == 'book',
canDelete = listData.user == '' && selectionItems, canDelete = listData.user == '' && selectionItems,
canEdit = listData.user == '' && selectionItems,
historyItems = oml.history.items(), historyItems = oml.history.items(),
undoText = oml.history.undoText(), undoText = oml.history.undoText(),
redoText = oml.history.redoText(); redoText = oml.history.redoText();
@ -702,6 +709,13 @@ oml.ui.mainMenu = function() {
keyboard: 'control delete' keyboard: 'control delete'
}, },
{}, {},
{
id: 'editmetadata',
title: Ox._('Edit Metadata for {0}', [editItemName]),
disabled: !canEdit,
keyboard: 'control e'
},
{},
{ {
id: 'undo', id: 'undo',
title: undoText ? Ox._('Undo {0}', [undoText]) : Ox._('Undo'), title: undoText ? Ox._('Undo {0}', [undoText]) : Ox._('Undo'),