diff --git a/pom.xml b/pom.xml
index e5c313f..d6f0097 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
NS-USBloader
ns-usbloader
- 4.2-SNAPSHOT
+ 4.2.1-SNAPSHOT
https://github.com/developersu/ns-usbloader/
diff --git a/src/main/java/nsusbloader/AppPreferences.java b/src/main/java/nsusbloader/AppPreferences.java
index a08682a..a2e6828 100644
--- a/src/main/java/nsusbloader/AppPreferences.java
+++ b/src/main/java/nsusbloader/AppPreferences.java
@@ -18,8 +18,6 @@
*/
package nsusbloader;
-import nsusbloader.Controllers.SettingsController;
-
import java.util.Locale;
import java.util.prefs.Preferences;
@@ -29,6 +27,7 @@ public class AppPreferences {
private final Preferences preferences;
private final Locale locale;
+ public static final String[] goldleafSupportedVersions = {"v0.5", "v0.7.x", "v0.8"};
private AppPreferences(){
this.preferences = Preferences.userRoot().node("NS-USBloader");
@@ -54,6 +53,7 @@ public class AppPreferences {
netUsb = "USB";
return netUsb;
}
+
public void setTheme(String theme){ preferences.put("THEME", theme); }
public void setProtocol(String protocol){ preferences.put("PROTOCOL", protocol); }
public void setNetUsb(String netUsb){ preferences.put("NETUSB", netUsb); }
@@ -109,8 +109,8 @@ public class AppPreferences {
public void setNspFileFilterGL(boolean prop){preferences.putBoolean("GL_NSP_FILTER", prop);}
public String getGlVersion(){
- int recentGlVersionIndex = SettingsController.glSupportedVersions.length - 1;
- String recentGlVersion = SettingsController.glSupportedVersions[recentGlVersionIndex];
+ int recentGlVersionIndex = goldleafSupportedVersions.length - 1;
+ String recentGlVersion = goldleafSupportedVersions[recentGlVersionIndex];
return preferences.get("gl_version", recentGlVersion);
}
public void setGlVersion(String version){ preferences.put("gl_version", version);}
diff --git a/src/main/java/nsusbloader/Controllers/FrontController.java b/src/main/java/nsusbloader/Controllers/FrontController.java
index 354f01a..96ddf07 100644
--- a/src/main/java/nsusbloader/Controllers/FrontController.java
+++ b/src/main/java/nsusbloader/Controllers/FrontController.java
@@ -201,7 +201,7 @@ public class FrontController implements Initializable {
if (getSelectedProtocol().equals("TinFoil") && MediatorControl.getInstance().getContoller().getSettingsCtrlr().getTinfoilSettings().isXciNszXczSupport())
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("NSP/XCI/NSZ/XCZ", "*.nsp", "*.xci", "*.nsz", "*.xcz"));
- else if (getSelectedProtocol().equals("GoldLeaf") && (! MediatorControl.getInstance().getContoller().getSettingsCtrlr().getNSPFileFilterForGL()))
+ else if (getSelectedProtocol().equals("GoldLeaf") && (! MediatorControl.getInstance().getContoller().getSettingsCtrlr().getGoldleafSettings().getNSPFileFilterForGL()))
fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Any file", "*.*"),
new FileChooser.ExtensionFilter("NSP ROM", "*.nsp")
);
@@ -266,10 +266,11 @@ public class FrontController implements Initializable {
SettingsController settings = MediatorControl.getInstance().getContoller().getSettingsCtrlr();
// If USB selected
if (getSelectedProtocol().equals("GoldLeaf") ){
- usbNetCommunications = new UsbCommunications(nspToUpload, "GoldLeaf" + settings.getGlVer(), settings.getNSPFileFilterForGL());
+ final SettingsBlockGoldleafController goldleafSettings = settings.getGoldleafSettings();
+ usbNetCommunications = new UsbCommunications(nspToUpload, "GoldLeaf" + goldleafSettings.getGlVer(), goldleafSettings.getNSPFileFilterForGL());
}
else if (( getSelectedProtocol().equals("TinFoil") && getSelectedNetUsb().equals("USB") )){
- usbNetCommunications = new UsbCommunications(nspToUpload, "TinFoil", settings.getNSPFileFilterForGL());
+ usbNetCommunications = new UsbCommunications(nspToUpload, "TinFoil", false);
}
else { // NET INSTALL OVER TINFOIL
final String ipValidationPattern = "^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$";
@@ -332,10 +333,11 @@ public class FrontController implements Initializable {
List filesDropped = event.getDragboard().getFiles();
SettingsController settingsController = MediatorControl.getInstance().getContoller().getSettingsCtrlr();
SettingsBlockTinfoilController tinfoilSettings = settingsController.getTinfoilSettings();
+ SettingsBlockGoldleafController goldleafController = settingsController.getGoldleafSettings();
if (getSelectedProtocol().equals("TinFoil") && tinfoilSettings.isXciNszXczSupport())
filesDropped.removeIf(file -> ! file.getName().toLowerCase().matches("(.*\\.nsp$)|(.*\\.xci$)|(.*\\.nsz$)|(.*\\.xcz$)"));
- else if (getSelectedProtocol().equals("GoldLeaf") && (! settingsController.getNSPFileFilterForGL()))
+ else if (getSelectedProtocol().equals("GoldLeaf") && (! goldleafController.getNSPFileFilterForGL()))
filesDropped.removeIf(file -> (file.isDirectory() && ! file.getName().toLowerCase().matches(".*\\.nsp$")));
else
filesDropped.removeIf(file -> ! file.getName().toLowerCase().matches(".*\\.nsp$"));
diff --git a/src/main/java/nsusbloader/Controllers/NSLMainController.java b/src/main/java/nsusbloader/Controllers/NSLMainController.java
index ea8c2da..4e564bf 100644
--- a/src/main/java/nsusbloader/Controllers/NSLMainController.java
+++ b/src/main/java/nsusbloader/Controllers/NSLMainController.java
@@ -69,7 +69,7 @@ public class NSLMainController implements Initializable {
List result = updTask.getValue();
if (result != null){
if (!result.get(0).isEmpty()) {
- SettingsTabController.setNewVersionLink(result.get(0));
+ SettingsTabController.getGenericSettings().setNewVersionLink(result.get(0));
ServiceWindow.getInfoNotification(resourceBundle.getString("windowTitleNewVersionAval"), resourceBundle.getString("windowTitleNewVersionAval") + ": " + result.get(0) + "\n\n" + result.get(1));
}
}
@@ -93,7 +93,7 @@ public class NSLMainController implements Initializable {
/**
* Provide hostServices to Settings tab
* */
- public void setHostServices(HostServices hs ){ SettingsTabController.registerHostServices(hs);}
+ public void setHostServices(HostServices hs ){ SettingsTabController.getGenericSettings().registerHostServices(hs);}
/**
* Get 'Settings' controller
diff --git a/src/main/java/nsusbloader/Controllers/RcmController.java b/src/main/java/nsusbloader/Controllers/RcmController.java
index df4fd56..3fc6b5e 100644
--- a/src/main/java/nsusbloader/Controllers/RcmController.java
+++ b/src/main/java/nsusbloader/Controllers/RcmController.java
@@ -73,6 +73,8 @@ public class RcmController implements Initializable {
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
this.rb = resourceBundle;
+ final AppPreferences preferences = AppPreferences.getInstance();
+
rcmToggleGrp.selectToggle(pldrRadio1);
pldrRadio1.setOnAction(e -> statusLbl.setText(""));
pldrRadio2.setOnAction(e -> statusLbl.setText(""));
@@ -80,11 +82,11 @@ public class RcmController implements Initializable {
pldrRadio4.setOnAction(e -> statusLbl.setText(""));
pldrRadio5.setOnAction(e -> statusLbl.setText(""));
- String recentRcm1 = AppPreferences.getInstance().getRecentRcm(1);
- String recentRcm2 = AppPreferences.getInstance().getRecentRcm(2);
- String recentRcm3 = AppPreferences.getInstance().getRecentRcm(3);
- String recentRcm4 = AppPreferences.getInstance().getRecentRcm(4);
- String recentRcm5 = AppPreferences.getInstance().getRecentRcm(5);
+ String recentRcm1 = preferences.getRecentRcm(1);
+ String recentRcm2 = preferences.getRecentRcm(2);
+ String recentRcm3 = preferences.getRecentRcm(3);
+ String recentRcm4 = preferences.getRecentRcm(4);
+ String recentRcm5 = preferences.getRecentRcm(5);
if (File.separator.equals("/"))
this.myRegexp = "^.+/";
@@ -112,7 +114,6 @@ public class RcmController implements Initializable {
payloadFPathLbl5.setText(recentRcm5);
}
- // TODO: write logic ?? Like in case PAYLOADER exist, button active. If not: not active?
injectPldBtn.setOnAction(actionEvent -> smash());
}
diff --git a/src/main/java/nsusbloader/Controllers/SettingsBlockGenericController.java b/src/main/java/nsusbloader/Controllers/SettingsBlockGenericController.java
new file mode 100644
index 0000000..00a416b
--- /dev/null
+++ b/src/main/java/nsusbloader/Controllers/SettingsBlockGenericController.java
@@ -0,0 +1,139 @@
+/*
+ Copyright 2019-2020 Dmitry Isaenko
+
+ This file is part of NS-USBloader.
+
+ NS-USBloader is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ NS-USBloader is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with NS-USBloader. If not, see .
+*/
+package nsusbloader.Controllers;
+
+import javafx.application.HostServices;
+import javafx.concurrent.Task;
+import javafx.fxml.FXML;
+import javafx.fxml.Initializable;
+import javafx.scene.control.Button;
+import javafx.scene.control.CheckBox;
+import javafx.scene.control.ChoiceBox;
+import javafx.scene.control.Hyperlink;
+import javafx.scene.layout.Region;
+import nsusbloader.AppPreferences;
+import nsusbloader.ModelControllers.UpdatesChecker;
+import nsusbloader.ServiceWindow;
+import nsusbloader.UI.LocaleHolder;
+import nsusbloader.UI.SettingsLanguagesSetup;
+import nsusbloader.Utilities.WindowsDrivers.DriversInstall;
+
+import java.net.URL;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+public class SettingsBlockGenericController implements Initializable {
+ @FXML
+ private ChoiceBox languagesChB;
+ @FXML
+ private Button submitLanguageBtn,
+ driversInstallBtn,
+ checkForUpdBtn;
+ @FXML
+ private CheckBox autoCheckForUpdatesCB;
+ @FXML
+ private Hyperlink newVersionHyperlink;
+
+ private ResourceBundle resourceBundle;
+
+ private HostServices hostServices;
+
+ @Override
+ public void initialize(URL url, ResourceBundle resourceBundle) {
+ this.resourceBundle = resourceBundle;
+ final AppPreferences preferences = AppPreferences.getInstance();
+
+ autoCheckForUpdatesCB.setSelected(preferences.getAutoCheckUpdates());
+
+ Region btnSwitchImage = new Region();
+ btnSwitchImage.getStyleClass().add("regionUpdatesCheck");
+ checkForUpdBtn.setGraphic(btnSwitchImage);
+
+ setDriversInstallFeature();
+
+ SettingsLanguagesSetup settingsLanguagesSetup = new SettingsLanguagesSetup();
+ languagesChB.setItems(settingsLanguagesSetup.getLanguages());
+ languagesChB.getSelectionModel().select(settingsLanguagesSetup.getRecentLanguage());
+
+ newVersionHyperlink.setOnAction(e-> hostServices.showDocument(newVersionHyperlink.getText()));
+ checkForUpdBtn.setOnAction(e->checkForUpdatesAction());
+ submitLanguageBtn.setOnAction(e->languageButtonAction());
+ }
+
+ private void setDriversInstallFeature(){
+ if (isWindows()){
+ Region btnDrvImage = new Region();
+ btnDrvImage.getStyleClass().add("regionWindows");
+ driversInstallBtn.setGraphic(btnDrvImage);
+ driversInstallBtn.setVisible(true);
+ driversInstallBtn.setOnAction(actionEvent -> new DriversInstall(resourceBundle));
+ }
+ }
+ private boolean isWindows(){
+ return System.getProperty("os.name").toLowerCase().replace(" ", "").contains("windows");
+ }
+
+ private void checkForUpdatesAction(){
+ Task> updTask = new UpdatesChecker();
+ updTask.setOnSucceeded(event->{
+ List result = updTask.getValue();
+
+ if (result == null){
+ ServiceWindow.getInfoNotification(resourceBundle.getString("windowTitleNewVersionUnknown"),
+ resourceBundle.getString("windowBodyNewVersionUnknown"));
+ return;
+ }
+
+ if (result.get(0).isEmpty()){
+ ServiceWindow.getInfoNotification(resourceBundle.getString("windowTitleNewVersionNOTAval"),
+ resourceBundle.getString("windowBodyNewVersionNOTAval"));
+ return;
+ }
+
+ setNewVersionLink(result.get(0));
+ ServiceWindow.getInfoNotification(resourceBundle.getString("windowTitleNewVersionAval"),
+ resourceBundle.getString("windowTitleNewVersionAval")+": "+result.get(0) + "\n\n" + result.get(1));
+ });
+ Thread updates = new Thread(updTask);
+ updates.setDaemon(true);
+ updates.start();
+ }
+
+ private void languageButtonAction(){
+ LocaleHolder localeHolder = languagesChB.getSelectionModel().getSelectedItem();
+ AppPreferences.getInstance().setLocale(localeHolder.getLocaleCode());
+ Locale newLocale = localeHolder.getLocale();
+ ServiceWindow.getInfoNotification("",
+ ResourceBundle.getBundle("locale", newLocale).getString("windowBodyRestartToApplyLang"));
+ }
+
+ private boolean getAutoCheckForUpdates(){ return autoCheckForUpdatesCB.isSelected(); }
+
+ protected void registerHostServices(HostServices hostServices){ this.hostServices = hostServices;}
+
+ void setNewVersionLink(String newVer){
+ newVersionHyperlink.setVisible(true);
+ newVersionHyperlink.setText("https://github.com/developersu/ns-usbloader/releases/tag/"+newVer);
+ }
+
+ void updatePreferencesOnExit() {
+ AppPreferences.getInstance().setAutoCheckUpdates(getAutoCheckForUpdates());
+ }
+}
diff --git a/src/main/java/nsusbloader/Controllers/SettingsBlockGoldleafController.java b/src/main/java/nsusbloader/Controllers/SettingsBlockGoldleafController.java
new file mode 100644
index 0000000..b5ba33d
--- /dev/null
+++ b/src/main/java/nsusbloader/Controllers/SettingsBlockGoldleafController.java
@@ -0,0 +1,58 @@
+/*
+ Copyright 2019-2020 Dmitry Isaenko
+
+ This file is part of NS-USBloader.
+
+ NS-USBloader is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ NS-USBloader is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with NS-USBloader. If not, see .
+*/
+package nsusbloader.Controllers;
+
+import javafx.fxml.FXML;
+import javafx.fxml.Initializable;
+import javafx.scene.control.CheckBox;
+import javafx.scene.control.ChoiceBox;
+import nsusbloader.AppPreferences;
+
+import java.net.URL;
+import java.util.ResourceBundle;
+
+public class SettingsBlockGoldleafController implements Initializable {
+ @FXML
+ private CheckBox nspFilesFilterForGLCB;
+ @FXML
+ private ChoiceBox glVersionChoiceBox;
+
+ @Override
+ public void initialize(URL url, ResourceBundle resourceBundle) {
+ final AppPreferences preferences = AppPreferences.getInstance();
+
+ nspFilesFilterForGLCB.setSelected(preferences.getNspFileFilterGL());
+ glVersionChoiceBox.getItems().addAll(AppPreferences.goldleafSupportedVersions);
+
+ glVersionChoiceBox.getSelectionModel().select(preferences.getGlVersion());
+ }
+
+ public boolean getNSPFileFilterForGL(){return nspFilesFilterForGLCB.isSelected(); }
+
+ public String getGlVer() {
+ return glVersionChoiceBox.getValue();
+ }
+
+ void updatePreferencesOnExit(){
+ final AppPreferences preferences = AppPreferences.getInstance();
+
+ preferences.setNspFileFilterGL(getNSPFileFilterForGL());
+ preferences.setGlVersion(getGlVer());
+ }
+}
diff --git a/src/main/java/nsusbloader/Controllers/SettingsBlockTinfoilController.java b/src/main/java/nsusbloader/Controllers/SettingsBlockTinfoilController.java
index ba7615a..8c28be3 100644
--- a/src/main/java/nsusbloader/Controllers/SettingsBlockTinfoilController.java
+++ b/src/main/java/nsusbloader/Controllers/SettingsBlockTinfoilController.java
@@ -145,7 +145,7 @@ public class SettingsBlockTinfoilController implements Initializable {
public boolean isNoRequestsServe(){ return noRequestsServeCB.isSelected(); }
public boolean isValidateNSHostName(){ return validateNSHostNameCB.isSelected(); }
- public void updatePreferencesOnExit(){
+ void updatePreferencesOnExit(){
AppPreferences preferences = AppPreferences.getInstance();
preferences.setNsIpValidationNeeded(isValidateNSHostName());
diff --git a/src/main/java/nsusbloader/Controllers/SettingsController.java b/src/main/java/nsusbloader/Controllers/SettingsController.java
index b1e57e3..5dfad1e 100644
--- a/src/main/java/nsusbloader/Controllers/SettingsController.java
+++ b/src/main/java/nsusbloader/Controllers/SettingsController.java
@@ -18,158 +18,23 @@
*/
package nsusbloader.Controllers;
-import javafx.application.HostServices;
-import javafx.concurrent.Task;
import javafx.fxml.FXML;
-import javafx.fxml.Initializable;
-import javafx.scene.control.*;
-import javafx.scene.layout.Region;
-import javafx.scene.layout.VBox;
-import nsusbloader.AppPreferences;
-import nsusbloader.ServiceWindow;
-import nsusbloader.ModelControllers.UpdatesChecker;
-import nsusbloader.UI.LocaleHolder;
-import nsusbloader.UI.SettingsLanguagesSetup;
-import nsusbloader.Utilities.WindowsDrivers.DriversInstall;
-import java.net.URL;
-import java.util.*;
-
-public class SettingsController implements Initializable {
+public class SettingsController {
@FXML
- private CheckBox nspFilesFilterForGLCB,
- autoCheckUpdCb;
-
- @FXML
- private Hyperlink newVersionLink;
-
- @FXML
- private Button langBtn,
- checkForUpdBtn,
- drvInstBtn;
- @FXML
- private ChoiceBox langCB;
-
- @FXML
- private ChoiceBox glVersionChoiceBox;
-
+ private SettingsBlockGenericController settingsBlockGenericController;
@FXML
private SettingsBlockTinfoilController settingsBlockTinfoilController;
+ @FXML
+ private SettingsBlockGoldleafController settingsBlockGoldleafController;
- private HostServices hostServices;
-
- public static final String[] glSupportedVersions = {"v0.5", "v0.7.x", "v0.8"};
-
- private ResourceBundle resourceBundle;
-
- @Override
- public void initialize(URL url, ResourceBundle resourceBundle) {
- this.resourceBundle = resourceBundle;
- final AppPreferences preferences = AppPreferences.getInstance();
-
- nspFilesFilterForGLCB.setSelected(preferences.getNspFileFilterGL());
-
-
-
- newVersionLink.setVisible(false);
- newVersionLink.setOnAction(e-> hostServices.showDocument(newVersionLink.getText()));
-
- autoCheckUpdCb.setSelected(preferences.getAutoCheckUpdates());
-
- Region btnSwitchImage = new Region();
- btnSwitchImage.getStyleClass().add("regionUpdatesCheck");
- checkForUpdBtn.setGraphic(btnSwitchImage);
-
- checkForUpdBtn.setOnAction(e->checkForUpdatesAction());
-
- setDriversInstallFeature();
-
- SettingsLanguagesSetup settingsLanguagesSetup = new SettingsLanguagesSetup();
- langCB.setItems(settingsLanguagesSetup.getLanguages());
- langCB.getSelectionModel().select(settingsLanguagesSetup.getRecentLanguage());
-
- configureLanguageButton();
-
- // Set supported old versions
- glVersionChoiceBox.getItems().addAll(glSupportedVersions);
- String oldVer = preferences.getGlVersion(); // Overhead; Too much validation of consistency
- glVersionChoiceBox.getSelectionModel().select(oldVer);
- }
-
- private void checkForUpdatesAction(){
- Task> updTask = new UpdatesChecker();
- updTask.setOnSucceeded(event->{
- List result = updTask.getValue();
-
- if (result == null){
- ServiceWindow.getInfoNotification(resourceBundle.getString("windowTitleNewVersionUnknown"),
- resourceBundle.getString("windowBodyNewVersionUnknown"));
- return;
- }
-
- if (result.get(0).isEmpty()){
- ServiceWindow.getInfoNotification(resourceBundle.getString("windowTitleNewVersionNOTAval"),
- resourceBundle.getString("windowBodyNewVersionNOTAval"));
- return;
- }
-
- setNewVersionLink(result.get(0));
- ServiceWindow.getInfoNotification(resourceBundle.getString("windowTitleNewVersionAval"),
- resourceBundle.getString("windowTitleNewVersionAval")+": "+result.get(0) + "\n\n" + result.get(1));
- });
- Thread updates = new Thread(updTask);
- updates.setDaemon(true);
- updates.start();
- }
-
- private void setDriversInstallFeature(){
- if (isWindows()){
- Region btnDrvImage = new Region();
- btnDrvImage.getStyleClass().add("regionWindows");
- drvInstBtn.setGraphic(btnDrvImage);
- drvInstBtn.setVisible(true);
- drvInstBtn.setOnAction(actionEvent -> new DriversInstall(resourceBundle));
- }
- }
- private boolean isWindows(){
- return System.getProperty("os.name").toLowerCase().replace(" ", "").contains("windows");
- }
-
- private void configureLanguageButton(){
- langBtn.setOnAction(e->languageButtonAction());
- }
- private void languageButtonAction(){
- LocaleHolder localeHolder = langCB.getSelectionModel().getSelectedItem();
- AppPreferences.getInstance().setLocale(localeHolder.getLocaleCode());
- Locale newLocale = localeHolder.getLocale();
- ServiceWindow.getInfoNotification("",
- ResourceBundle.getBundle("locale", newLocale).getString("windowBodyRestartToApplyLang"));
- }
-
- public boolean getNSPFileFilterForGL(){return nspFilesFilterForGLCB.isSelected(); }
-
- public boolean getAutoCheckForUpdates(){ return autoCheckUpdCb.isSelected(); }
-
- public void registerHostServices(HostServices hostServices){this.hostServices = hostServices;}
-
- public void setNewVersionLink(String newVer){
- newVersionLink.setVisible(true);
- newVersionLink.setText("https://github.com/developersu/ns-usbloader/releases/tag/"+newVer);
- }
-
- public String getGlVer() {
- return glVersionChoiceBox.getValue();
- }
-
+ public SettingsBlockGenericController getGenericSettings(){ return settingsBlockGenericController; }
+ public SettingsBlockGoldleafController getGoldleafSettings(){ return settingsBlockGoldleafController; }
public SettingsBlockTinfoilController getTinfoilSettings(){ return settingsBlockTinfoilController; }
public void updatePreferencesOnExit(){
- AppPreferences preferences = AppPreferences.getInstance();
-
- preferences.setAutoCheckUpdates(getAutoCheckForUpdates());
- preferences.setNspFileFilterGL(getNSPFileFilterForGL());
- preferences.setGlVersion(getGlVer());
-
+ settingsBlockGenericController.updatePreferencesOnExit();
+ settingsBlockGoldleafController.updatePreferencesOnExit();
settingsBlockTinfoilController.updatePreferencesOnExit();
}
}
\ No newline at end of file
diff --git a/src/main/java/nsusbloader/NSLMain.java b/src/main/java/nsusbloader/NSLMain.java
index f5b0f93..359db02 100644
--- a/src/main/java/nsusbloader/NSLMain.java
+++ b/src/main/java/nsusbloader/NSLMain.java
@@ -32,7 +32,7 @@ import java.util.ResourceBundle;
public class NSLMain extends Application {
- public static final String appVersion = "v4.2";
+ public static final String appVersion = "v4.2.1";
public static boolean isCli;
@Override
diff --git a/src/main/java/nsusbloader/cli/GoldLeafCli.java b/src/main/java/nsusbloader/cli/GoldLeafCli.java
index 577c29a..ea687af 100644
--- a/src/main/java/nsusbloader/cli/GoldLeafCli.java
+++ b/src/main/java/nsusbloader/cli/GoldLeafCli.java
@@ -18,6 +18,7 @@
*/
package nsusbloader.cli;
+import nsusbloader.AppPreferences;
import nsusbloader.COM.USB.UsbCommunications;
import nsusbloader.Controllers.SettingsController;
@@ -75,7 +76,7 @@ public class GoldLeafCli {
private String getGlSupportedVersions(){
StringBuilder builder = new StringBuilder("Supported versions: \n");
- for (String a : SettingsController.glSupportedVersions){
+ for (String a : AppPreferences.goldleafSupportedVersions){
builder.append("\t");
builder.append(a);
builder.append("\n");
@@ -98,7 +99,7 @@ public class GoldLeafCli {
"Try 'ns-usbloader -g help' for more information.");
}
- for (String version : SettingsController.glSupportedVersions){
+ for (String version : AppPreferences.goldleafSupportedVersions){
if (version.equals(goldLeafVersion))
return;
}
diff --git a/src/main/resources/NSLMain.fxml b/src/main/resources/NSLMain.fxml
index 5ffb35c..a2d42d6 100644
--- a/src/main/resources/NSLMain.fxml
+++ b/src/main/resources/NSLMain.fxml
@@ -71,7 +71,7 @@ Steps to roll NXDT functionality back:
-
+
diff --git a/src/main/resources/SettingsBlockGeneric.fxml b/src/main/resources/SettingsBlockGeneric.fxml
new file mode 100644
index 0000000..ea7e76e
--- /dev/null
+++ b/src/main/resources/SettingsBlockGeneric.fxml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/SettingsBlockGoldleaf.fxml b/src/main/resources/SettingsBlockGoldleaf.fxml
new file mode 100644
index 0000000..9c84293
--- /dev/null
+++ b/src/main/resources/SettingsBlockGoldleaf.fxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/SettingsTab.fxml b/src/main/resources/SettingsTab.fxml
index e19498e..f2fe76e 100644
--- a/src/main/resources/SettingsTab.fxml
+++ b/src/main/resources/SettingsTab.fxml
@@ -1,72 +1,21 @@
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+