Size displays now as GB/MB/kB

This commit is contained in:
Dmitry Isaenko 2019-03-15 00:58:04 +03:00
parent 4cfd651667
commit dc5ba1425b
5 changed files with 10 additions and 6 deletions

View file

@ -223,7 +223,7 @@ public class NSLMainController implements Initializable {
if ((filesAlreadyInTable = tableFilesListController.getFiles()) != null) {
filesDropped.removeAll(filesAlreadyInTable); // Get what we already have and add new file(s)
if (!filesDropped.isEmpty()) {
filesDropped.addAll(tableFilesListController.getFiles());
filesDropped.addAll(filesAlreadyInTable);
tableFilesListController.setFiles(filesDropped);
}
}
@ -234,7 +234,6 @@ public class NSLMainController implements Initializable {
}
event.setDropCompleted(true);
}
/**
* Save preferences before exit

View file

@ -16,7 +16,12 @@ public class NSLRowModel {
this.nspFile = nspFile;
this.markForUpload = checkBoxValue;
this.nspFileName = nspFile.getName();
this.nspFileSize = String.format("%.2f", nspFile.length()/1024.0/1024.0);
if (nspFile.length()/1024.0/1024.0/1024.0 > 1)
this.nspFileSize = String.format("%.2f", nspFile.length()/1024.0/1024.0/1024.0)+" GB";
else if (nspFile.length()/1024.0/1024.0 > 1)
this.nspFileSize = String.format("%.2f", nspFile.length()/1024.0/1024.0)+" MB";
else
this.nspFileSize = String.format("%.2f", nspFile.length()/1024.0)+" kB";
this.status = "";
}
// Model methods start