-
- private void showDialogToRenameFile() {
- OCFile file = getFile();
- String fileName = file.getFileName();
- int extensionStart = file.isFolder() ? -1 : fileName.lastIndexOf(".");
- int selectionEnd = (extensionStart >= 0) ? extensionStart : fileName.length();
- EditNameDialog dialog = EditNameDialog.newInstance(getString(R.string.rename_dialog_title), fileName, 0, selectionEnd, this);
- dialog.show(getFragmentManager(), "nameeditdialog");
- }
-
-
- @Override
- public void onConfirmation(String callerTag) {
- OCFile file = getFile();
- if (callerTag.equals(FTAG_CONFIRMATION)) {
- if (mContainerActivity.getStorageManager().getFileById(file.getFileId()) != null) {
- mContainerActivity.getFileOperationsHelper().removeFile(file, true);
- }
- }
- }
-
- @Override
- public void onNeutral(String callerTag) {
- OCFile file = getFile();
- mContainerActivity.getStorageManager().removeFile(file, false, true); // TODO perform in background task / new thread
- if (file.getStoragePath() != null) {
- file.setStoragePath(null);
- updateFileDetails(file, mAccount);
- }
- }
-
- @Override
- public void onCancel(String callerTag) {
- Log_OC.d(TAG, "REMOVAL CANCELED");
- }
-
-