<string name="main_wrn_accsetup">There is no account set up on your device. In order to use this App, you need to create one.</string>
<string name="about_android">%1$s Android App</string>
<string name="about_version">version %1$s</string>
- <string name="actionbar_sync">Refresh</string>
+ <string name="actionbar_sync">Refresh account</string>
<string name="actionbar_upload">Upload</string>
<string name="actionbar_upload_from_apps">Content from other apps</string>
<string name="actionbar_upload_files">Files</string>
<string name="filedetails_created">Created:</string>
<string name="filedetails_modified">Modified:</string>
<string name="filedetails_download">Download</string>
- <string name="filedetails_sync_file">Refresh</string>
+ <string name="filedetails_sync_file">Refresh file</string>
<string name="filedetails_redownload">Redownload</string>
<string name="filedetails_renamed_in_upload_msg">File was renamed to %1$s during upload</string>
<string name="common_yes">Yes</string>
\r
finish();\r
\r
- } else {\r
+ } else if (result.isServerFail() || result.isException()) {\r
+ /// if server fail or exception in authorization, the UI is updated as when a server check failed\r
+ mServerIsChecked = true;\r
+ mServerIsValid = false;\r
+ mIsSslConn = false;\r
+ mOcServerChkOperation = null;\r
+ mDiscoveredVersion = null;\r
+ mHostBaseUrl = normalizeUrl(mHostUrlInput.getText().toString());\r
+\r
+ // update status icon and text\r
+ updateServerStatusIconAndText(result);\r
+ showServerStatus();\r
+ mAuthStatusIcon = 0;\r
+ mAuthStatusText = 0;\r
+ showAuthStatus();\r
+ \r
+ // update input controls state\r
+ showRefreshButton();\r
+ mOkButton.setEnabled(false);\r
+\r
+ // very special case (TODO: move to a common place for all the remote operations) (dangerous here?)\r
+ if (result.getCode() == ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED) {\r
+ mLastSslUntrustedServerResult = result;\r
+ showDialog(DIALOG_SSL_VALIDATOR); \r
+ }\r
+\r
+ } else { // authorization fail due to client side - probably wrong credentials\r
updateAuthStatusIconAndText(result);\r
showAuthStatus();\r
Log_OC.d(TAG, "Access failed: " + result.getLogMessage());\r
}
+ public boolean isServerFail() {
+ return (mHttpCode >= HttpStatus.SC_INTERNAL_SERVER_ERROR);
+ }
+
+ public boolean isException() {
+ return (mException != null);
+ }
+
}
/// Check whether the 'main' OCFile handled by the Activity is contained in the current Account
OCFile file = getFile();
if (file != null) {
- file = mStorageManager.getFileByPath(file.getRemotePath()); // currentDir = null if not in the current Account
+ if (file.isDown() && file.getLastSyncDateForProperties() == 0) {
+ // upload in progress - right now, files are not inserted in the local cache until the upload is successful
+ if (mStorageManager.getFileById(file.getParentId()) == null) {
+ file = null; // not able to know the directory where the file is uploading
+ }
+ } else {
+ file = mStorageManager.getFileByPath(file.getRemotePath()); // currentDir = null if not in the current Account
+ }
}
if (file == null) {
// fall back to root folder
private Fragment chooseInitialSecondFragment(OCFile file) {
Fragment secondFragment = null;
if (file != null && !file.isDirectory()) {
- if (file.isDown() && PreviewMediaFragment.canBePreviewed(file)) {
+ if (file.isDown() && PreviewMediaFragment.canBePreviewed(file)
+ && file.getLastSyncDateForProperties() > 0 // temporal fix
+ ) {
int startPlaybackPosition = getIntent().getIntExtra(PreviewVideoActivity.EXTRA_START_POSITION, 0);
boolean autoplay = getIntent().getBooleanExtra(PreviewVideoActivity.EXTRA_AUTOPLAY, true);
secondFragment = new PreviewMediaFragment(file, getAccount(), startPlaybackPosition, autoplay);