Merge branch 'master' of https://github.com/loripino21/android into instant_upload_path_chooseable

This commit is contained in:
jabarros 2014-10-06 14:58:34 +02:00
commit 1e7e893321
3 changed files with 13 additions and 3 deletions

View file

@ -251,6 +251,7 @@
<string name="preview_image_error_unknown_format">This image cannot be shown</string>
<string name="error__upload__local_file_not_copied">%1$s could not be copied to %2$s local folder</string>
<string name="prefs_instant_upload_path_title">Upload Path</string>
<string name="share_link_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your
administrator.</string>

View file

@ -36,6 +36,11 @@
android:disableDependentsState="true"
android:title="@string/instant_upload_on_wifi"
android:key="instant_upload_on_wifi"/>
<EditTextPreference android:dependency="instant_uploading"
android:disableDependentsState="true"
android:title="@string/prefs_instant_upload_path_title"
android:defaultValue="@string/instant_upload_path"
android:key="instant_upload_path"/>
<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_video_uploading"
android:title="@string/prefs_instant_video_upload"
android:summary="@string/prefs_instant_video_upload_summary"/>

View file

@ -26,6 +26,8 @@ import com.owncloud.android.lib.resources.files.RemoteFile;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.net.Uri;
import android.os.Environment;
import android.os.StatFs;
@ -73,7 +75,9 @@ public class FileStorageUtils {
}
public static String getInstantUploadFilePath(Context context, String fileName) {
String uploadPath = context.getString(R.string.instant_upload_path);
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
String uploadPathdef = context.getString(R.string.instant_upload_path);
String uploadPath = pref.getString("instant_upload_path", uploadPathdef);
String value = uploadPath + OCFile.PATH_SEPARATOR + (fileName == null ? "" : fileName);
return value;
}