Skip to content

Commit

Permalink
FileBrowser: Disable file change options in virtual directories (closes
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantner committed May 25, 2024
1 parent 8bc15d7 commit 3b2036a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ private void updateMenuItems() {
final boolean selMultiMore = _dopt.doSelectMultiple && selCount > 1;
final boolean selMultiAny = selMultiMore || selMulti1;
final boolean selFilesOnly = _filesystemViewerAdapter.isFilesOnlySelected();
final boolean selInVirtualDirectory = _filesystemViewerAdapter.isCurrentFolderVirtual();

// Check if is a favourite
boolean selTextFilesOnly = true;
Expand All @@ -246,9 +247,9 @@ private void updateMenuItems() {
if (_fragmentMenu != null && _fragmentMenu.findItem(R.id.action_delete_selected_items) != null) {
_fragmentMenu.findItem(R.id.action_search).setVisible(selFiles.isEmpty() && !_filesystemViewerAdapter.isCurrentFolderVirtual());
_fragmentMenu.findItem(R.id.action_delete_selected_items).setVisible((selMulti1 || selMultiMore) && selWritable);
_fragmentMenu.findItem(R.id.action_rename_selected_item).setVisible(selMulti1 && selWritable);
_fragmentMenu.findItem(R.id.action_rename_selected_item).setVisible(selMulti1 && selWritable & !selInVirtualDirectory);
_fragmentMenu.findItem(R.id.action_info_selected_item).setVisible(selMulti1);
_fragmentMenu.findItem(R.id.action_move_selected_items).setVisible((selMulti1 || selMultiMore) && selWritable && !_cu.isUnderStorageAccessFolder(getContext(), getCurrentFolder(), true));
_fragmentMenu.findItem(R.id.action_move_selected_items).setVisible((selMulti1 || selMultiMore) && selWritable && !selInVirtualDirectory && !_cu.isUnderStorageAccessFolder(getContext(), getCurrentFolder(), true));
_fragmentMenu.findItem(R.id.action_copy_selected_items).setVisible((selMulti1 || selMultiMore) && selWritable && !_cu.isUnderStorageAccessFolder(getContext(), getCurrentFolder(), true));
_fragmentMenu.findItem(R.id.action_share_files).setVisible(selFilesOnly && (selMulti1 || selMultiMore) && !_cu.isUnderStorageAccessFolder(getContext(), getCurrentFolder(), true));
_fragmentMenu.findItem(R.id.action_go_to).setVisible(!_filesystemViewerAdapter.areItemsSelected());
Expand Down

0 comments on commit 3b2036a

Please sign in to comment.