break;\r
} \r
case R.id.fdRemoveBtn: {\r
- ConfirmationDialogFragment confDialog = ConfirmationDialogFragment.newInstance(R.string.confirmation_remove_alert, new String[]{mFile.getFileName()});\r
+ ConfirmationDialogFragment confDialog = ConfirmationDialogFragment.newInstance(\r
+ R.string.confirmation_remove_alert,\r
+ new String[]{mFile.getFileName()},\r
+ mFile.isDown() ? R.string.confirmation_remove_remote_and_local : R.string.confirmation_remove_remote,\r
+ mFile.isDown() ? R.string.confirmation_remove_local : -1,\r
+ R.string.common_cancel);\r
confDialog.setOnConfirmationListener(this);\r
confDialog.show(getFragmentManager(), FTAG_CONFIRMATION);\r
break;\r
\r
\r
@Override\r
- public void onConfirmation(boolean confirmation, String callerTag) {\r
- if (confirmation && callerTag.equals(FTAG_CONFIRMATION)) {\r
+ public void onConfirmation(String callerTag) {\r
+ if (callerTag.equals(FTAG_CONFIRMATION)) {\r
Log.e("ASD","onConfirmation");\r
FileDataStorageManager fdsm = new FileDataStorageManager(mAccount, getActivity().getContentResolver());\r
if (fdsm.getFileById(mFile.getFileId()) != null) {\r
new Thread(new RemoveRunnable(mFile, mAccount, new Handler())).start();\r
}\r
- } else if (!confirmation) Log.d(TAG, "REMOVAL CANCELED");\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ public void onNeutral(String callerTag) {\r
+ FileDataStorageManager fdsm = new FileDataStorageManager(mAccount, getActivity().getContentResolver());\r
+ File f = null;\r
+ if (mFile.isDown() && (f = new File(mFile.getStoragePath())).exists()) {\r
+ f.delete();\r
+ mFile.setStoragePath(null);\r
+ fdsm.saveFile(mFile);\r
+ updateFileDetails(mFile, mAccount);\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ public void onCancel(String callerTag) {\r
+ Log.d(TAG, "REMOVAL CANCELED");\r
}\r
\r
\r