Merge pull request #755 from owncloud/OpenWithInContextMenu

"open with" in ContextMenu of downloaded files
This commit is contained in:
jabarros 2014-12-26 09:13:58 +01:00
commit 0b7c37671f

View file

@ -257,15 +257,9 @@ public class OCFileListFragment extends ExtendedListFragment {
);
mf.filter(menu);
}
/// additional restrictions for this fragment
// TODO allow in the future 'open with' for previewable files
MenuItem item = menu.findItem(R.id.action_open_file_with);
if (item != null) {
item.setVisible(false);
item.setEnabled(false);
}
/// TODO break this direct dependency on FileDisplayActivity... if possible
MenuItem item = menu.findItem(R.id.action_open_file_with);
FileFragment frag = ((FileDisplayActivity)getSherlockActivity()).getSecondFragment();
if (frag != null && frag instanceof FileDetailFragment &&
frag.getFile().getFileId() == targetFile.getFileId()) {
@ -291,6 +285,10 @@ public class OCFileListFragment extends ExtendedListFragment {
mContainerActivity.getFileOperationsHelper().shareFileWithLink(mTargetFile);
return true;
}
case R.id.action_open_file_with: {
mContainerActivity.getFileOperationsHelper().openFile(mTargetFile);
return true;
}
case R.id.action_unshare_file: {
mContainerActivity.getFileOperationsHelper().unshareFileWithLink(mTargetFile);
return true;