Removed 'download' and 'open with' options from contextual menu in list of files

This commit is contained in:
David A. Velasco 2013-06-10 14:21:24 +02:00
parent 64bbf07d97
commit 782186f5b1

View file

@ -187,26 +187,25 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
} else {
// contextual menu for regular files
// new design: 'download' and 'open with' won't be available anymore in context menu
toHide.add(R.id.action_download_file);
toHide.add(R.id.action_open_file_with);
if (targetFile.isDown()) {
toHide.add(R.id.action_cancel_download);
toHide.add(R.id.action_cancel_upload);
toHide.add(R.id.action_download_file);
} else {
toHide.add(R.id.action_open_file_with);
toHide.add(R.id.action_sync_file);
}
if ( mContainerActivity.getFileDownloaderBinder().isDownloading(AccountUtils.getCurrentOwnCloudAccount(getActivity()), targetFile)) {
toHide.add(R.id.action_download_file);
toHide.add(R.id.action_cancel_upload);
toDisable.add(R.id.action_open_file_with);
toDisable.add(R.id.action_rename_file);
toDisable.add(R.id.action_remove_file);
} else if ( mContainerActivity.getFileUploaderBinder().isUploading(AccountUtils.getCurrentOwnCloudAccount(getActivity()), targetFile)) {
toHide.add(R.id.action_download_file);
toHide.add(R.id.action_cancel_download);
toDisable.add(R.id.action_open_file_with);
toDisable.add(R.id.action_rename_file);
toDisable.add(R.id.action_remove_file);
@ -271,11 +270,6 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
confDialog.show(getFragmentManager(), FileDetailFragment.FTAG_CONFIRMATION);
return true;
}
case R.id.action_open_file_with: {
mContainerActivity.openFile(mTargetFile);
return true;
}
case R.id.action_download_file:
case R.id.action_sync_file: {
Account account = AccountUtils.getCurrentOwnCloudAccount(getSherlockActivity());
RemoteOperation operation = new SynchronizeFileOperation(mTargetFile, null, mContainerActivity.getStorageManager(), account, true, false, getSherlockActivity());