<string name="unfavorite">ออกจากรายการโปรด</string>
<string name="common_rename">เปลี่ยนชื่อ</string>
<string name="common_remove">ลบออก</string>
- <string name="confirmation_remove_alert">คุณต้องการที่จะลบ %1$s?</string>
+ <string name="confirmation_remove_file_alert">คุณต้องการที่จะลบ %1$s?</string>
<string name="confirmation_remove_folder_alert">คุณต้องการที่จะลบ %1$s และเนื้อหาของมัน?</string>
<string name="confirmation_remove_local">เฉพาะต้นทางเท่านั้น</string>
<string name="confirmation_remove_folder_local">เฉพาะต้นทางเท่านั้น</string>
- <string name="confirmation_remove_file_remote">จากเซิฟเวอร์</string>
+ <string name="confirmation_remove_remote">จากเซิร์ฟเวอร์</string>
<string name="confirmation_remove_remote_and_local">รีโมท & ต้นทาง</string>
<string name="remove_success_msg">ลบเรียบร้อยแล้ว</string>
<string name="remove_fail_msg">ไม่สามารถลบได้</string>
<string name="conflict_message">ไฟล์ใดที่คุณต้องการที่จะเก็บ? หากคุณเลือกทั้งสองรุ่น ไฟล์ต้นทางจะมีจำนวนชื่อเพิ่ม</string>
<string name="conflict_keep_both">เก็บไว้ทั้งสองอย่าง</string>
<string name="conflict_use_local_version">เวอร์ชันต้นทาง</string>
- <string name="conflict_use_server_version">เวอร์ชันเซิฟเวอร์</string>
+ <string name="conflict_use_server_version">à¹\80วà¸à¸£à¹\8cà¸\8aัà¸\99à¹\80à¸\8bิรà¹\8cà¸\9fà¹\80วà¸à¸£à¹\8c</string>
<string name="preview_image_description">แสดงรูปภาพตัวอย่าง</string>
<string name="preview_image_error_unknown_format">ไม่สามารถแสดงรูปภาพนี้ได้</string>
<string name="error__upload__local_file_not_copied">%1$s ไม่สามารถคัดลอกไปยังโฟลเดอร์ %2$s ในเครื่อง</string>
private EditText mUsernameInput;\r
private EditText mPasswordInput;\r
private View mOkButton;\r
- private View mCenteredRefreshButton;\r
private TextView mAuthStatusView;\r
\r
private int mAuthStatusText = 0, mAuthStatusIcon = 0;\r
}\r
});\r
\r
- mCenteredRefreshButton = findViewById(R.id.centeredRefreshButton);\r
- mCenteredRefreshButton.setOnClickListener(new View.OnClickListener() {\r
+ findViewById(R.id.centeredRefreshButton).setOnClickListener(new View.OnClickListener() {\r
\r
@Override\r
public void onClick(View v) {\r
checkOcServer();\r
}\r
});\r
- \r
- mOkButton = findViewById(R.id.buttonOK);\r
+\r
+ findViewById(R.id.embeddedRefreshButton).setOnClickListener(new View.OnClickListener() {\r
+\r
+ @Override\r
+ public void onClick(View v) {\r
+ checkOcServer();\r
+ }\r
+ });\r
+\r
\r
/// initialize block to be moved to single Fragment to check server and get info about it \r
initServerPreFragment(savedInstanceState);\r
\r
mHostUrlInput.removeTextChangedListener(mHostUrlInputWatcher);\r
mHostUrlInput.setOnFocusChangeListener(null);\r
- \r
+\r
super.onPause();\r
}\r
\r
mOAuthTokenEndpointText.getText().toString().trim());\r
\r
getServerInfoIntent.putExtra(\r
- OperationsService.EXTRA_OAUTH2_QUERY_PARAMETERS, \r
+ OperationsService.EXTRA_OAUTH2_QUERY_PARAMETERS,\r
queryParameters);\r
\r
if (mOperationsServiceBinder != null) {\r
showRefreshButton(false);\r
\r
if (uri.length() != 0) {\r
+ uri = stripIndexPhpOrAppsFiles(uri, mHostUrlInput);\r
+ \r
// Handle internationalized domain names\r
uri = DisplayUtils.convertIdn(uri, true);\r
\r
Intent getServerInfoIntent = new Intent();\r
getServerInfoIntent.setAction(OperationsService.ACTION_GET_SERVER_INFO);\r
getServerInfoIntent.putExtra(\r
- OperationsService.EXTRA_SERVER_URL,\r
- normalizeUrlSuffix(uri)\r
+ OperationsService.EXTRA_SERVER_URL,\r
+ normalizeUrlSuffix(uri)\r
);\r
if (mOperationsServiceBinder != null) {\r
mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(getServerInfoIntent);\r
return url;\r
}\r
\r
+ private String stripIndexPhpOrAppsFiles(String url, EditText mHostUrlInput) {\r
+ if (url.endsWith("/index.php")) {\r
+ url = url.substring(0, url.lastIndexOf("/index.php"));\r
+ mHostUrlInput.setText(url);\r
+ } else if (url.contains("/index.php/apps/")) {\r
+ url = url.substring(0, url.lastIndexOf("/index.php/apps/"));\r
+ mHostUrlInput.setText(url);\r
+ }\r
+ \r
+ return url;\r
+ }\r
\r
// TODO remove, if possible\r
private String trimUrlWebdav(String url){ \r
}\r
\r
/**\r
- * Called when the refresh button in the input field for ownCloud host is clicked.\r
- * \r
- * Performs a new check on the URL in the input field.\r
- * \r
- * @param view Refresh 'button'\r
- */\r
- public void onRefreshClick(View view) {\r
- checkOcServer();\r
- }\r
-\r
-\r
- /**\r
* Called when the eye icon in the password field is clicked.\r
* \r
* Toggles the visibility of the password in the field. \r
throw new OperationCancelledException();
}
- result = mUploadOperation.execute(client);
-
/// move local temporal file or original file to its corresponding
// location in the ownCloud local folder
if (result.isSuccess()) {
if (mLocalBehaviour == FileUploader.LOCAL_BEHAVIOUR_FORGET) {
mFile.setStoragePath(null);
-
+ } else if (mLocalBehaviour == FileUploader.LOCAL_BEHAVIOUR_REMOVE){
+ mFile.setStoragePath(null);
+ originalFile.delete();
} else {
mFile.setStoragePath(expectedPath);
File fileToMove = null;
// return result;
}
}
- FileDataStorageManager.triggerMediaScan(originalFile.getAbsolutePath());
- FileDataStorageManager.triggerMediaScan(expectedFile.getAbsolutePath());
}
-
+ FileDataStorageManager.triggerMediaScan(originalFile.getAbsolutePath());
+ FileDataStorageManager.triggerMediaScan(expectedFile.getAbsolutePath());
} else if (result.getHttpCode() == HttpStatus.SC_PRECONDITION_FAILED ) {
result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT);
}
if (temporalFile != null && !originalFile.equals(temporalFile)) {
temporalFile.delete();
}
+ if (result == null){
+ return new RemoteOperationResult(false, 404, null);
+ }
if (result.isSuccess()) {
Log_OC.i(TAG, "Upload of " + mOriginalStoragePath + " to " + mRemotePath + ": " +
result.getLogMessage());