X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/2e247f24bf47d1224131bea60351709fd45bce31..43da474a54718e5cfcd8be06c0aaa5b81b80699e:/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java diff --git a/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java b/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java index 2badae1d..9bcf9dee 100644 --- a/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java +++ b/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java @@ -152,6 +152,7 @@ public class FileDetailFragment extends SherlockFragment implements i.putExtra(FileDownloader.EXTRA_REMOTE_PATH, mFile.getRemotePath()); i.putExtra(FileDownloader.EXTRA_FILE_PATH, mFile.getURLDecodedRemotePath()); i.putExtra(FileDownloader.EXTRA_FILE_SIZE, mFile.getFileLength()); + v.setEnabled(false); getActivity().startService(i); } @@ -345,24 +346,24 @@ public class FileDetailFragment extends SherlockFragment implements } /** - * In ownCloud 3.0.3 and 4.0.0 there is a bug that SabreDAV does not return + * In ownCloud 3.X.X and 4.X.X there is a bug that SabreDAV does not return * the time that the file was created. There is a chance that this will * be fixed in future versions. Use this method to check if this version of * ownCloud has this fix. - * @return True, if ownCloud the ownCloud version is > 3.0.4 and 4.0.4 + * @return True, if ownCloud the ownCloud version is supporting creationg time */ private boolean ocVersionSupportsTimeCreated(){ - if(mIntent != null){ + /* if(mIntent != null){ Account ocAccount = mIntent.getParcelableExtra(FileDownloader.EXTRA_ACCOUNT); if(ocAccount != null){ AccountManager accManager = (AccountManager) getActivity().getSystemService(Context.ACCOUNT_SERVICE); OwnCloudVersion ocVersion = new OwnCloudVersion(accManager .getUserData(ocAccount, AccountAuthenticator.KEY_OC_VERSION)); - if(ocVersion.compareTo(new OwnCloudVersion(0x030004)) >= 0 || ocVersion.compareTo(new OwnCloudVersion(0x040004)) >= 0){ + if(ocVersion.compareTo(new OwnCloudVersion(0x030000)) < 0) { return true; } } - } + }*/ return false; } @@ -373,8 +374,14 @@ public class FileDetailFragment extends SherlockFragment implements private class DownloadFinishReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - ((OCFile)mIntent.getParcelableExtra(EXTRA_FILE)).setStoragePath(intent.getStringExtra(FileDownloader.EXTRA_FILE_PATH)); - updateFileDetails(mIntent); + getView().findViewById(R.id.fdDownloadBtn).setEnabled(true); + if (intent.getAction().equals(FileDownloader.BAD_DOWNLOAD_MESSAGE)) { + Toast.makeText(context, R.string.downloader_download_failed , Toast.LENGTH_SHORT).show(); + + } else if (intent.getAction().equals(FileDownloader.DOWNLOAD_FINISH_MESSAGE)) { + ((OCFile)mIntent.getParcelableExtra(EXTRA_FILE)).setStoragePath(intent.getStringExtra(FileDownloader.EXTRA_FILE_PATH)); + updateFileDetails(mIntent); + } } }