Skip to content

Commit

Permalink
Disable OnlyOffice buttons when the converter is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
car031 committed Oct 3, 2024
1 parent f84cbfc commit 581f030
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,12 @@ private void addOffice() {
}

private void addOnlyOffice() {
if (Feature.visible(Feature.ONLYOFFICE) && Menu.enabled(Menu.ONLYOFFICE)) {
if (Feature.visible(Feature.ONLYOFFICE) && Menu.enabled(Menu.ONLYOFFICE) && Session.get().getConfigAsBoolean("converter.OnlyOfficeConverter.enabled")) {
addButton(onlyoffice);
onlyoffice.setTooltip(I18N.message("editwithonlyoffice"));
onlyoffice.setTitle("<i class='fal fa-briefcase fa-lg fa-lg' aria-hidden='true'></i>");
if (!Feature.enabled(Feature.OFFICE))
setFeatureDisabled(office);
setFeatureDisabled(onlyoffice);

onlyoffice.addClickHandler(click -> checkPermissionsAndRun(
new String[] { GUIAccessControlEntry.PERMISSION_DOWNLOAD, GUIAccessControlEntry.PERMISSION_WRITE },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,8 @@ private void addItemsWhenFolderOrDocumentSelected(GUIFolder folder, GUIDocument
&& com.logicaldoc.gui.common.client.Menu.enabled(com.logicaldoc.gui.common.client.Menu.GOOGLEDRIVE))
menu.addItem(new DriveMenuItem(folder, document));
if (Feature.enabled(Feature.ONLYOFFICE)
&& com.logicaldoc.gui.common.client.Menu.enabled(com.logicaldoc.gui.common.client.Menu.ONLYOFFICE))
&& com.logicaldoc.gui.common.client.Menu.enabled(com.logicaldoc.gui.common.client.Menu.ONLYOFFICE)
&& Session.get().getConfigAsBoolean("converter.OnlyOfficeConverter.enabled"))
menu.addItem(getOnlyOfficeMenuItem(folder, document));
if (Feature.enabled(Feature.ZOHO)
&& com.logicaldoc.gui.common.client.Menu.enabled(com.logicaldoc.gui.common.client.Menu.ZOHO))
Expand Down

0 comments on commit 581f030

Please sign in to comment.