diff --git a/README.md b/README.md index 2812612..eebb35c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [Support author](#support-this-app) -NS-USBloader is a PC-side **[Adubbz/TinFoil](https://github.com/Adubbz/Tinfoil/)** (version 0.2.1; USB and Network) and **GoldLeaf** (USB) NSP installer. Replacement for default **usb_install_pc.py**, **remote_install_pc.py** *(never ever use this. even if you brave. no idea why it works.)* and **GoldTree**. +NS-USBloader is a PC-side **[Adubbz/TinFoil](https://github.com/Adubbz/Tinfoil/)** (version 0.2.1; USB and Network) and **GoldLeaf** (USB) NSP installer. Replacement for default **usb_install_pc.py**, **remote_install_pc.py** and **GoldTree**. [Click here for Android version ;)](https://github.com/developersu/ns-usbloader-mobile) @@ -45,9 +45,9 @@ JRE/JDK 8u60 or higher. ### Table of supported GoldLeaf versions | GoldLeaf version | NS-USBloader version | | ---------------- | -------------------- | -| v0.5 | v0.4 - v0.5.2, v0.8 | +| v0.5 | v0.4 - v0.5.2, v0.8+ | | v0.6.1 | v0.6 | -| v0.7 | v0.7 - v0.8 | +| v0.7 | v0.7 - v0.8+ | ### Usage ##### Linux: diff --git a/src/main/java/nsusbloader/Controllers/NSLMainController.java b/src/main/java/nsusbloader/Controllers/NSLMainController.java index 144719a..b86f2e0 100644 --- a/src/main/java/nsusbloader/Controllers/NSLMainController.java +++ b/src/main/java/nsusbloader/Controllers/NSLMainController.java @@ -122,8 +122,8 @@ public class NSLMainController implements Initializable { else fileChooser.setInitialDirectory(new File(System.getProperty("user.home"))); - if (FrontTabController.getSelectedProtocol().equals("TinFoil") && SettingsTabController.getTfXCISupport()) - fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("NSP/XCI", "*.nsp", "*.xci")); + if (FrontTabController.getSelectedProtocol().equals("TinFoil") && SettingsTabController.getTfXciNszXczSupport()) + fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("NSP/XCI/NSZ/XCZ", "*.nsp", "*.xci", "*.nsz", "*.xcz")); else if (FrontTabController.getSelectedProtocol().equals("GoldLeaf") && (! SettingsTabController.getNSPFileFilterForGL())) fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Any file", "*.*"), new FileChooser.ExtensionFilter("NSP ROM", "*.nsp") @@ -253,6 +253,7 @@ public class NSLMainController implements Initializable { /** * Drag-n-drop support (drop consumer) * */ + // TODO: DO SOMETHING WITH THIS @FXML private void handleDrop(DragEvent event){ if (MediatorControl.getInstance().getTransferActive()) { @@ -261,14 +262,18 @@ public class NSLMainController implements Initializable { } List filesDropped = new ArrayList<>(); try { - if (FrontTabController.getSelectedProtocol().equals("TinFoil") && SettingsTabController.getTfXCISupport()){ + if (FrontTabController.getSelectedProtocol().equals("TinFoil") && SettingsTabController.getTfXciNszXczSupport()){ for (File fileOrDir : event.getDragboard().getFiles()) { if (fileOrDir.isDirectory()) { for (File file : fileOrDir.listFiles()) - if ((! file.isDirectory()) && (file.getName().toLowerCase().endsWith(".nsp") || file.getName().toLowerCase().endsWith(".xci"))) + if ((! file.isDirectory()) && (file.getName().toLowerCase().endsWith(".nsp") || + file.getName().toLowerCase().endsWith(".xci") || + file.getName().toLowerCase().endsWith(".nsz") || + file.getName().toLowerCase().endsWith(".xcz"))) filesDropped.add(file); } - else if (fileOrDir.getName().toLowerCase().endsWith(".nsp") || fileOrDir.getName().toLowerCase().endsWith(".xci")) + else if (fileOrDir.getName().toLowerCase().endsWith(".nsp") || fileOrDir.getName().toLowerCase().endsWith(".xci") || + fileOrDir.getName().toLowerCase().endsWith(".nsz") || fileOrDir.getName().toLowerCase().endsWith(".xcz") ) filesDropped.add(fileOrDir); } @@ -322,7 +327,7 @@ public class NSLMainController implements Initializable { SettingsTabController.getHostPort(), SettingsTabController.getHostExtra(), SettingsTabController.getAutoCheckForUpdates(), - SettingsTabController.getTfXCISupport(), + SettingsTabController.getTfXciNszXczSupport(), SettingsTabController.getNSPFileFilterForGL(), SettingsTabController.getGlOldVer() ); diff --git a/src/main/java/nsusbloader/Controllers/NSTableViewController.java b/src/main/java/nsusbloader/Controllers/NSTableViewController.java index 1370c75..e628f55 100644 --- a/src/main/java/nsusbloader/Controllers/NSTableViewController.java +++ b/src/main/java/nsusbloader/Controllers/NSTableViewController.java @@ -213,8 +213,11 @@ public class NSTableViewController implements Initializable { public void setNewProtocol(String newProtocol){ if (rowsObsLst.isEmpty()) return; - if (newProtocol.equals("GoldLeaf")) - rowsObsLst.removeIf(current -> current.getNspFileName().toLowerCase().endsWith("xci")); + if (newProtocol.equals("GoldLeaf")) { + rowsObsLst.removeIf(current -> current.getNspFileName().toLowerCase().endsWith("xci") || + current.getNspFileName().toLowerCase().endsWith("nsz") || + current.getNspFileName().toLowerCase().endsWith("xcz")); + } else rowsObsLst.removeIf(current -> ! current.getNspFileName().toLowerCase().endsWith("nsp")); table.refresh(); diff --git a/src/main/java/nsusbloader/Controllers/SettingsController.java b/src/main/java/nsusbloader/Controllers/SettingsController.java index 820456a..0f75b80 100644 --- a/src/main/java/nsusbloader/Controllers/SettingsController.java +++ b/src/main/java/nsusbloader/Controllers/SettingsController.java @@ -276,7 +276,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 boolean getTfXciNszXczSupport(){ return tfXciSpprtCb.isSelected(); } // Used also for NSZ/XCZ public void registerHostServices(HostServices hostServices){this.hs = hostServices;} diff --git a/src/main/java/nsusbloader/ServiceWindow.java b/src/main/java/nsusbloader/ServiceWindow.java index ec4adf1..2fa3175 100644 --- a/src/main/java/nsusbloader/ServiceWindow.java +++ b/src/main/java/nsusbloader/ServiceWindow.java @@ -2,6 +2,7 @@ package nsusbloader; import javafx.scene.control.Alert; import javafx.scene.control.ButtonType; +import javafx.scene.image.Image; import javafx.scene.layout.Region; import javafx.stage.Stage; @@ -29,6 +30,12 @@ public class ServiceWindow { Stage dialogStage = (Stage) alertBox.getDialogPane().getScene().getWindow(); dialogStage.setAlwaysOnTop(true); + dialogStage.getIcons().addAll( + new Image("/res/warn_ico32x32.png"), + new Image("/res/warn_ico48x48.png"), + new Image("/res/warn_ico64x64.png"), + new Image("/res/warn_ico128x128.png") + ); dialogStage.toFront(); alertBox.show(); @@ -45,6 +52,17 @@ public class ServiceWindow { alertBox.getDialogPane().setMinHeight(Region.USE_PREF_SIZE); alertBox.setResizable(true); // Java bug workaround for JDR11/OpenJFX. TODO: nothing. really. alertBox.getDialogPane().getStylesheets().add(AppPreferences.getInstance().getTheme()); + + Stage dialogStage = (Stage) alertBox.getDialogPane().getScene().getWindow(); + dialogStage.setAlwaysOnTop(true); + dialogStage.getIcons().addAll( + new Image("/res/ask_ico32x32.png"), + new Image("/res/ask_ico48x48.png"), + new Image("/res/ask_ico64x64.png"), + new Image("/res/ask_ico128x128.png") + ); + dialogStage.toFront(); + Optional result = alertBox.showAndWait(); return (result.isPresent() && result.get() == ButtonType.OK); diff --git a/src/main/resources/SettingsTab.fxml b/src/main/resources/SettingsTab.fxml index 4664798..710ce43 100644 --- a/src/main/resources/SettingsTab.fxml +++ b/src/main/resources/SettingsTab.fxml @@ -92,8 +92,8 @@