From 077aa9b0d8246403f9247164bb1e8cf340537518 Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Thu, 24 Oct 2019 16:33:42 +0300 Subject: [PATCH] Update checkboxes representation in dark theme Add icons to pop-up windows Add NSZ, XCZ filters in addition to XCI while option in settings selected + updated translation strings for this option in all currently available locales (bad idea, should be validated by native-speakers once they get a chance) --- README.md | 6 +++--- .../Controllers/NSLMainController.java | 17 +++++++++++------ .../Controllers/NSTableViewController.java | 7 +++++-- .../Controllers/SettingsController.java | 2 +- src/main/java/nsusbloader/ServiceWindow.java | 18 ++++++++++++++++++ src/main/resources/SettingsTab.fxml | 4 ++-- src/main/resources/locale.properties | 4 ++-- src/main/resources/locale_deu.properties | 4 ++-- src/main/resources/locale_fra.properties | 4 ++-- src/main/resources/locale_kor.properties | 4 ++-- src/main/resources/locale_por.properties | 4 ++-- src/main/resources/locale_rus.properties | 4 ++-- src/main/resources/locale_spa.properties | 4 ++-- src/main/resources/locale_ukr.properties | 4 ++-- src/main/resources/locale_vie.properties | 4 ++-- src/main/resources/locale_zho.properties | 4 ++-- src/main/resources/res/app_dark.css | 18 +++++++++++++----- src/main/resources/res/ask_ico128x128.png | Bin 0 -> 11860 bytes src/main/resources/res/ask_ico32x32.png | Bin 0 -> 4766 bytes src/main/resources/res/ask_ico48x48.png | Bin 0 -> 9030 bytes src/main/resources/res/ask_ico64x64.png | Bin 0 -> 8934 bytes src/main/resources/res/warn_ico128x128.png | Bin 0 -> 9987 bytes src/main/resources/res/warn_ico32x32.png | Bin 0 -> 4188 bytes src/main/resources/res/warn_ico48x48.png | Bin 0 -> 7768 bytes src/main/resources/res/warn_ico64x64.png | Bin 0 -> 7495 bytes 25 files changed, 73 insertions(+), 39 deletions(-) create mode 100644 src/main/resources/res/ask_ico128x128.png create mode 100644 src/main/resources/res/ask_ico32x32.png create mode 100644 src/main/resources/res/ask_ico48x48.png create mode 100644 src/main/resources/res/ask_ico64x64.png create mode 100644 src/main/resources/res/warn_ico128x128.png create mode 100644 src/main/resources/res/warn_ico32x32.png create mode 100644 src/main/resources/res/warn_ico48x48.png create mode 100644 src/main/resources/res/warn_ico64x64.png 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 @@