Compare commits
3 commits
f7b8e4d265
...
4cb3cbb491
Author | SHA1 | Date | |
---|---|---|---|
|
4cb3cbb491 | ||
|
50e2b739a8 | ||
|
bd624d649a |
6 changed files with 65 additions and 39 deletions
|
@ -61,7 +61,7 @@ public class AppPreferences {
|
|||
public void setNsIp(String ip){preferences.put("NSIP", ip);}
|
||||
public String getNsIp(){return preferences.get("NSIP", "192.168.1.42");}
|
||||
|
||||
public String getRecent(){ return preferences.get("RECENT", System.getProperty("user.home")); }
|
||||
public String getRecent(){ return FilesHelper.getRealFolder(preferences.get("RECENT", System.getProperty("user.home"))); }
|
||||
public void setRecent(String path){ preferences.put("RECENT", path); }
|
||||
//------------ SETTINGS ------------------//
|
||||
|
||||
|
@ -124,12 +124,12 @@ public class AppPreferences {
|
|||
public int getSplitMergeType(){ return preferences.getInt("SM_TYPE", 0); }
|
||||
public void setSplitMergeType(int value){ preferences.putInt("SM_TYPE", value); }
|
||||
|
||||
public String getSplitMergeRecent(){ return preferences.get("SM_RECENT", System.getProperty("user.home")); }
|
||||
public String getSplitMergeRecent(){ return FilesHelper.getRealFolder(preferences.get("SM_RECENT", System.getProperty("user.home"))); }
|
||||
public void setSplitMergeRecent(String value){ preferences.put("SM_RECENT", value); }
|
||||
// RCM //
|
||||
public String getRecentRcm(int num){ return preferences.get(String.format("RCM_%02d", num), ""); }
|
||||
public void setRecentRcm(int num, String value){ preferences.put(String.format("RCM_%02d", num), value); }
|
||||
// NXDT //
|
||||
public String getNXDTSaveToLocation(){ return preferences.get("nxdt_saveto", System.getProperty("user.home")); }
|
||||
public String getNXDTSaveToLocation(){ return FilesHelper.getRealFolder(preferences.get("nxdt_saveto", System.getProperty("user.home"))); }
|
||||
public void setNXDTSaveToLocation(String value){ preferences.put("nxdt_saveto", value); }
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import javafx.stage.FileChooser;
|
|||
import nsusbloader.AppPreferences;
|
||||
import nsusbloader.COM.NET.NETCommunications;
|
||||
import nsusbloader.COM.USB.UsbCommunications;
|
||||
import nsusbloader.FilesHelper;
|
||||
import nsusbloader.MediatorControl;
|
||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||
import nsusbloader.NSLDataTypes.EModule;
|
||||
|
@ -193,11 +194,7 @@ public class FrontController implements Initializable {
|
|||
FileChooser fileChooser = new FileChooser();
|
||||
fileChooser.setTitle(resourceBundle.getString("btn_OpenFile"));
|
||||
|
||||
File validator = new File(previouslyOpenedPath);
|
||||
if (validator.exists() && validator.isDirectory())
|
||||
fileChooser.setInitialDirectory(validator);
|
||||
else
|
||||
fileChooser.setInitialDirectory(new File(System.getProperty("user.home")));
|
||||
fileChooser.setInitialDirectory(new File(FilesHelper.getRealFolder(previouslyOpenedPath)));
|
||||
|
||||
if (getSelectedProtocol().equals("TinFoil") && MediatorControl.getInstance().getContoller().getSettingsCtrlr().getTinfoilSettings().isXciNszXczSupport())
|
||||
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("NSP/XCI/NSZ/XCZ", "*.nsp", "*.xci", "*.nsz", "*.xcz"));
|
||||
|
@ -223,11 +220,8 @@ public class FrontController implements Initializable {
|
|||
DirectoryChooser dirChooser = new DirectoryChooser();
|
||||
dirChooser.setTitle(resourceBundle.getString("btn_OpenFile"));
|
||||
|
||||
File validator = new File(previouslyOpenedPath);
|
||||
if (validator.exists() && validator.isDirectory())
|
||||
dirChooser.setInitialDirectory(validator);
|
||||
else
|
||||
dirChooser.setInitialDirectory(new File(System.getProperty("user.home")));
|
||||
String saveToLocation = FilesHelper.getRealFolder(previouslyOpenedPath);
|
||||
dirChooser.setInitialDirectory(new File(saveToLocation));
|
||||
|
||||
splitFile = dirChooser.showDialog(usbNetPane.getScene().getWindow());
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import javafx.scene.control.Label;
|
|||
import javafx.scene.layout.Region;
|
||||
import javafx.stage.DirectoryChooser;
|
||||
import nsusbloader.AppPreferences;
|
||||
import nsusbloader.FilesHelper;
|
||||
import nsusbloader.MediatorControl;
|
||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||
import nsusbloader.NSLDataTypes.EModule;
|
||||
|
@ -52,11 +53,8 @@ public class NxdtController implements Initializable {
|
|||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
this.rb = resourceBundle;
|
||||
|
||||
File saveToValidator = new File(AppPreferences.getInstance().getNXDTSaveToLocation());
|
||||
if (saveToValidator.exists())
|
||||
saveToLocationLbl.setText(saveToValidator.getAbsolutePath());
|
||||
else
|
||||
saveToLocationLbl.setText(System.getProperty("user.home"));
|
||||
String saveToLocation = AppPreferences.getInstance().getNXDTSaveToLocation();
|
||||
saveToLocationLbl.setText(saveToLocation);
|
||||
|
||||
btnDumpStopImage = new Region();
|
||||
btnDumpStopImage.getStyleClass().add("regionDump");
|
||||
|
|
|
@ -20,7 +20,6 @@ package nsusbloader.Controllers;
|
|||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.input.DragEvent;
|
||||
import javafx.scene.input.TransferMode;
|
||||
|
@ -29,6 +28,7 @@ import javafx.scene.layout.VBox;
|
|||
import javafx.stage.DirectoryChooser;
|
||||
import javafx.stage.FileChooser;
|
||||
import nsusbloader.AppPreferences;
|
||||
import nsusbloader.FilesHelper;
|
||||
import nsusbloader.MediatorControl;
|
||||
import nsusbloader.ModelControllers.CancellableRunnable;
|
||||
import nsusbloader.NSLDataTypes.EModule;
|
||||
|
@ -97,10 +97,13 @@ public class SplitMergeController implements Initializable {
|
|||
saveToPathLbl.setText(AppPreferences.getInstance().getSplitMergeRecent());
|
||||
|
||||
changeSaveToBtn.setOnAction((actionEvent -> {
|
||||
DirectoryChooser dc = new DirectoryChooser();
|
||||
dc.setTitle(resourceBundle.getString("tabSplMrg_Btn_SelectFolder"));
|
||||
dc.setInitialDirectory(new File(saveToPathLbl.getText()));
|
||||
File saveToDir = dc.showDialog(changeSaveToBtn.getScene().getWindow());
|
||||
DirectoryChooser directoryChooser = new DirectoryChooser();
|
||||
directoryChooser.setTitle(resourceBundle.getString("tabSplMrg_Btn_SelectFolder"));
|
||||
|
||||
String saveToLocation = FilesHelper.getRealFolder(saveToPathLbl.getText());
|
||||
directoryChooser.setInitialDirectory(new File(saveToLocation));
|
||||
|
||||
File saveToDir = directoryChooser.showDialog(changeSaveToBtn.getScene().getWindow());
|
||||
if (saveToDir != null)
|
||||
saveToPathLbl.setText(saveToDir.getAbsolutePath());
|
||||
}));
|
||||
|
@ -227,7 +230,6 @@ public class SplitMergeController implements Initializable {
|
|||
* */
|
||||
@FXML
|
||||
private void handleDrop(DragEvent event) {
|
||||
Node sourceNode = (Node) event.getSource();
|
||||
File fileDrpd = event.getDragboard().getFiles().get(0);
|
||||
|
||||
if (fileDrpd.isDirectory())
|
||||
|
|
32
src/main/java/nsusbloader/FilesHelper.java
Normal file
32
src/main/java/nsusbloader/FilesHelper.java
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package nsusbloader;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class FilesHelper {
|
||||
public static String getRealFolder(String path){
|
||||
Path splitMergePath = Paths.get(path);
|
||||
if (Files.notExists(splitMergePath) || Files.isRegularFile(splitMergePath))
|
||||
return System.getProperty("user.home");
|
||||
return path;
|
||||
}
|
||||
}
|
|
@ -1,29 +1,29 @@
|
|||
katebtn_OpenFile=Selecionar arquivos
|
||||
btn_Upload=Upar para o switch
|
||||
katebtn_OpenFile=Selecionar Arquivos
|
||||
btn_Upload=Carregar Arquivos
|
||||
tab3_Txt_EnteredAsMsg1=Voc\u00EA logou como:
|
||||
tab3_Txt_EnteredAsMsg2=Voc\u00EA precisa de permiss\u00F5es root ou ter configurado as regras 'udev' deste usu\u00E1rio para evitar poss\u00EDveis problemas.
|
||||
tab3_Txt_FilesToUploadTitle=Arquivos para upar:
|
||||
tab3_Txt_FilesToUploadTitle=Arquivos Para Carregar:
|
||||
tab3_Txt_GreetingsMessage=Bem vindo ao NS-USBloader
|
||||
tab3_Txt_NoFolderOrFileSelected=Nenhum arquivo selecionado. Nada para upar.
|
||||
tab3_Txt_NoFolderOrFileSelected=Nenhum arquivo selecionado. Nada para Carregar.
|
||||
windowBodyConfirmExit=Transfer\u00EAncia de dados em progresso: Fechar ir\u00E1 interromper.\nN\u00E3o \u00E9 aconselh\u00E1vel.\nInterromper processo e sair?
|
||||
windowTitleConfirmExit=N\u00E3o, n\u00E3o fa\u00E7a isso!
|
||||
btn_Stop=Imterromper!
|
||||
btn_Stop=Interromper!
|
||||
tab3_Txt_GreetingsMessage2=--\n\
|
||||
Source: https://github.com/developersu/ns-usbloader/\n\
|
||||
Fonte: https://github.com/developersu/ns-usbloader/\n\
|
||||
Site: https://developersu.blogspot.com/search/label/NS-USBloader\n\
|
||||
Dmitry Isaenko [developer.su]
|
||||
tab1_table_Lbl_Status=Status
|
||||
tab1_table_Lbl_FileName=Nome do arquivo
|
||||
tab1_table_Lbl_FileName=Nome do Arquivo
|
||||
tab1_table_Lbl_Size=Tamanho
|
||||
tab1_table_Lbl_Upload=Upar
|
||||
tab1_table_Lbl_Upload=Carregar
|
||||
tab1_table_contextMenu_Btn_BtnDelete=Remover
|
||||
tab1_table_contextMenu_Btn_DeleteAll=Remover todos
|
||||
tab1_table_contextMenu_Btn_DeleteAll=Remover Todos
|
||||
tab2_Lbl_HostIP=Host IP
|
||||
tab1_Lbl_NSIP=NS IP:
|
||||
tab2_Cb_ValidateNSHostName=Sempre validar o IP do switch.
|
||||
windowBodyBadIp=Tem certeza que preencheu o endere\u00E7o IP corretamente?
|
||||
windowTitleBadIp=Endere\u00E7o IP do switch provavelmente incorreto.
|
||||
tab2_Cb_ExpertMode=Modo Expert (Configura\u00E7\u00E3o NET)
|
||||
tab2_Cb_ExpertMode=Modo Avançado (Configura\u00E7\u00E3o NET)
|
||||
tab2_Lbl_HostPort=porta
|
||||
tab2_Cb_AutoDetectIp=Auto-detectar IP
|
||||
tab2_Cb_RandSelectPort=Usar porta aleat\u00F3ria
|
||||
|
@ -44,12 +44,12 @@ tab2_Lbl_Language=Idioma
|
|||
windowBodyRestartToApplyLang=Por favor, reinicie para aplicar as modifica\u00E7\u00F5es.
|
||||
btn_OpenSplitFile=Select split NSP
|
||||
tab2_Lbl_ApplicationSettings=Configura\u00E7\u00F5es principais
|
||||
tabSplMrg_Lbl_SplitNMergeTitle=Ferramenta de Fragmentar(Split) & mesclar (merge) arquivos
|
||||
tabSplMrg_RadioBtn_Split=Fragmentar (Split)
|
||||
tabSplMrg_RadioBtn_Merge=Mesclar (Merge)
|
||||
tabSplMrg_Lbl_SplitNMergeTitle=Ferramenta de Fragmentar (Dividir) & Mesclar (Juntar) arquivos
|
||||
tabSplMrg_RadioBtn_Split=Fragmentar (Dividir)
|
||||
tabSplMrg_RadioBtn_Merge=Mesclar (Juntar)
|
||||
tabSplMrg_Txt_File=Arquivo:
|
||||
tabSplMrg_Txt_Folder=Fragmentar arquivo (pasta):
|
||||
tabSplMrg_Btn_SelectFile=Selecionar arquivo
|
||||
tabSplMrg_Btn_SelectFile=Selecionar Arquivo
|
||||
tabSplMrg_Btn_SelectFolder=Selecionar Pasta
|
||||
tabSplMrg_Lbl_SaveToLocation=Salvar em:
|
||||
tabSplMrg_Btn_ChangeSaveToLocation=Trocar
|
||||
|
|
Loading…
Reference in a new issue