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,7 +1452,13 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
}
],
'vertical': 'true'
},
}
];
// Ideally we would always show the following buttons,
// if zotero is not present we would display them
// disabled or enabled but trigering a common warn dialog for all of them
if (this._map.zotero && this._map.zotero.enable) {
content.push(
{
'id': 'zoteroaddeditbibliography',
'type': 'bigmenubartoolitem',
@ -1520,7 +1526,11 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
'type': 'bigmenubartoolitem',
'text': _('Citation Preferences'),
'command': 'zoteroStyle'
},
}
);
}
content.push(
{
'type': 'bigtoolitem',
'text': _UNO('.uno:InsertFieldCtrl', 'text'),
@ -1567,7 +1577,7 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
'text': _UNO('.uno:UpdateAll', 'text'),
'command': '.uno:UpdateAll'
}
];
);
return this.getTabPage('References', content);
},