Merge remote-tracking branch 'remotes/upstream/avoidDuplicateFiles' into beta
authortobiasKaminsky <tobias@kaminsky.me>
Thu, 29 Oct 2015 17:49:00 +0000 (18:49 +0100)
committertobiasKaminsky <tobias@kaminsky.me>
Thu, 29 Oct 2015 17:49:00 +0000 (18:49 +0100)
1  2 
CHANGELOG.md
res/layout/upload_files_layout.xml
res/values/strings.xml
res/xml/preferences.xml
src/com/owncloud/android/datamodel/FileDataStorageManager.java
src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java
src/com/owncloud/android/files/services/FileUploader.java
src/com/owncloud/android/ui/activity/UploadFilesActivity.java

diff --cc CHANGELOG.md
@@@ -1,15 -1,42 +1,16 @@@
 -## 1.7.2 (July 2015)
 -- New navigation drawer
 -- Improved Passcode
 -- Automatic grid view just for folders full of images
 -- More characters allowed in file names
 -- Support for servers in same domain, different path
 -- Bugs fixed:
 -  + Frequent crashes in folder with several images
 -  + Sync error in servers with huge quota and external storage enable
 -  + Share by link error 
 -  + Some other crashes and minor bugs
 -
 -## 1.7.1 (April 2015)
 -
 -- Share link even with password enforced by server
 -- Get the app ready for oc 8.1 servers
 -- Added option to create new folder in uploads from external apps
 -- Improved management of deleted users
 -- Bugs fixed
 -  + Fixed crash on Android 2.x devices
 -  + Improvements on uploads
 -
 -## 1.7.0 (February 2015)
 -
 -- Download full folders
 -- Grid view for images
 -- Remote thumbnails (OC Server 8.0+)
 -- Added number of files and folders at the end of the list
 -- "Open with" in contextual menu
 -- Downloads added to Media Provider
 -- Uploads:
 -  + Local thumbnails in section "Files"
 -  + Multiple selection in "Content from other apps" (Android 4.3+)
 -- Gallery: 
 -  + proper handling of EXIF
 -  + obey sorting in the list of files
 -- Settings view updated
 -- Improved subjects in e-mails
 -- Bugs fixed
 -
 +# 2015-10-29
 +- PR [#1099](https://github.com/owncloud/android/pull/1099) "Switch list vs grid" merged
 +- PR [#1100](https://github.com/owncloud/android/pull/1100) "Material FAB with speed dial implementation" merged
 +- PR [#1209](https://github.com/owncloud/android/pull/1209) "Material buttons - before in #1090" merged
 +- PR [#1205](https://github.com/owncloud/android/pull/1205) "Switch between online and offline files" merged
 +- PR [#1195](https://github.com/owncloud/android/pull/1195) "Resize Cache" merged
 +- PR [#1187](https://github.com/owncloud/android/pull/1187) "Video: Big thumbnails" merged
 +- PR [#1058](https://github.com/owncloud/android/pull/1058) "add sort to UploadFileActiviy" merged
++- PR [#1168](https://github.com/owncloud/android/pull/1168) "Avoid duplicate files" merged
  
  
 +# 2015-10-26
 +- start of branch
 +- PR [#745](https://github.com/owncloud/android/pull/745) merged
 +- PR [#1044](https://github.com/owncloud/android/pull/1044) merged: < 8.1: GalleryPlus app needed, >= 8.2 Gallery app needed
 +- PR [#1111](https://github.com/owncloud/android/pull/1111) merged
Simple merge
      <string name="file_list__footer__files">%1$d files</string>
      <string name="file_list__footer__files_and_folder">%1$d files, 1 folder</string>
      <string name="file_list__footer__files_and_folders">%1$d files, %2$d folders</string>
 +    <string name="action_switch_grid_view">Switch to grid view</string>
 +    <string name="action_switch_list_view">Switch to list view</string>
 +    <string name="common_category">Common</string>
 +    <string name="pref_cache_size">Cache size</string>
+     <string name="prefs_instant_behaviour_dialogTitle">Upload file to server and ...</string>
+     <string name="prefs_instant_behaviour_title">Behaviour</string>
+     <string name="upload_copy_files">Copy file</string>
+     <string name="upload_move_files">Move file</string>
+     <string name="pref_behaviour_entries_do_nothing">do nothing</string>
+     <string name="pref_behaviour_entries_copy">copy file to OC folder</string>
+     <string name="pref_behaviour_entries_move">move file to OC folder</string>
+     <string name="pref_behaviour_entries_delete">delete origin file</string>
  
  </resources>
      </PreferenceCategory>
      
        <PreferenceCategory android:title="@string/prefs_category_security">
 -          <android.preference.CheckBoxPreference android:title="@string/prefs_passcode" android:key="set_pincode" />
 +              <!-- ListPreference
 +            android:key="select_oc_account"
 +            android:title="@string/prefs_select_oc_account"
 +            android:summary="@string/prefs_summary_select_oc_account"
 +            / -->
 +              <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:title="@string/prefs_pincode" android:key="set_pincode"
 +                      android:summary="@string/prefs_pincode_summary"/>
        </PreferenceCategory>
  
-     <PreferenceCategory android:title="@string/prefs_category_instant_uploading"
-               android:key="instant_uploading_category">
+     <PreferenceCategory android:title="@string/prefs_category_instant_uploading" android:key="instant_uploading_category">
+          <com.owncloud.android.ui.dialog.OwnCloudListPreference android:key="prefs_instant_behaviour"
+                        android:dialogTitle="@string/prefs_instant_behaviour_dialogTitle"
+                        android:title="@string/prefs_instant_behaviour_title"
+                        android:entries="@array/pref_behaviour_entries"
+                        android:entryValues="@array/pref_behaviour_entryValues"
+                        android:defaultValue="NOTHING"
+                        android:summary="%s"
+                        />
  
+               <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading"
+                               android:title="@string/prefs_instant_upload"
+                               android:summary="@string/prefs_instant_upload_summary"/>
+          <com.owncloud.android.ui.PreferenceWithLongSummary
+                                                       android:title="@string/prefs_instant_upload_path_title"
+                                                       android:key="instant_upload_path" />
            <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
 -                                              android:title="@string/instant_upload_on_wifi"
 -                                              android:key="instant_upload_on_wifi"/>
 -          <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" />
 +                      android:key="instant_uploading"
 +              android:title="@string/prefs_instant_upload"
 +              android:summary="@string/prefs_instant_upload_summary"/>
 +              <com.owncloud.android.ui.PreferenceWithLongSummary
 +                      android:dependency="instant_uploading"
 +                      android:disableDependentsState="true"
 +                      android:title="@string/prefs_instant_upload_path_title"
 +                      android:key="instant_upload_path" />
 +          <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
 +                      android:dependency="instant_uploading"
 +                      android:disableDependentsState="true"
 +              android:title="@string/instant_upload_on_wifi"
 +              android:key="instant_upload_on_wifi"/>
 +              <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
 +                      android:dependency="instant_uploading"
 +                      android:disableDependentsState="true"
 +                      android:title="@string/instant_upload_on_charging"
 +                      android:key="instant_upload_on_charging"/>
 +
 +              <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" />
            <com.owncloud.android.ui.PreferenceWithLongSummary
 -                                                      android:title="@string/prefs_instant_video_upload_path_title"
 -                                                      android:key="instant_video_upload_path" />
 +                      android:dependency="instant_video_uploading"
 +                      android:disableDependentsState="true"
 +                      android:title="@string/prefs_instant_video_upload_path_title"
 +                      android:key="instant_video_upload_path" />
            <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
 -                                              android:title="@string/instant_video_upload_on_wifi"
 -                                              android:key="instant_video_upload_on_wifi"/>
 -          <!-- DISABLED FOR RELEASE UNTIL FIXED
 +                      android:dependency="instant_video_uploading"
 +                      android:disableDependentsState="true"
 +              android:title="@string/instant_video_upload_on_wifi"
 +              android:key="instant_video_upload_on_wifi"/>
 +              <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
 +                      android:dependency="instant_video_uploading"
 +                      android:disableDependentsState="true"
 +                      android:title="@string/instant_video_upload_on_charging"
 +                      android:key="instant_video_upload_on_charging"/>
 +      </PreferenceCategory>
 +      
 +      <PreferenceCategory android:title="@string/prefs_category_more" android:key="more">
 +              <!-- DISABLED FOR RELEASE UNTIL FIXED
            CheckBoxPreference android:key="log_to_file"
                                android:title="@string/prefs_log_title"
                                android:summary="@string/prefs_log_summary"/>
@@@ -33,7 -34,7 +33,8 @@@ import android.accounts.Account
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
 +import android.content.IntentFilter;
+ import android.content.SharedPreferences;
  import android.database.Cursor;
  import android.net.ConnectivityManager;
  import android.net.NetworkInfo.State;