mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
let the user know if not all files have been copied/moved
This commit is contained in:
parent
4f21221698
commit
afb722ab24
11 changed files with 41 additions and 12 deletions
|
@ -332,10 +332,15 @@ public class MainActivity extends SimpleActivity
|
|||
|
||||
new CopyDialog(this, files, new CopyMoveTask.CopyMoveListener() {
|
||||
@Override
|
||||
public void copySucceeded(boolean deleted) {
|
||||
if (deleted)
|
||||
public void copySucceeded(boolean deleted, boolean copiedAll) {
|
||||
int msgId;
|
||||
if (deleted) {
|
||||
getDirectories();
|
||||
Utils.Companion.showToast(getApplicationContext(), deleted ? R.string.moving_success : R.string.copying_success);
|
||||
msgId = copiedAll ? R.string.moving_success : R.string.moving_success_partial;
|
||||
} else {
|
||||
msgId = copiedAll? R.string.copying_success : R.string.copying_success_partial;
|
||||
}
|
||||
Utils.Companion.showToast(getApplicationContext(), msgId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -419,10 +419,15 @@ public class MediaActivity extends SimpleActivity
|
|||
|
||||
new CopyDialog(this, files, new CopyMoveTask.CopyMoveListener() {
|
||||
@Override
|
||||
public void copySucceeded(boolean deleted) {
|
||||
if (deleted)
|
||||
public void copySucceeded(boolean deleted, boolean copiedAll) {
|
||||
int msgId;
|
||||
if (deleted) {
|
||||
refreshDir();
|
||||
Utils.Companion.showToast(getApplicationContext(), deleted ? R.string.moving_success : R.string.copying_success);
|
||||
msgId = copiedAll ? R.string.moving_success : R.string.moving_success_partial;
|
||||
} else {
|
||||
msgId = copiedAll? R.string.copying_success : R.string.copying_success_partial;
|
||||
}
|
||||
Utils.Companion.showToast(getApplicationContext(), msgId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -192,10 +192,15 @@ public class ViewPagerActivity extends SimpleActivity
|
|||
files.add(file);
|
||||
new CopyDialog(this, files, new CopyMoveTask.CopyMoveListener() {
|
||||
@Override
|
||||
public void copySucceeded(boolean deleted) {
|
||||
if (deleted)
|
||||
public void copySucceeded(boolean deleted, boolean copiedAll) {
|
||||
int msgId;
|
||||
if (deleted) {
|
||||
reloadViewPager();
|
||||
Utils.Companion.showToast(getApplicationContext(), deleted ? R.string.moving_success : R.string.copying_success);
|
||||
msgId = copiedAll ? R.string.moving_success : R.string.moving_success_partial;
|
||||
} else {
|
||||
msgId = copiedAll? R.string.copying_success : R.string.copying_success_partial;
|
||||
}
|
||||
Utils.Companion.showToast(getApplicationContext(), msgId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -89,13 +89,13 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList<File>, val c
|
|||
updatedFiles.addAll(files)
|
||||
for (file in files) {
|
||||
val destination = File(destinationDir, file.name)
|
||||
file.renameTo(destination)
|
||||
updatedFiles.add(destination)
|
||||
if (file.renameTo(destination))
|
||||
updatedFiles.add(destination)
|
||||
}
|
||||
|
||||
context.scanFiles(updatedFiles) {}
|
||||
dismiss()
|
||||
copyMoveListener.copySucceeded(true)
|
||||
copyMoveListener.copySucceeded(true, files.size * 2 == updatedFiles.size)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -56,6 +56,8 @@
|
|||
<string name="moving">Moving…</string>
|
||||
<string name="moving_success">Files moved successfully</string>
|
||||
<string name="already_exists">A file with that name already exists</string>
|
||||
<string name="moving_success_partial">Some files could not be moved</string>
|
||||
<string name="copying_success_partial">Some files could not be copied</string>
|
||||
|
||||
<plurals name="folders_deleted">
|
||||
<item quantity="one">1 Ordner gelöscht</item>
|
||||
|
|
|
@ -56,6 +56,8 @@
|
|||
<string name="moving">Moving…</string>
|
||||
<string name="moving_success">Files moved successfully</string>
|
||||
<string name="already_exists">A file with that name already exists</string>
|
||||
<string name="moving_success_partial">Some files could not be moved</string>
|
||||
<string name="copying_success_partial">Some files could not be copied</string>
|
||||
|
||||
<plurals name="folders_deleted">
|
||||
<item quantity="one">1 carpeta eliminada</item>
|
||||
|
|
|
@ -56,6 +56,8 @@
|
|||
<string name="moving">Moving…</string>
|
||||
<string name="moving_success">Files moved successfully</string>
|
||||
<string name="already_exists">A file with that name already exists</string>
|
||||
<string name="moving_success_partial">Some files could not be moved</string>
|
||||
<string name="copying_success_partial">Some files could not be copied</string>
|
||||
|
||||
<plurals name="folders_deleted">
|
||||
<item quantity="one">1 cartella eliminata</item>
|
||||
|
|
|
@ -56,6 +56,8 @@
|
|||
<string name="moving">Moving…</string>
|
||||
<string name="moving_success">Files moved successfully</string>
|
||||
<string name="already_exists">A file with that name already exists</string>
|
||||
<string name="moving_success_partial">Some files could not be moved</string>
|
||||
<string name="copying_success_partial">Some files could not be copied</string>
|
||||
|
||||
<plurals name="folders_deleted">
|
||||
<item quantity="one">1 フォルダーを削除しました</item>
|
||||
|
|
|
@ -56,6 +56,8 @@
|
|||
<string name="moving">Moving…</string>
|
||||
<string name="moving_success">Files moved successfully</string>
|
||||
<string name="already_exists">Já existe um ficheiro com este nome</string>
|
||||
<string name="moving_success_partial">Some files could not be moved</string>
|
||||
<string name="copying_success_partial">Some files could not be copied</string>
|
||||
|
||||
<plurals name="folders_deleted">
|
||||
<item quantity="one">1 pasta apagada</item>
|
||||
|
|
|
@ -56,6 +56,8 @@
|
|||
<string name="moving">Moving…</string>
|
||||
<string name="moving_success">Files moved successfully</string>
|
||||
<string name="already_exists">A file with that name already exists</string>
|
||||
<string name="moving_success_partial">Some files could not be moved</string>
|
||||
<string name="copying_success_partial">Some files could not be copied</string>
|
||||
|
||||
<plurals name="folders_deleted">
|
||||
<item quantity="one">1 mapp borttagen</item>
|
||||
|
|
|
@ -56,6 +56,8 @@
|
|||
<string name="moving">Moving…</string>
|
||||
<string name="moving_success">Files moved successfully</string>
|
||||
<string name="already_exists">A file with that name already exists</string>
|
||||
<string name="moving_success_partial">Some files could not be moved</string>
|
||||
<string name="copying_success_partial">Some files could not be copied</string>
|
||||
|
||||
<plurals name="folders_deleted">
|
||||
<item quantity="one">1 folder deleted</item>
|
||||
|
|
Loading…
Reference in a new issue