mirror of
https://github.com/developersu/ns-usbloader.git
synced 2025-05-14 07:04:50 -04:00
v0.2-development intermediate results. Almost ready.
This commit is contained in:
parent
ad23eb0c82
commit
c4d0959cf3
14 changed files with 405 additions and 293 deletions
|
@ -1,12 +1,12 @@
|
|||
package nsusbloader.Controllers;
|
||||
|
||||
import nsusbloader.NSLDataTypes.FileStatus;
|
||||
import nsusbloader.NSLDataTypes.EFileStatus;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class NSLRowModel {
|
||||
|
||||
private String status; // 0 = unknown, 1 = uploaded, 2 = bad file
|
||||
private String status;
|
||||
private File nspFile;
|
||||
private String nspFileName;
|
||||
private String nspFileSize;
|
||||
|
@ -35,24 +35,20 @@ public class NSLRowModel {
|
|||
public void setMarkForUpload(boolean value){
|
||||
markForUpload = value;
|
||||
}
|
||||
|
||||
public void setStatus(FileStatus status){ // TODO: Localization
|
||||
public File getNspFile(){ return nspFile; }
|
||||
public void setStatus(EFileStatus status){ // TODO: Localization
|
||||
switch (status){
|
||||
case FAILED:
|
||||
this.status = "Upload failed";
|
||||
break;
|
||||
case UPLOADED:
|
||||
this.status = "Uploaded";
|
||||
markForUpload = false;
|
||||
break;
|
||||
case INCORRECT:
|
||||
case FAILED:
|
||||
this.status = "Upload failed";
|
||||
break;
|
||||
case INCORRECT_FILE_FAILED:
|
||||
this.status = "File incorrect";
|
||||
markForUpload = false;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
public File getNspFile(){
|
||||
return nspFile;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import javafx.scene.control.TableView;
|
|||
import javafx.scene.control.cell.CheckBoxTableCell;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.util.Callback;
|
||||
import nsusbloader.NSLDataTypes.FileStatus;
|
||||
import nsusbloader.NSLDataTypes.EFileStatus;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
|
@ -91,7 +91,8 @@ public class NSTableViewController implements Initializable {
|
|||
for (NSLRowModel model: rowsObsLst){
|
||||
if (model != modelChecked)
|
||||
model.setMarkForUpload(false);
|
||||
}table.refresh();
|
||||
}
|
||||
table.refresh();
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -136,9 +137,9 @@ public class NSTableViewController implements Initializable {
|
|||
}
|
||||
}
|
||||
/**
|
||||
* Update files in case something is wrong. Requested from UsbCommunications _OR_ PFS
|
||||
* Update files in case something is wrong. Requested from UsbCommunications
|
||||
* */
|
||||
public void setFileStatus(String fileName, FileStatus status){
|
||||
public void setFileStatus(String fileName, EFileStatus status){
|
||||
for (NSLRowModel model: rowsObsLst){
|
||||
if (model.getNspFileName().equals(fileName)){
|
||||
model.setStatus(status);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue