import eu.alefzero.owncloud.datamodel.FileDataStorageManager;\r
import eu.alefzero.owncloud.datamodel.OCFile;\r
import eu.alefzero.owncloud.files.services.FileDownloader;\r
+import eu.alefzero.owncloud.files.services.FileUploader;\r
import eu.alefzero.owncloud.ui.activity.FileDisplayActivity;\r
import eu.alefzero.owncloud.utils.OwnCloudVersion;\r
import eu.alefzero.webdav.WebdavClient;\r
i.putExtra(FileDownloader.EXTRA_FILE_SIZE, mFile.getFileLength());\r
\r
// update ui \r
- Toast.makeText(getActivity(), "Downloading", Toast.LENGTH_LONG).show();\r
setButtonsForDownloading();\r
\r
getActivity().startService(i);\r
break;\r
} \r
case R.id.fdRemoveBtn: {\r
- ConfirmationDialogFragment confDialog = ConfirmationDialogFragment.newInstance("to remove " + mFile.getFileName());\r
+ ConfirmationDialogFragment confDialog = ConfirmationDialogFragment.newInstance(R.string.confirmation_remove_alert, new String[]{mFile.getFileName()});\r
confDialog.setOnConfirmationListener(this);\r
confDialog.show(getFragmentManager(), FTAG_CONFIRMATION);\r
break;\r
cb.setChecked(mFile.keepInSync());\r
\r
// configure UI for depending upon local state of the file\r
- if (mFile.isDownloading()) {\r
+ if (FileDownloader.isDownloading(mAccount, mFile.getRemotePath())) {\r
setButtonsForDownloading();\r
\r
} else if (mFile.isDown()) {\r
private class DownloadFinishReceiver extends BroadcastReceiver {\r
@Override\r
public void onReceive(Context context, Intent intent) {\r
- if (mFile != null) {\r
+ String accountName = intent.getStringExtra(FileDownloader.ACCOUNT_NAME);\r
+\r
+ if (!isEmpty() && accountName.equals(mAccount.name)) {\r
boolean downloadWasFine = intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false);\r
String downloadedRemotePath = intent.getStringExtra(FileDownloader.EXTRA_REMOTE_PATH);\r
if (mFile.getRemotePath().equals(downloadedRemotePath)) {\r
\r
public void run() {\r
WebdavClient wc = new WebdavClient(mAccount, getSherlockActivity().getApplicationContext());\r
+ wc.allowSelfsignedCertificates();\r
AccountManager am = AccountManager.get(getSherlockActivity());\r
String baseUrl = am.getUserData(mAccount, AccountAuthenticator.KEY_OC_BASE_URL);\r
OwnCloudVersion ocv = new OwnCloudVersion(am.getUserData(mAccount, AccountAuthenticator.KEY_OC_VERSION));\r
\r
public void run() {\r
WebdavClient wc = new WebdavClient(mAccount, getSherlockActivity().getApplicationContext());\r
+ wc.allowSelfsignedCertificates();\r
AccountManager am = AccountManager.get(getSherlockActivity());\r
String baseUrl = am.getUserData(mAccount, AccountAuthenticator.KEY_OC_BASE_URL);\r
OwnCloudVersion ocv = new OwnCloudVersion(am.getUserData(mAccount, AccountAuthenticator.KEY_OC_VERSION));\r