Update scan-folder-to-add-files function: set pop-up window with indicator showing how many files did we scan and how many files would be added.

Minor color corrections on light theme for whoever use it
Fix TF progress-bar (can't recall when I broke it..)
This commit is contained in:
Dmitry Isaenko 2020-12-10 00:07:44 +03:00
parent 619a2b157e
commit d8ea426fa4
11 changed files with 247 additions and 32 deletions

View file

@ -222,7 +222,6 @@ class TinFoil extends TransferModule {
if ((currentOffset + chunk) >= size )
chunk = Math.toIntExact(size - currentOffset);
//System.out.println("CO: "+currentOffset+"\t\tEO: "+size+"\t\tRP: "+chunk); // NOTE: DEBUG
logPrinter.updateProgress((currentOffset + chunk) / (size / 100.0) / 100.0);
readBuffer = new byte[chunk]; // TODO: not perfect moment, consider refactoring.
@ -232,6 +231,7 @@ class TinFoil extends TransferModule {
if (writeUsb(readBuffer))
throw new IOException("TF Failure during file transfer.");
currentOffset += chunk;
logPrinter.updateProgress((double)currentOffset / (double)size);
}
nsSplitReader.close();
logPrinter.updateProgress(1.0);
@ -251,7 +251,6 @@ class TinFoil extends TransferModule {
if ((currentOffset + chunk) >= size)
chunk = Math.toIntExact(size - currentOffset);
//System.out.println("CO: "+currentOffset+"\t\tEO: "+receivedRangeSize+"\t\tRP: "+chunk); // NOTE: DEBUG
logPrinter.updateProgress((currentOffset + chunk) / (size / 100.0) / 100.0);
readBuffer = new byte[chunk];
@ -261,6 +260,7 @@ class TinFoil extends TransferModule {
if (writeUsb(readBuffer))
throw new IOException("TF Failure during file transfer.");
currentOffset += chunk;
logPrinter.updateProgress((double)currentOffset / (double)size);
}
bufferedInStream.close();
logPrinter.updateProgress(1.0);