Browse Source

Fixed status message in uploads view

David A. Velasco 9 years ago
parent
commit
772d640bc8

+ 4 - 4
res/layout/upload_list_item.xml

@@ -40,7 +40,7 @@
             android:singleLine="true"
             android:textColor="@color/textColor"
             android:text="@string/placeholder_filename"
-            android:textSize="16dip" />
+            android:textSize="16sp" />
 
 
         <LinearLayout
@@ -55,7 +55,7 @@
                 android:ellipsize="middle"
                 android:singleLine="true"
                 android:text="@string/placeholder_filesize"
-                android:textSize="12dip"/>
+                android:textSize="12sp"/>
             <TextView
                 android:id="@+id/upload_date"
                 android:layout_width="wrap_content"
@@ -64,14 +64,14 @@
                 android:layout_marginStart="4dp"
                 android:layout_marginEnd="4dp"
                 android:text="@string/placeholder_timestamp"
-                android:textSize="12dip"/>
+                android:textSize="12sp"/>
             <TextView
                 android:id="@+id/upload_status"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:textColor="@color/list_item_lastmod_and_filesize_text"
                 android:text="@string/uploads_view_upload_status_succeeded"
-                android:textSize="12dip"/>
+                android:textSize="12sp"/>
 
         </LinearLayout>
 

+ 3 - 6
res/values/strings.xml

@@ -130,12 +130,9 @@
     <string name="uploads_view_upload_status_failed_file_error">File error</string>
     <string name="uploads_view_upload_status_failed_localfile_error">Local file not found</string>
     <string name="uploads_view_upload_status_failed_permission_error">Permission error</string>
-    <string name="uploads_view_upload_status_failed">Upload failed</string>
-    <string name="uploads_view_later_reason_waiting_for">Waiting for </string>
-    <string name="uploads_view_later_reason_add_wifi_reason"> and wifi connectivity</string>
-    <string name="uploads_view_later_reason_waiting_for_wifi">Waiting for wifi connectivity</string>
-    <string name="uploads_view_later_reason_add_charging_reason"> and charging</string>
-    <string name="uploads_view_later_reason_waiting_for_charging">Waiting for charging</string>
+    <string name="uploads_view_upload_status_conflict">Conflict</string>
+    <string name="uploads_view_upload_status_unknown_fail">Unknown error</string>
+    <string name="uploads_view_upload_status_waiting_for_wifi">Waiting for wifi connectivity</string>
     <string name="uploads_view_later_waiting_to_upload">Waiting to upload</string>
     <string name="downloader_download_in_progress_ticker">Downloading &#8230;</string>
     <string name="downloader_download_in_progress_content">%1$d%% Downloading %2$s</string>

+ 2 - 8
src/com/owncloud/android/datamodel/UploadsStorageManager.java

@@ -96,7 +96,7 @@ public class UploadsStorageManager extends Observable {
     /**
      * Stores an upload object in DB.
      *
-     * @param ocUpload
+     * @param ocUpload      Upload object to store
      * @return upload id, -1 if the insert process fails.
      */
     public long storeUpload(OCUpload ocUpload) {
@@ -111,8 +111,6 @@ public class UploadsStorageManager extends Observable {
         cv.put(ProviderTableMeta.UPLOADS_LOCAL_BEHAVIOUR, ocUpload.getLocalAction());
         cv.put(ProviderTableMeta.UPLOADS_FORCE_OVERWRITE, ocUpload.isForceOverwrite() ? 1 : 0);
         cv.put(ProviderTableMeta.UPLOADS_IS_CREATE_REMOTE_FOLDER, ocUpload.isCreateRemoteFolder() ? 1 : 0);
-        cv.put(ProviderTableMeta.UPLOADS_IS_WHILE_CHARGING_ONLY, ocUpload.isWhileChargingOnly() ? 1 : 0);
-        cv.put(ProviderTableMeta.UPLOADS_IS_WIFI_ONLY, ocUpload.isUseWifiOnly() ? 1 : 0);
         cv.put(ProviderTableMeta.UPLOADS_LAST_RESULT, ocUpload.getLastResult().getValue());
         cv.put(ProviderTableMeta.UPLOADS_CREATED_BY, ocUpload.getCreadtedBy());
 
@@ -133,7 +131,7 @@ public class UploadsStorageManager extends Observable {
     /**
      * Update an upload object in DB.
      *
-     * @param ocUpload
+     * @param ocUpload      Upload object with state to update
      * @return num of updated uploads.
      */
     public int updateUpload(OCUpload ocUpload) {
@@ -402,10 +400,6 @@ public class UploadsStorageManager extends Observable {
                     c.getColumnIndex(ProviderTableMeta.UPLOADS_FORCE_OVERWRITE)) == 1);
             upload.setCreateRemoteFolder(c.getInt(
                     c.getColumnIndex(ProviderTableMeta.UPLOADS_IS_CREATE_REMOTE_FOLDER)) == 1);
-            upload.setWhileChargingOnly(c.getInt(
-                    c.getColumnIndex(ProviderTableMeta.UPLOADS_IS_WHILE_CHARGING_ONLY)) == 1);
-            upload.setUseWifiOnly(c.getInt(
-                    c.getColumnIndex(ProviderTableMeta.UPLOADS_IS_WIFI_ONLY)) == 1);
             upload.setUploadEndTimestamp(c.getLong(c.getColumnIndex(ProviderTableMeta.UPLOADS_UPLOAD_END_TIMESTAMP)));
             upload.setLastResult(UploadResult.fromValue(
                     c.getInt(c.getColumnIndex(ProviderTableMeta.UPLOADS_LAST_RESULT))));

+ 1 - 92
src/com/owncloud/android/db/OCUpload.java

@@ -27,7 +27,6 @@ import android.content.Context;
 import android.os.Parcel;
 import android.os.Parcelable;
 
-import com.owncloud.android.R;
 import com.owncloud.android.authentication.AccountUtils;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.datamodel.UploadsStorageManager;
@@ -36,7 +35,6 @@ import com.owncloud.android.files.services.FileUploader;
 import com.owncloud.android.lib.common.utils.Log_OC;
 import com.owncloud.android.operations.UploadFileOperation;
 import com.owncloud.android.utils.MimetypeIconUtil;
-import com.owncloud.android.utils.UploadUtils;
 
 import java.io.File;
 
@@ -84,14 +82,6 @@ public class OCUpload implements Parcelable {
      * Create destination folder?
      */
     private boolean mIsCreateRemoteFolder;
-    /**
-     * Upload only via wifi?
-     */
-    private boolean mIsUseWifiOnly;
-    /**
-     * Upload only if phone being charged?
-     */
-    private boolean mIsWhileChargingOnly;
     /**
      * Status of upload (later, in_progress, ...).
      */
@@ -159,8 +149,6 @@ public class OCUpload implements Parcelable {
         mLocalAction = FileUploader.LOCAL_BEHAVIOUR_COPY;
         mForceOverwrite = false;
         mIsCreateRemoteFolder = false;
-        mIsUseWifiOnly = true;
-        mIsWhileChargingOnly = false;
         mUploadStatus = UploadStatus.UPLOAD_IN_PROGRESS;
         mLastResult = UploadResult.UNKNOWN;
         mCreatedBy = UploadFileOperation.CREATED_BY_USER;
@@ -201,7 +189,7 @@ public class OCUpload implements Parcelable {
      * @param lastResult the lastResult to set
      */
     public void setLastResult(UploadResult lastResult) {
-        this.mLastResult = lastResult;
+        this.mLastResult = ((lastResult != null) ? lastResult : UploadResult.UNKNOWN);
     }
 
 
@@ -292,20 +280,6 @@ public class OCUpload implements Parcelable {
         this.mIsCreateRemoteFolder = isCreateRemoteFolder;
     }
 
-    /**
-     * @return the isUseWifiOnly
-     */
-    public boolean isUseWifiOnly() {
-        return mIsUseWifiOnly;
-    }
-
-    /**
-     * @param isUseWifiOnly the isUseWifiOnly to set
-     */
-    public void setUseWifiOnly(boolean isUseWifiOnly) {
-        this.mIsUseWifiOnly = isUseWifiOnly;
-    }
-
     /**
      * @return the accountName
      */
@@ -320,14 +294,6 @@ public class OCUpload implements Parcelable {
         return AccountUtils.getOwnCloudAccountByName(context, getAccountName());
     }
 
-    public void setWhileChargingOnly(boolean isWhileChargingOnly) {
-        this.mIsWhileChargingOnly = isWhileChargingOnly;
-    }
-    
-    public boolean isWhileChargingOnly() {
-        return mIsWhileChargingOnly;
-    }
-
     public void setCreatedBy(int createdBy) {
         mCreatedBy = createdBy;
     }
@@ -358,15 +324,6 @@ public class OCUpload implements Parcelable {
         }
     }
 
-    /**
-     * Removes all uploads restrictions. After calling this function upload is performed immediately if requested.
-     */
-    public void removeAllUploadRestrictions() {
-        setUseWifiOnly(false);
-        setWhileChargingOnly(false);
-        setUploadEndTimestamp(0);
-    }
-
     /**
      * Returns true when user is able to cancel this upload. That is, when
      * upload is currently in progress or scheduled for upload.
@@ -423,8 +380,6 @@ public class OCUpload implements Parcelable {
         mLocalAction = source.readInt();
         mForceOverwrite = (source.readInt() == 1);
         mIsCreateRemoteFolder = (source.readInt() == 1);
-        mIsUseWifiOnly = (source.readInt() == 1);
-        mIsWhileChargingOnly = (source.readInt() == 1);
         try {
             mUploadStatus = UploadStatus.valueOf(source.readString());
         } catch (IllegalArgumentException x) {
@@ -454,8 +409,6 @@ public class OCUpload implements Parcelable {
         dest.writeInt(mLocalAction);
         dest.writeInt(mForceOverwrite ? 1 : 0);
         dest.writeInt(mIsCreateRemoteFolder ? 1 : 0);
-        dest.writeInt(mIsUseWifiOnly ? 1 : 0);
-        dest.writeInt(mIsWhileChargingOnly ? 1 : 0);
         dest.writeString(mUploadStatus.name());
         dest.writeLong(mUploadEndTimeStamp);
         dest.writeString(((mLastResult == null) ? "" : mLastResult.name()));
@@ -487,17 +440,6 @@ public class OCUpload implements Parcelable {
             return CanUploadFileNowStatus.ERROR;
         }
 
-        if (isUseWifiOnly()
-                && !UploadUtils.isConnectedViaWiFi(context)) {
-            Log_OC.d(TAG, "Do not start upload because it is wifi-only.");
-            return CanUploadFileNowStatus.LATER;
-        }
-
-        if(isWhileChargingOnly() && !UploadUtils.isCharging(context)) {
-            Log_OC.d(TAG, "Do not start upload because it is while charging only.");
-            return CanUploadFileNowStatus.LATER;
-        }
-
         if (!new File(getLocalPath()).exists()) {
             Log_OC.d(TAG, "Do not start upload because local file does not exist.");
             return CanUploadFileNowStatus.FILE_GONE;
@@ -505,37 +447,4 @@ public class OCUpload implements Parcelable {
         return CanUploadFileNowStatus.NOW;
     }
 
-
-    /**
-     * Returns the reason as String why state of OCUpload is LATER. If
-     * upload state != LATER return null.
-     */
-    public String getUploadLaterReason(Context context) {
-        StringBuilder reason = new StringBuilder();
-        //Date now = new Date();
-        if (isUseWifiOnly() && !UploadUtils.isConnectedViaWiFi(context)) {
-            if (reason.length() > 0) {
-                reason.append(context.getString(R.string.uploads_view_later_reason_add_wifi_reason));
-            } else {
-                reason.append(context.getString(R.string.uploads_view_later_reason_waiting_for_wifi));
-            }
-        }
-        if (isWhileChargingOnly() && !UploadUtils.isCharging(context)) {
-            if (reason.length() > 0) {
-                reason.append(context.getString(R.string.uploads_view_later_reason_add_charging_reason));
-            } else {
-                reason.append(context.getString(R.string.uploads_view_later_reason_waiting_for_charging));
-            }
-        }
-        reason.append(".");
-        if (reason.length() > 1) {
-            return reason.toString();
-        }
-        if (getUploadStatus() == UploadStatus.UPLOAD_IN_PROGRESS) {
-            return context.getString(R.string.uploads_view_later_waiting_to_upload);
-        }
-        return null;
-    }
-
-
 }

+ 0 - 2
src/com/owncloud/android/db/ProviderMeta.java

@@ -145,8 +145,6 @@ public class ProviderMeta {
         public static final String UPLOADS_UPLOAD_TIME = "upload_time";
         public static final String UPLOADS_FORCE_OVERWRITE = "force_overwrite";
         public static final String UPLOADS_IS_CREATE_REMOTE_FOLDER = "is_create_remote_folder";
-        public static final String UPLOADS_IS_WHILE_CHARGING_ONLY = "is_while_charging_only";
-        public static final String UPLOADS_IS_WIFI_ONLY = "is_wifi_only";
         public static final String UPLOADS_UPLOAD_END_TIMESTAMP = "upload_end_timestamp";
         public static final String UPLOADS_LAST_RESULT = "last_result";
         public static final String UPLOADS_CREATED_BY = "created_by";

+ 8 - 3
src/com/owncloud/android/db/UploadResult.java

@@ -23,6 +23,7 @@ package com.owncloud.android.db;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 
 public enum UploadResult {
+    UNKNOWN(-1),
     UPLOADED(0),
     NETWORK_CONNECTION(1),
     CREDENTIAL_ERROR(2),
@@ -32,7 +33,7 @@ public enum UploadResult {
     PRIVILEDGES_ERROR(6),
     CANCELLED(7),
     FILE_NOT_FOUND(8),
-    UNKNOWN(9);
+    DELAYED_FOR_WIFI(9);
 
     private final int value;
 
@@ -45,6 +46,8 @@ public enum UploadResult {
     }
     public static UploadResult fromValue(int value) {
         switch (value) {
+            case -1:
+                return UNKNOWN;
             case 0:
                 return UPLOADED;
             case 1:
@@ -64,12 +67,13 @@ public enum UploadResult {
             case 8:
                 return FILE_NOT_FOUND;
             case 9:
-                return UNKNOWN;
+                return DELAYED_FOR_WIFI;
         }
         return null;
     }
 
     public static UploadResult fromOperationResult(RemoteOperationResult result){
+        // messy :(
         switch (result.getCode()){
             case OK:
                 return UPLOADED;
@@ -77,7 +81,6 @@ public enum UploadResult {
             case HOST_NOT_AVAILABLE:
             case TIMEOUT:
             case WRONG_CONNECTION:
-            case DELAYED_FOR_WIFI:
                 return NETWORK_CONNECTION;
             case ACCOUNT_EXCEPTION:
             case UNAUTHORIZED:
@@ -94,6 +97,8 @@ public enum UploadResult {
                 return PRIVILEDGES_ERROR;
             case CANCELLED:
                 return CANCELLED;
+            case DELAYED_FOR_WIFI:
+                return DELAYED_FOR_WIFI;
             case UNKNOWN_ERROR:
                 if (result.getException() instanceof java.io.FileNotFoundException)
                     return FILE_ERROR;

+ 0 - 2
src/com/owncloud/android/providers/FileContentProvider.java

@@ -853,8 +853,6 @@ public class FileContentProvider extends ContentProvider {
                 + ProviderTableMeta.UPLOADS_UPLOAD_TIME + " INTEGER, "
                 + ProviderTableMeta.UPLOADS_FORCE_OVERWRITE + " INTEGER, "  // boolean
                 + ProviderTableMeta.UPLOADS_IS_CREATE_REMOTE_FOLDER + " INTEGER, "  // boolean
-                + ProviderTableMeta.UPLOADS_IS_WHILE_CHARGING_ONLY + " INTEGER, "  // boolean
-                + ProviderTableMeta.UPLOADS_IS_WIFI_ONLY + " INTEGER, " // boolean
                 + ProviderTableMeta.UPLOADS_UPLOAD_END_TIMESTAMP + " INTEGER, "
                 + ProviderTableMeta.UPLOADS_LAST_RESULT + " INTEGER, "     // Upload LastResult
                 + ProviderTableMeta.UPLOADS_CREATED_BY + " INTEGER );"    // Upload createdBy

+ 133 - 81
src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java

@@ -258,18 +258,18 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
             accountNameTextView.setText(upload.getAccountName());
 
             TextView statusTextView = (TextView) view.findViewById(R.id.upload_status);
-            String status;
 
-            // Reset fields visibility
+            /// Reset fields visibility
             uploadDateTextView.setVisibility(View.VISIBLE);
             pathTextView.setVisibility(View.VISIBLE);
             fileSizeTextView.setVisibility(View.VISIBLE);
             accountNameTextView.setVisibility(View.VISIBLE);
             statusTextView.setVisibility(View.VISIBLE);
 
+            /// Update information depending of upload details
+            String status = getStatusText(upload);
             switch (upload.getUploadStatus()) {
                 case UPLOAD_IN_PROGRESS:
-                    status = mParentActivity.getString(R.string.uploader_upload_in_progress_ticker);
                     ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.upload_progress_bar);
                     progressBar.setProgress(0);
                     progressBar.setVisibility(View.VISIBLE);
@@ -277,7 +277,7 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
                     FileUploader.FileUploaderBinder binder = mParentActivity.getFileUploaderBinder();
                     if (binder != null) {
                         if (binder.isUploadingNow(upload)) {
-                            /// really uploading, bind the progress bar to listen for progess updates
+                            /// really uploading, bind the progress bar to listen for progress updates
                             mProgressListener = new ProgressListener(upload, progressBar);
                             binder.addDatatransferProgressListener(
                                 mProgressListener,
@@ -307,79 +307,14 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
                     fileSizeTextView.setVisibility(View.GONE);
                     accountNameTextView.setVisibility(View.INVISIBLE);
                     break;
+
                 case UPLOAD_FAILED:
                     uploadDateTextView.setVisibility(View.GONE);
-                    if (upload.getLastResult() != null) {
-                        switch (upload.getLastResult()) {
-                            case CREDENTIAL_ERROR:
-                                status = mParentActivity.getString(
-                                        R.string.uploads_view_upload_status_failed_credentials_error);
-
-                                view.setOnClickListener(new OnClickListener() {
-                                    @Override
-                                    public void onClick(View v) {
-                                        // let the user update credentials with one click
-                                        Intent updateAccountCredentials = new Intent(mParentActivity,
-                                                AuthenticatorActivity.class);
-                                        updateAccountCredentials.putExtra(
-                                                AuthenticatorActivity.EXTRA_ACCOUNT, upload.getAccount
-                                                        (mParentActivity));
-                                        updateAccountCredentials.putExtra(
-                                                AuthenticatorActivity.EXTRA_ACTION,
-                                                AuthenticatorActivity.ACTION_UPDATE_EXPIRED_TOKEN);
-                                        updateAccountCredentials.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
-                                        updateAccountCredentials.addFlags(Intent.FLAG_FROM_BACKGROUND);
-                                        mParentActivity.startActivityForResult(updateAccountCredentials,
-                                                UploadListActivity.UPDATE_CREDENTIALS_REQUEST_CODE);
-                                    }
-                                });
-                                break;
-                            case FOLDER_ERROR:
-                                status = mParentActivity.getString(
-                                        R.string.uploads_view_upload_status_failed_folder_error);
-                                break;
-                            case FILE_NOT_FOUND:
-                                status = mParentActivity.getString(
-                                        R.string.uploads_view_upload_status_failed_localfile_error);
-                                break;
-                            case FILE_ERROR:
-                                status = mParentActivity.getString(
-                                        R.string.uploads_view_upload_status_failed_file_error);
-                                break;
-                            case PRIVILEDGES_ERROR:
-                                status = mParentActivity.getString(
-                                        R.string.uploads_view_upload_status_failed_permission_error);
-                                break;
-                            case NETWORK_CONNECTION:
-                                status = mParentActivity.getString(R.string.uploads_view_upload_status_failed_connection_error);
-                                break;
-                            default:
-                                status = mParentActivity.getString(
-                                        R.string.uploads_view_upload_status_failed) + ": "
-                                        + upload.getLastResult().toString();
-                                break;
-                        }
-                    } else {
-                        status = mParentActivity.getString(
-                                R.string.uploads_view_upload_status_failed);
-                    }
-
-                    String laterReason = upload.getUploadLaterReason(mParentActivity);
-                    if (laterReason != null) {
-                        //Upload failed once but is delayed now, show reason.
-                        status = laterReason;
-                    }
                     break;
+
                 case UPLOAD_SUCCEEDED:
-                    status = mParentActivity.getString(R.string.uploads_view_upload_status_succeeded);
                     statusTextView.setVisibility(View.GONE);
                     break;
-                default:
-                    status = upload.getUploadStatus().toString();
-                    if (upload.getLastResult() != null) {
-                        upload.getLastResult().toString();
-                    }
-                    break;
             }
             if (upload.getUploadStatus() != UploadStatus.UPLOAD_IN_PROGRESS) {
                 ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.upload_progress_bar);
@@ -387,6 +322,7 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
             }
             statusTextView.setText(status);
 
+            /// bind listeners to perform actions
             ImageButton rightButton = (ImageButton) view.findViewById(R.id.upload_right_button);
             if (upload.userCanCancelUpload()) {
                 //Cancel
@@ -413,24 +349,49 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
                 });
             }
 
-            if (upload.userCanRetryUpload() && upload.getLastResult()!= UploadResult.CREDENTIAL_ERROR) {
-                view.setOnClickListener(new OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
+            if (upload.userCanRetryUpload()) {
+                if (UploadResult.CREDENTIAL_ERROR.equals(upload.getLastResult())) {
+                    view.setOnClickListener(new OnClickListener() {
+                        @Override
+                        public void onClick(View v) {
+                            // let the user update credentials with one click
+                            Intent updateAccountCredentials = new Intent(mParentActivity,
+                                AuthenticatorActivity.class);
+                            updateAccountCredentials.putExtra(
+                                AuthenticatorActivity.EXTRA_ACCOUNT, upload.getAccount
+                                    (mParentActivity));
+                            updateAccountCredentials.putExtra(
+                                AuthenticatorActivity.EXTRA_ACTION,
+                                AuthenticatorActivity.ACTION_UPDATE_EXPIRED_TOKEN);
+                            updateAccountCredentials.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+                            updateAccountCredentials.addFlags(Intent.FLAG_FROM_BACKGROUND);
+                            mParentActivity.startActivityForResult(updateAccountCredentials,
+                                UploadListActivity.UPDATE_CREDENTIALS_REQUEST_CODE);
+                        }
+                    });
+
+                } else {
+                    // not a credentials error
+                    view.setOnClickListener(new OnClickListener() {
+                        @Override
+                        public void onClick(View v) {
                         File file = new File(upload.getLocalPath());
                         if (file.exists()) {
                             FileUploader.UploadRequester requester = new FileUploader.UploadRequester();
                             requester.retry(mParentActivity, upload);
                             refreshView();
                         } else {
-                            final String message = String.format(mParentActivity.getString(R.string.local_file_not_found_toast));
+                            final String message = String.format(
+                                mParentActivity.getString(R.string.local_file_not_found_toast)
+                            );
                             Toast.makeText(mParentActivity, message, Toast.LENGTH_SHORT).show();
                         }
-                    }
-                });
+                        }
+                    });
+                }
             }
 
-
+            /// Set icon or thumbnail
             ImageView fileIcon = (ImageView) view.findViewById(R.id.thumbnail);
             fileIcon.setImageResource(R.drawable.file);
 
@@ -526,6 +487,99 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
         return view;
     }
 
+    /**
+     * Gets the status text to show to the user according to the status and last result of the
+     * the given upload.
+     *
+     * @param upload        Upload to describe.
+     * @return              Text describing the status of the given upload.
+     */
+    private String getStatusText(OCUpload upload) {
+        String status;
+        switch (upload.getUploadStatus()) {
+
+            case UPLOAD_IN_PROGRESS:
+                status = mParentActivity.getString(R.string.uploads_view_later_waiting_to_upload);
+                FileUploader.FileUploaderBinder binder = mParentActivity.getFileUploaderBinder();
+                if (binder != null) {
+                    /// really uploading, bind the progress bar to listen for progress updates
+                    status = mParentActivity.getString(R.string.uploader_upload_in_progress_ticker);
+                }
+                break;
+
+            case UPLOAD_SUCCEEDED:
+                status = mParentActivity.getString(R.string.uploads_view_upload_status_succeeded);
+                break;
+
+            case UPLOAD_FAILED:
+                switch (upload.getLastResult()) {
+                    case CREDENTIAL_ERROR:
+                        status = mParentActivity.getString(
+                            R.string.uploads_view_upload_status_failed_credentials_error
+                        );
+                        break;
+                    case FOLDER_ERROR:
+                        status = mParentActivity.getString(
+                            R.string.uploads_view_upload_status_failed_folder_error
+                        );
+                        break;
+                    case FILE_NOT_FOUND:
+                        status = mParentActivity.getString(
+                            R.string.uploads_view_upload_status_failed_localfile_error
+                        );
+                        break;
+                    case FILE_ERROR:
+                        status = mParentActivity.getString(
+                            R.string.uploads_view_upload_status_failed_file_error
+                        );
+                        break;
+                    case PRIVILEDGES_ERROR:
+                        status = mParentActivity.getString(
+                            R.string.uploads_view_upload_status_failed_permission_error
+                        );
+                        break;
+                    case NETWORK_CONNECTION:
+                        status = mParentActivity.getString(
+                            R.string.uploads_view_upload_status_failed_connection_error
+                        );
+                        break;
+                    case DELAYED_FOR_WIFI:
+                        status = mParentActivity.getString(
+                            R.string.uploads_view_upload_status_waiting_for_wifi
+                        );
+                        break;
+                    case CONFLICT_ERROR:
+                        status = mParentActivity.getString(
+                            R.string.uploads_view_upload_status_conflict
+                        );
+                        break;
+                    case UNKNOWN:
+                        status = mParentActivity.getString(
+                            R.string.uploads_view_upload_status_unknown_fail
+                        );
+                        break;
+                    case CANCELLED:
+                        // should not get here ; cancelled uploads should be wiped out
+                        status = mParentActivity.getString(
+                            R.string.uploads_view_upload_status_cancelled
+                        );
+                        break;
+                    case UPLOADED:
+                        // should not get here ; status should be UPLOAD_SUCCESS
+                        status =  mParentActivity.getString(R.string.uploads_view_upload_status_succeeded);
+                        break;
+                    default:
+                        status = "Naughty devs added a new fail result but no description for the user";
+                        break;
+                }
+                break;
+
+            default:
+                status = "Uncontrolled status: " + upload.getUploadStatus().toString();
+        }
+        return status;
+    }
+
 
     @Override
     public boolean hasStableIds() {
@@ -672,8 +726,6 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
 
     }
 
-    ;
-
     public void addBinder() {
         notifyDataSetChanged();
     }