minor changes/updates for @rashevskyv
This commit is contained in:
Dmitry Isaenko 2019-04-23 02:31:39 +03:00
parent 86e974aa48
commit 90e2bfb21d
9 changed files with 60 additions and 16 deletions

View file

@ -23,7 +23,8 @@ public class AppPreferences {
String HostIp, String HostIp,
String HostPort, String HostPort,
String HostExtra, String HostExtra,
boolean autoCheck4Updates boolean autoCheck4Updates,
boolean tinfoilXciSupport
){ ){
setProtocol(Protocol); setProtocol(Protocol);
setRecent(PreviouslyOpened); setRecent(PreviouslyOpened);
@ -38,6 +39,7 @@ public class AppPreferences {
setHostPort(HostPort); setHostPort(HostPort);
setHostExtra(HostExtra); setHostExtra(HostExtra);
setAutoCheckUpdates(autoCheck4Updates); setAutoCheckUpdates(autoCheck4Updates);
setTfXCI(tinfoilXciSupport);
} }
public String getTheme(){ public String getTheme(){
String theme = preferences.get("THEME", "/res/app_dark.css"); // Don't let user to change settings manually String theme = preferences.get("THEME", "/res/app_dark.css"); // Don't let user to change settings manually
@ -100,4 +102,7 @@ public class AppPreferences {
public boolean getAutoCheckUpdates(){return preferences.getBoolean("AUTOCHECK4UPDATES", false); } public boolean getAutoCheckUpdates(){return preferences.getBoolean("AUTOCHECK4UPDATES", false); }
public void setAutoCheckUpdates(boolean prop){preferences.putBoolean("AUTOCHECK4UPDATES", prop); } public void setAutoCheckUpdates(boolean prop){preferences.putBoolean("AUTOCHECK4UPDATES", prop); }
public boolean getTfXCI(){return preferences.getBoolean("TF_XCI", false);}
public void setTfXCI(boolean prop){ preferences.putBoolean("TF_XCI", prop); }
} }

View file

@ -108,8 +108,12 @@ public class NSLMainController implements Initializable {
else else
fileChooser.setInitialDirectory(new File(System.getProperty("user.home"))); 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()); filesList = fileChooser.showOpenMultipleDialog(logArea.getScene().getWindow());
if (filesList != null && !filesList.isEmpty()) { if (filesList != null && !filesList.isEmpty()) {
FrontTabController.tableFilesListController.setFiles(filesList); FrontTabController.tableFilesListController.setFiles(filesList);
@ -234,13 +238,25 @@ public class NSLMainController implements Initializable {
} }
List<File> filesDropped = new ArrayList<>(); List<File> filesDropped = new ArrayList<>();
try { try {
for (File fileOrDir : event.getDragboard().getFiles()) { if (SettingsTabController.getTfXCISupport() && FrontTabController.getSelectedProtocol().equals("TinFoil")){
if (fileOrDir.getName().toLowerCase().endsWith(".nsp")) for (File fileOrDir : event.getDragboard().getFiles()) {
filesDropped.add(fileOrDir); if (fileOrDir.getName().toLowerCase().endsWith(".nsp") || fileOrDir.getName().toLowerCase().endsWith(".xci"))
else if (fileOrDir.isDirectory()) filesDropped.add(fileOrDir);
for (File file : fileOrDir.listFiles()) else if (fileOrDir.isDirectory())
if (file.getName().toLowerCase().endsWith(".nsp")) for (File file : fileOrDir.listFiles())
filesDropped.add(file); 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){ catch (SecurityException se){
@ -268,7 +284,8 @@ public class NSLMainController implements Initializable {
SettingsTabController.getHostIp(), SettingsTabController.getHostIp(),
SettingsTabController.getHostPort(), SettingsTabController.getHostPort(),
SettingsTabController.getHostExtra(), SettingsTabController.getHostExtra(),
SettingsTabController.getAutoCheckForUpdates() SettingsTabController.getAutoCheckForUpdates(),
SettingsTabController.getTfXCISupport()
); );
} }
} }

View file

@ -25,6 +25,7 @@ import java.io.File;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.ListIterator;
import java.util.ResourceBundle; import java.util.ResourceBundle;
public class NSTableViewController implements Initializable { public class NSTableViewController implements Initializable {
@ -259,9 +260,16 @@ public class NSTableViewController implements Initializable {
model.setMarkForUpload(true); model.setMarkForUpload(true);
} }
else { else {
for (NSLRowModel model: rowsObsLst) ListIterator<NSLRowModel> iterator = rowsObsLst.listIterator();
model.setMarkForUpload(false); while (iterator.hasNext()){
rowsObsLst.get(0).setMarkForUpload(true); 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(); table.refresh();
} }

View file

@ -45,6 +45,8 @@ public class SettingsController implements Initializable {
private Hyperlink newVersionLink; private Hyperlink newVersionLink;
@FXML @FXML
private Button checkForUpdBtn; private Button checkForUpdBtn;
@FXML
private CheckBox tfXciSpprtCb;
private HostServices hs; private HostServices hs;
@ -176,6 +178,7 @@ public class SettingsController implements Initializable {
updates.setDaemon(true); updates.setDaemon(true);
updates.start(); updates.start();
}); });
tfXciSpprtCb.setSelected(AppPreferences.getInstance().getTfXCI());
} }
public boolean getExpertModeSelected(){ return expertModeCb.isSelected(); } public boolean getExpertModeSelected(){ return expertModeCb.isSelected(); }
@ -189,6 +192,7 @@ public class SettingsController implements Initializable {
public String getHostPort(){ return pcPortTextField.getText(); } public String getHostPort(){ return pcPortTextField.getText(); }
public String getHostExtra(){ return pcExtraTextField.getText(); } public String getHostExtra(){ return pcExtraTextField.getText(); }
public boolean getAutoCheckForUpdates(){ return autoCheckUpdCb.isSelected(); } public boolean getAutoCheckForUpdates(){ return autoCheckUpdCb.isSelected(); }
public boolean getTfXCISupport(){ return tfXciSpprtCb.isSelected(); }
public void registerHostServices(HostServices hostServices){this.hs = hostServices;} public void registerHostServices(HostServices hostServices){this.hs = hostServices;}

View file

@ -84,9 +84,11 @@
<Button fx:id="checkForUpdBtn" mnemonicParsing="false" /> <Button fx:id="checkForUpdBtn" mnemonicParsing="false" />
</children> </children>
</HBox> </HBox>
<CheckBox fx:id="tfXciSpprtCb" mnemonicParsing="false" text="%netTabAllowXciCb" />
<Label disable="true" text="%netTabAllowXciTextField" wrapText="true" />
</children> </children>
<padding> <padding>
<Insets left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding> </padding>
</VBox> </VBox>
</children> </children>

View file

@ -41,3 +41,5 @@ windowTitleNewVersionNOTAval=No new versions available
windowTitleNewVersionUnknown=Unable to check for new versions windowTitleNewVersionUnknown=Unable to check for new versions
windowBodyNewVersionUnknown=Something went wrong\nMaybe internet unavailable, or GitHub is down windowBodyNewVersionUnknown=Something went wrong\nMaybe internet unavailable, or GitHub is down
windowBodyNewVersionNOTAval=You're using the latest version windowBodyNewVersionNOTAval=You're using the latest version
netTabAllowXciCb=Allow XCI files selection for TinFoil
netTabAllowXciTextField=Used by some third-party applications that support XCI and utilizes TinFoil transfer protocol. Don't change if not sure.

View file

@ -40,4 +40,6 @@ windowTitleNewVersionNOTAval=Aucune nouvelle version disponible
windowTitleNewVersionUnknown=Impossible de v\u00E9rifier les nouvelles versions windowTitleNewVersionUnknown=Impossible de v\u00E9rifier les nouvelles versions
windowBodyNewVersionNOTAval=Vous utilisez la derni\u00E8re version windowBodyNewVersionNOTAval=Vous utilisez la derni\u00E8re version
windowBodyNewVersionUnknown=Une erreur s'est produite\nPeut-\u00EAtre des probl\u00E8mes de connexion Internet ou GitHub est en panne windowBodyNewVersionUnknown=Une erreur s'est produite\nPeut-\u00EAtre des probl\u00E8mes de connexion Internet ou GitHub est en panne
netTabAllowXciCb=Autoriser la s\u00E9lection de fichiers XCI pour TinFoil
netTabAllowXciTextField=Utilis\u00E9 par certaines applications tierces prenant en charge XCI et utilisant le protocole de transfert TinFoil. Ne changez pas en cas de doute.

View file

@ -42,4 +42,6 @@ windowTitleNewVersionNOTAval=\u041D\u0435\u0442 \u043D\u043E\u0432\u044B\u0445 \
windowTitleNewVersionUnknown=\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435 \u043D\u043E\u0432\u044B\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 windowTitleNewVersionUnknown=\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435 \u043D\u043E\u0432\u044B\u0445 \u0432\u0435\u0440\u0441\u0438\u0439
windowBodyNewVersionNOTAval=\u0412\u044B \u0443\u0436\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0435 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044E\u044E \u0432\u0435\u0440\u0441\u0438\u044E windowBodyNewVersionNOTAval=\u0412\u044B \u0443\u0436\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0435 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044E\u044E \u0432\u0435\u0440\u0441\u0438\u044E
windowBodyNewVersionUnknown=\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A.\n\u041C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043D\u0435\u0442 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0430 \u0438\u043B\u0438 GitHub \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. windowBodyNewVersionUnknown=\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A.\n\u041C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043D\u0435\u0442 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0430 \u0438\u043B\u0438 GitHub \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D.
netTabAllowXciCb=\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u0432\u044B\u0431\u0438\u0440\u0430\u0442\u044C XCI \u0444\u0430\u0439\u043B\u044B \u0434\u043B\u044F TinFoil
netTabAllowXciTextField=\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F \u043D\u0435\u043A\u043E\u0442\u043E\u0440\u044B\u043C\u0438 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u043C\u0438 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F\u043C\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442 XCI \u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044E\u0442 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 TinFoil. \u041D\u0435 \u043C\u0435\u043D\u044F\u0439\u0442\u0435 \u0435\u0441\u043B\u0438 \u043D\u0435 \u0443\u0432\u0435\u0440\u0435\u043D\u044B.

View file

@ -40,4 +40,6 @@ windowTitleNewVersionAval=\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u0430 \u043
windowTitleNewVersionNOTAval=\u041D\u0435\u043C\u0430\u0454 \u043D\u043E\u0432\u0438\u0445 \u0432\u0435\u0440\u0441\u0456\u0439 windowTitleNewVersionNOTAval=\u041D\u0435\u043C\u0430\u0454 \u043D\u043E\u0432\u0438\u0445 \u0432\u0435\u0440\u0441\u0456\u0439
windowTitleNewVersionUnknown=\u041D\u0435\u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 \u043D\u0430\u044F\u0432\u043D\u0456\u0441\u0442\u044C \u043D\u043E\u0432\u0438\u0445 \u0432\u0435\u0440\u0441\u0456\u0439 windowTitleNewVersionUnknown=\u041D\u0435\u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 \u043D\u0430\u044F\u0432\u043D\u0456\u0441\u0442\u044C \u043D\u043E\u0432\u0438\u0445 \u0432\u0435\u0440\u0441\u0456\u0439
windowBodyNewVersionNOTAval=\u0412\u0438 \u0432\u0436\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u0435 \u043E\u0441\u0442\u0430\u043D\u043D\u044E \u0432\u0435\u0440\u0441\u0456\u044E windowBodyNewVersionNOTAval=\u0412\u0438 \u0432\u0436\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u0435 \u043E\u0441\u0442\u0430\u043D\u043D\u044E \u0432\u0435\u0440\u0441\u0456\u044E
windowBodyNewVersionUnknown=\u0429\u043E\u0441\u044C \u043F\u0456\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A.\n\u041C\u043E\u0436\u043B\u0438\u0432\u043E, \u0456\u043D\u0442\u0435\u0440\u043D\u0435\u0442 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439, \u0430\u0431\u043E GitHub \u043D\u0435 \u043F\u0440\u0430\u0446\u044E\u0454. windowBodyNewVersionUnknown=\u0429\u043E\u0441\u044C \u043F\u0456\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A.\n\u041C\u043E\u0436\u043B\u0438\u0432\u043E, \u0456\u043D\u0442\u0435\u0440\u043D\u0435\u0442 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439, \u0430\u0431\u043E GitHub \u043D\u0435 \u043F\u0440\u0430\u0446\u044E\u0454.
netTabAllowXciCb=\u0414\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u0438 \u0432\u0438\u0431\u0456\u0440 XCI \u0444\u0430\u0439\u043B\u0456\u0432 \u0434\u043B\u044F \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F \u0443 TinFoil
netTabAllowXciTextField=\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u044C\u0441\u044F \u0434\u0435\u044F\u043A\u0438\u043C\u0438 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0456\u043C\u0438 \u0434\u043E\u0434\u0430\u0442\u043A\u0430\u043C\u0438, \u044F\u043A\u0456 \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u044E\u0442\u044C XCI \u0456 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u044E\u0442\u044C \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0456 TinFoil. \u042F\u043A\u0449\u043E \u043D\u0435 \u0432\u043F\u0435\u0432\u043D\u0435\u043D\u0456 \u2014\u00A0\u043D\u0435 \u0437\u043C\u0456\u043D\u044E\u0439\u0442\u0435.