mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-09-02 15:25:39 +00:00
warn if the directory is not empty
This commit is contained in:
@@ -401,7 +401,23 @@ public class UserPreference extends AppCompatActivity {
|
|||||||
new AlertDialog.Builder(this).
|
new AlertDialog.Builder(this).
|
||||||
setTitle("SD-Card root selected").
|
setTitle("SD-Card root selected").
|
||||||
setMessage("You have selected the root of your sdcard for the store. " +
|
setMessage("You have selected the root of your sdcard for the store. " +
|
||||||
"This is extremly dangerous and you will lose your data " +
|
"This is extremely dangerous and you will lose your data " +
|
||||||
|
"as its content will be deleted").
|
||||||
|
setPositiveButton("Remove everything", new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
PreferenceManager.getDefaultSharedPreferences(getApplicationContext())
|
||||||
|
.edit()
|
||||||
|
.putString("git_external_repo", uri.getPath())
|
||||||
|
.apply();
|
||||||
|
}
|
||||||
|
}).
|
||||||
|
setNegativeButton(R.string.dialog_cancel, null).show();
|
||||||
|
} else if (new File(uri.getPath()).listFiles().length != 0) {
|
||||||
|
new AlertDialog.Builder(this).
|
||||||
|
setTitle("Directory not empty").
|
||||||
|
setMessage("You have selected a non-empty directory for the store. " +
|
||||||
|
"This is extremely dangerous and you will lose your data " +
|
||||||
"as its content will be deleted").
|
"as its content will be deleted").
|
||||||
setPositiveButton("Remove everything", new DialogInterface.OnClickListener() {
|
setPositiveButton("Remove everything", new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user