mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 10:18:59 +03:00
add skip option in case of name collision
Signed-off-by: dassio <dassio@icloud.com>
This commit is contained in:
parent
aa9966d8a3
commit
b408c74b04
3 changed files with 8 additions and 2 deletions
|
@ -584,7 +584,7 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
|
|||
|
||||
/**
|
||||
* Get index for name collision selection dialog.
|
||||
* @return 0 if ASK_USER, 1 if OVERWRITE, 2 if RENAME. Otherwise: 0
|
||||
* @return 0 if ASK_USER, 1 if OVERWRITE, 2 if RENAME, 3 if SKIP, Otherwise: 0
|
||||
*/
|
||||
static private Integer getSelectionIndexForNameCollisionPolicy(FileUploader.NameCollisionPolicy nameCollisionPolicy) {
|
||||
switch (nameCollisionPolicy) {
|
||||
|
@ -592,6 +592,8 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
|
|||
return 1;
|
||||
case RENAME:
|
||||
return 2;
|
||||
case CANCEL:
|
||||
return 3;
|
||||
case ASK_USER:
|
||||
default:
|
||||
return 0;
|
||||
|
@ -601,7 +603,7 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
|
|||
/**
|
||||
* Get index for name collision selection dialog.
|
||||
* Inverse of getSelectionIndexForNameCollisionPolicy.
|
||||
* @return ASK_USER if 0, OVERWRITE if 1, RENAME if 2. Otherwise: ASK_USEr
|
||||
* @return ASK_USER if 0, OVERWRITE if 1, RENAME if 2, SKIP if 3. Otherwise: ASK_USEr
|
||||
*/
|
||||
static private FileUploader.NameCollisionPolicy getNameCollisionPolicyForSelectionIndex(int index) {
|
||||
switch (index) {
|
||||
|
@ -609,6 +611,8 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
|
|||
return FileUploader.NameCollisionPolicy.OVERWRITE;
|
||||
case 2:
|
||||
return FileUploader.NameCollisionPolicy.RENAME;
|
||||
case 3:
|
||||
return FileUploader.NameCollisionPolicy.CANCEL;
|
||||
case 0:
|
||||
default:
|
||||
return FileUploader.NameCollisionPolicy.ASK_USER;
|
||||
|
|
|
@ -16,5 +16,6 @@
|
|||
<item>@string/pref_instant_name_collision_policy_entries_always_ask</item>
|
||||
<item>@string/pref_instant_name_collision_policy_entries_overwrite</item>
|
||||
<item>@string/pref_instant_name_collision_policy_entries_rename</item>
|
||||
<item>@string/pref_instant_name_collision_policy_entries_cancel</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
|
|
@ -459,6 +459,7 @@
|
|||
<string name="pref_instant_name_collision_policy_entries_always_ask">Ask me every time</string>
|
||||
<string name="pref_instant_name_collision_policy_entries_rename">Rename new version</string>
|
||||
<string name="pref_instant_name_collision_policy_entries_overwrite">Overwrite remote version</string>
|
||||
<string name="pref_instant_name_collision_policy_entries_cancel">Skip uploading</string>
|
||||
|
||||
<string name="share_dialog_title">Sharing</string>
|
||||
<string name="share_file">Share %1$s</string>
|
||||
|
|
Loading…
Reference in a new issue