mirror of
https://github.com/developersu/ns-usbloader.git
synced 2025-05-14 07:04:50 -04:00
Size displays now as GB/MB/kB
This commit is contained in:
parent
4cfd651667
commit
dc5ba1425b
5 changed files with 10 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue