Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option Awoo-installer in dropdown #90

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/main/java/nsusbloader/Controllers/GamesController.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
this.resourceBundle = resourceBundle;
AppPreferences preferences = AppPreferences.getInstance();

ObservableList<String> choiceProtocolList = FXCollections.observableArrayList("TinFoil", "GoldLeaf");
ObservableList<String> choiceProtocolList = FXCollections.observableArrayList("TinFoil", "Awoo-installer", "GoldLeaf");

choiceProtocol.setItems(choiceProtocolList);
choiceProtocol.getSelectionModel().select(preferences.getProtocol());
Expand Down Expand Up @@ -121,7 +121,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
});
// Set and configure NS IP field behavior
nsIpTextField.setText(preferences.getNsIp());
if (getSelectedProtocol().equals("TinFoil") && getSelectedNetUsb().equals("NET")){
if (( getSelectedProtocol().equals("TinFoil") || getSelectedProtocol().equals("Awoo-installer") ) && getSelectedNetUsb().equals("NET")){
nsIpLbl.setVisible(true);
nsIpTextField.setVisible(true);
}
Expand All @@ -145,7 +145,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
selectSplitNspBtn.getStyleClass().add("buttonSelect");

uploadStopBtn.setOnAction(e-> uploadBtnAction());
uploadStopBtn.setDisable(getSelectedProtocol().equals("TinFoil"));
uploadStopBtn.setDisable(( getSelectedProtocol().equals("TinFoil") || getSelectedProtocol().equals("Awoo-installer") ));

this.btnUpStopImage = new Region();
btnUpStopImage.getStyleClass().add("regionUpload");
Expand Down Expand Up @@ -197,7 +197,7 @@ private boolean isGoldLeaf() {
}

private boolean isTinfoil() {
return getSelectedProtocol().equals("TinFoil");
return getSelectedProtocol().equals("TinFoil") || getSelectedProtocol().equals("Awoo-installer");
}

private boolean isAllFiletypesAllowedForGL() {
Expand All @@ -216,7 +216,7 @@ private boolean isXciNszXczSupport() {
* etc..
*/
private String getRegexForFiles() {
if (isTinfoil() && isXciNszXczSupport())
if (( getSelectedProtocol().equals("TinFoil") || getSelectedProtocol().equals("Awoo-installer") ) && isXciNszXczSupport())
return REGEX_ALLFILES_TINFOIL;
else if (isGoldLeaf() && isAllFiletypesAllowedForGL())
return REGEX_ALLFILES;
Expand All @@ -241,7 +241,7 @@ private void selectFilesBtnAction() {

fileChooser.setInitialDirectory(new File(FilesHelper.getRealFolder(previouslyOpenedPath)));

if (isTinfoil() && isXciNszXczSupport()) {
if (( getSelectedProtocol().equals("TinFoil") || getSelectedProtocol().equals("Awoo-installer") ) && isXciNszXczSupport()) {
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("NSP/XCI/NSZ/XCZ", "*.nsp", "*.xci", "*.nsz", "*.xcz"));
}
else if (isGoldLeaf() && isAllFiletypesAllowedForGL()) {
Expand Down Expand Up @@ -353,7 +353,7 @@ private void uploadBtnAction(){

TextArea logArea = MediatorControl.getInstance().getContoller().logArea;

if (getSelectedProtocol().equals("TinFoil") && tableFilesListController.getFilesForUpload() == null) {
if (( getSelectedProtocol().equals("TinFoil") || getSelectedProtocol().equals("Awoo-installer")) && tableFilesListController.getFilesForUpload() == null) {
logArea.setText(resourceBundle.getString("tab3_Txt_NoFolderOrFileSelected"));
return;
}
Expand All @@ -369,11 +369,11 @@ private void uploadBtnAction(){

SettingsController settings = MediatorControl.getInstance().getSettingsController();
// If USB selected
if (getSelectedProtocol().equals("GoldLeaf") ){
if (getSelectedProtocol().equals("GoldLeaf")){
final SettingsBlockGoldleafController goldleafSettings = settings.getGoldleafSettings();
usbNetCommunications = new UsbCommunications(nspToUpload, "GoldLeaf" + goldleafSettings.getGlVer(), goldleafSettings.getNSPFileFilterForGL());
}
else if (( getSelectedProtocol().equals("TinFoil") && getSelectedNetUsb().equals("USB") )){
else if (( ( getSelectedProtocol().equals("TinFoil") || getSelectedProtocol().equals("Awoo-installer") ) && getSelectedNetUsb().equals("USB") )){
usbNetCommunications = new UsbCommunications(nspToUpload, "TinFoil", false);
}
else { // NET INSTALL OVER TINFOIL
Expand Down Expand Up @@ -477,7 +477,7 @@ public void notifyThreadStarted(boolean isActive, EModule type){
* Crunch. This function called from NSTableViewController
* */
public void disableUploadStopBtn(boolean disable){
if (getSelectedProtocol().equals("TinFoil"))
if (( getSelectedProtocol().equals("TinFoil") || getSelectedProtocol().equals("Awoo-installer") ))
uploadStopBtn.setDisable(disable);
else
uploadStopBtn.setDisable(false);
Expand Down Expand Up @@ -527,4 +527,4 @@ public void updatePreferencesOnExit(){
preferences.setNetUsb(getSelectedNetUsb());
preferences.setNsIp(getNsIp());
}
}
}