UI Tab: Bibliography add additional buttons conditionally

note: Ideally we would always add the buttons,
but when the extra capabilities are not available we would
switch the trigger for all of those buttons to be a warning
dialog

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I7359fe222eff31920b78116e69b45aa60cb15790
This commit is contained in:
Pedro Pinto Silva 2022-12-09 14:35:43 +01:00 committed by Andras Timar
parent d5a6d36c85
commit 054af102ce

View file

@ -1452,75 +1452,85 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
} }
], ],
'vertical': 'true' 'vertical': 'true'
}, }
{ ];
'id': 'zoteroaddeditbibliography', // Ideally we would always show the following buttons,
'type': 'bigmenubartoolitem', // if zotero is not present we would display them
'text': _('Add/Edit Bibliography'), // disabled or enabled but trigering a common warn dialog for all of them
'command': 'zoteroEditBibliography' if (this._map.zotero && this._map.zotero.enable) {
}, content.push(
{ {
'type': 'container', 'id': 'zoteroaddeditbibliography',
'children': [ 'type': 'bigmenubartoolitem',
{ 'text': _('Add/Edit Bibliography'),
'type': 'toolbox', 'command': 'zoteroEditBibliography'
'children': [ },
{ {
'id': 'zoteroaddeditcitation', 'type': 'container',
'type': 'toolitem', 'children': [
'text': _('Add/Edit Citation'), {
'command': 'zoteroEdit' 'type': 'toolbox',
} 'children': [
] {
}, 'id': 'zoteroaddeditcitation',
{ 'type': 'toolitem',
'type': 'toolbox', 'text': _('Add/Edit Citation'),
'children': [ 'command': 'zoteroEdit'
{ }
'id': 'zoteroaddnote', ]
'type': 'toolitem', },
'text': _('Add Citation Note'), {
'command': 'zoteroAddNote' 'type': 'toolbox',
} 'children': [
] {
} 'id': 'zoteroaddnote',
], 'type': 'toolitem',
'vertical': 'true' 'text': _('Add Citation Note'),
}, 'command': 'zoteroAddNote'
{ }
'type': 'container', ]
'children': [ }
{ ],
'type': 'toolbox', 'vertical': 'true'
'children': [ },
{ {
'id': 'zoterorefresh', 'type': 'container',
'type': 'toolitem', 'children': [
'text': _('Refresh Citations'), {
'command': 'zoteroRefresh' 'type': 'toolbox',
} 'children': [
] {
}, 'id': 'zoterorefresh',
{ 'type': 'toolitem',
'type': 'toolbox', 'text': _('Refresh Citations'),
'children': [ 'command': 'zoteroRefresh'
{ }
'id': 'zoterounlink', ]
'type': 'toolitem', },
'text': _('Unlink Citations'), {
'command': 'zoteroUnlink' 'type': 'toolbox',
} 'children': [
] {
} 'id': 'zoterounlink',
], 'type': 'toolitem',
'vertical': 'true' 'text': _('Unlink Citations'),
}, 'command': 'zoteroUnlink'
{ }
'id': 'zoterosetdocprefs', ]
'type': 'bigmenubartoolitem', }
'text': _('Citation Preferences'), ],
'command': 'zoteroStyle' 'vertical': 'true'
}, },
{
'id': 'zoterosetdocprefs',
'type': 'bigmenubartoolitem',
'text': _('Citation Preferences'),
'command': 'zoteroStyle'
}
);
}
content.push(
{ {
'type': 'bigtoolitem', 'type': 'bigtoolitem',
'text': _UNO('.uno:InsertFieldCtrl', 'text'), 'text': _UNO('.uno:InsertFieldCtrl', 'text'),
@ -1567,7 +1577,7 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
'text': _UNO('.uno:UpdateAll', 'text'), 'text': _UNO('.uno:UpdateAll', 'text'),
'command': '.uno:UpdateAll' 'command': '.uno:UpdateAll'
} }
]; );
return this.getTabPage('References', content); return this.getTabPage('References', content);
}, },