mirror of
https://github.com/developersu/ns-usbloader.git
synced 2025-05-14 07:04:50 -04:00
v0.4.1:
minor changes/updates for @rashevskyv
This commit is contained in:
parent
86e974aa48
commit
90e2bfb21d
9 changed files with 60 additions and 16 deletions
|
@ -108,8 +108,12 @@ public class NSLMainController implements Initializable {
|
|||
else
|
||||
fileChooser.setInitialDirectory(new File(System.getProperty("user.home")));
|
||||
|
||||
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("NSP ROM", "*.nsp"));
|
||||
|
||||
if (SettingsTabController.getTfXCISupport() && FrontTabController.getSelectedProtocol().equals("TinFoil")){
|
||||
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("NSP/XCI", "*.nsp", "*.xci"));
|
||||
}
|
||||
else
|
||||
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("NSP ROM", "*.nsp"));
|
||||
|
||||
filesList = fileChooser.showOpenMultipleDialog(logArea.getScene().getWindow());
|
||||
if (filesList != null && !filesList.isEmpty()) {
|
||||
FrontTabController.tableFilesListController.setFiles(filesList);
|
||||
|
@ -234,13 +238,25 @@ public class NSLMainController implements Initializable {
|
|||
}
|
||||
List<File> filesDropped = new ArrayList<>();
|
||||
try {
|
||||
for (File fileOrDir : event.getDragboard().getFiles()) {
|
||||
if (fileOrDir.getName().toLowerCase().endsWith(".nsp"))
|
||||
filesDropped.add(fileOrDir);
|
||||
else if (fileOrDir.isDirectory())
|
||||
for (File file : fileOrDir.listFiles())
|
||||
if (file.getName().toLowerCase().endsWith(".nsp"))
|
||||
filesDropped.add(file);
|
||||
if (SettingsTabController.getTfXCISupport() && FrontTabController.getSelectedProtocol().equals("TinFoil")){
|
||||
for (File fileOrDir : event.getDragboard().getFiles()) {
|
||||
if (fileOrDir.getName().toLowerCase().endsWith(".nsp") || fileOrDir.getName().toLowerCase().endsWith(".xci"))
|
||||
filesDropped.add(fileOrDir);
|
||||
else if (fileOrDir.isDirectory())
|
||||
for (File file : fileOrDir.listFiles())
|
||||
if (file.getName().toLowerCase().endsWith(".nsp") || file.getName().toLowerCase().endsWith(".xci"))
|
||||
filesDropped.add(file);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (File fileOrDir : event.getDragboard().getFiles()) {
|
||||
if (fileOrDir.getName().toLowerCase().endsWith(".nsp"))
|
||||
filesDropped.add(fileOrDir);
|
||||
else if (fileOrDir.isDirectory())
|
||||
for (File file : fileOrDir.listFiles())
|
||||
if (file.getName().toLowerCase().endsWith(".nsp"))
|
||||
filesDropped.add(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (SecurityException se){
|
||||
|
@ -268,7 +284,8 @@ public class NSLMainController implements Initializable {
|
|||
SettingsTabController.getHostIp(),
|
||||
SettingsTabController.getHostPort(),
|
||||
SettingsTabController.getHostExtra(),
|
||||
SettingsTabController.getAutoCheckForUpdates()
|
||||
SettingsTabController.getAutoCheckForUpdates(),
|
||||
SettingsTabController.getTfXCISupport()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.io.File;
|
|||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class NSTableViewController implements Initializable {
|
||||
|
@ -259,9 +260,16 @@ public class NSTableViewController implements Initializable {
|
|||
model.setMarkForUpload(true);
|
||||
}
|
||||
else {
|
||||
for (NSLRowModel model: rowsObsLst)
|
||||
model.setMarkForUpload(false);
|
||||
rowsObsLst.get(0).setMarkForUpload(true);
|
||||
ListIterator<NSLRowModel> iterator = rowsObsLst.listIterator();
|
||||
while (iterator.hasNext()){
|
||||
NSLRowModel current = iterator.next();
|
||||
if (current.getNspFileName().toLowerCase().endsWith("xci"))
|
||||
iterator.remove();
|
||||
else
|
||||
current.setMarkForUpload(false);
|
||||
}
|
||||
if (!rowsObsLst.isEmpty())
|
||||
rowsObsLst.get(0).setMarkForUpload(true);
|
||||
}
|
||||
table.refresh();
|
||||
}
|
||||
|
|
|
@ -45,6 +45,8 @@ public class SettingsController implements Initializable {
|
|||
private Hyperlink newVersionLink;
|
||||
@FXML
|
||||
private Button checkForUpdBtn;
|
||||
@FXML
|
||||
private CheckBox tfXciSpprtCb;
|
||||
|
||||
private HostServices hs;
|
||||
|
||||
|
@ -176,6 +178,7 @@ public class SettingsController implements Initializable {
|
|||
updates.setDaemon(true);
|
||||
updates.start();
|
||||
});
|
||||
tfXciSpprtCb.setSelected(AppPreferences.getInstance().getTfXCI());
|
||||
}
|
||||
|
||||
public boolean getExpertModeSelected(){ return expertModeCb.isSelected(); }
|
||||
|
@ -189,6 +192,7 @@ public class SettingsController implements Initializable {
|
|||
public String getHostPort(){ return pcPortTextField.getText(); }
|
||||
public String getHostExtra(){ return pcExtraTextField.getText(); }
|
||||
public boolean getAutoCheckForUpdates(){ return autoCheckUpdCb.isSelected(); }
|
||||
public boolean getTfXCISupport(){ return tfXciSpprtCb.isSelected(); }
|
||||
|
||||
public void registerHostServices(HostServices hostServices){this.hs = hostServices;}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue