mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +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() {
|
new CopyDialog(this, files, new CopyMoveTask.CopyMoveListener() {
|
||||||
@Override
|
@Override
|
||||||
public void copySucceeded(boolean deleted) {
|
public void copySucceeded(boolean deleted, boolean copiedAll) {
|
||||||
if (deleted)
|
int msgId;
|
||||||
|
if (deleted) {
|
||||||
getDirectories();
|
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
|
@Override
|
||||||
|
|
|
@ -419,10 +419,15 @@ public class MediaActivity extends SimpleActivity
|
||||||
|
|
||||||
new CopyDialog(this, files, new CopyMoveTask.CopyMoveListener() {
|
new CopyDialog(this, files, new CopyMoveTask.CopyMoveListener() {
|
||||||
@Override
|
@Override
|
||||||
public void copySucceeded(boolean deleted) {
|
public void copySucceeded(boolean deleted, boolean copiedAll) {
|
||||||
if (deleted)
|
int msgId;
|
||||||
|
if (deleted) {
|
||||||
refreshDir();
|
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
|
@Override
|
||||||
|
|
|
@ -192,10 +192,15 @@ public class ViewPagerActivity extends SimpleActivity
|
||||||
files.add(file);
|
files.add(file);
|
||||||
new CopyDialog(this, files, new CopyMoveTask.CopyMoveListener() {
|
new CopyDialog(this, files, new CopyMoveTask.CopyMoveListener() {
|
||||||
@Override
|
@Override
|
||||||
public void copySucceeded(boolean deleted) {
|
public void copySucceeded(boolean deleted, boolean copiedAll) {
|
||||||
if (deleted)
|
int msgId;
|
||||||
|
if (deleted) {
|
||||||
reloadViewPager();
|
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
|
@Override
|
||||||
|
|
|
@ -89,13 +89,13 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList<File>, val c
|
||||||
updatedFiles.addAll(files)
|
updatedFiles.addAll(files)
|
||||||
for (file in files) {
|
for (file in files) {
|
||||||
val destination = File(destinationDir, file.name)
|
val destination = File(destinationDir, file.name)
|
||||||
file.renameTo(destination)
|
if (file.renameTo(destination))
|
||||||
updatedFiles.add(destination)
|
updatedFiles.add(destination)
|
||||||
}
|
}
|
||||||
|
|
||||||
context.scanFiles(updatedFiles) {}
|
context.scanFiles(updatedFiles) {}
|
||||||
dismiss()
|
dismiss()
|
||||||
copyMoveListener.copySucceeded(true)
|
copyMoveListener.copySucceeded(true, files.size * 2 == updatedFiles.size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -56,6 +56,8 @@
|
||||||
<string name="moving">Moving…</string>
|
<string name="moving">Moving…</string>
|
||||||
<string name="moving_success">Files moved successfully</string>
|
<string name="moving_success">Files moved successfully</string>
|
||||||
<string name="already_exists">A file with that name already exists</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">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 Ordner gelöscht</item>
|
<item quantity="one">1 Ordner gelöscht</item>
|
||||||
|
|
|
@ -56,6 +56,8 @@
|
||||||
<string name="moving">Moving…</string>
|
<string name="moving">Moving…</string>
|
||||||
<string name="moving_success">Files moved successfully</string>
|
<string name="moving_success">Files moved successfully</string>
|
||||||
<string name="already_exists">A file with that name already exists</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">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 carpeta eliminada</item>
|
<item quantity="one">1 carpeta eliminada</item>
|
||||||
|
|
|
@ -56,6 +56,8 @@
|
||||||
<string name="moving">Moving…</string>
|
<string name="moving">Moving…</string>
|
||||||
<string name="moving_success">Files moved successfully</string>
|
<string name="moving_success">Files moved successfully</string>
|
||||||
<string name="already_exists">A file with that name already exists</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">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 cartella eliminata</item>
|
<item quantity="one">1 cartella eliminata</item>
|
||||||
|
|
|
@ -56,6 +56,8 @@
|
||||||
<string name="moving">Moving…</string>
|
<string name="moving">Moving…</string>
|
||||||
<string name="moving_success">Files moved successfully</string>
|
<string name="moving_success">Files moved successfully</string>
|
||||||
<string name="already_exists">A file with that name already exists</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">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 フォルダーを削除しました</item>
|
<item quantity="one">1 フォルダーを削除しました</item>
|
||||||
|
|
|
@ -56,6 +56,8 @@
|
||||||
<string name="moving">Moving…</string>
|
<string name="moving">Moving…</string>
|
||||||
<string name="moving_success">Files moved successfully</string>
|
<string name="moving_success">Files moved successfully</string>
|
||||||
<string name="already_exists">Já existe um ficheiro com este nome</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">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 pasta apagada</item>
|
<item quantity="one">1 pasta apagada</item>
|
||||||
|
|
|
@ -56,6 +56,8 @@
|
||||||
<string name="moving">Moving…</string>
|
<string name="moving">Moving…</string>
|
||||||
<string name="moving_success">Files moved successfully</string>
|
<string name="moving_success">Files moved successfully</string>
|
||||||
<string name="already_exists">A file with that name already exists</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">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 mapp borttagen</item>
|
<item quantity="one">1 mapp borttagen</item>
|
||||||
|
|
|
@ -56,6 +56,8 @@
|
||||||
<string name="moving">Moving…</string>
|
<string name="moving">Moving…</string>
|
||||||
<string name="moving_success">Files moved successfully</string>
|
<string name="moving_success">Files moved successfully</string>
|
||||||
<string name="already_exists">A file with that name already exists</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">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 folder deleted</item>
|
<item quantity="one">1 folder deleted</item>
|
||||||
|
|
Loading…
Reference in a new issue