v0.3 UI is ready one more time

This commit is contained in:
Dmitry Isaenko 2019-03-19 03:30:13 +03:00
parent 31045683e4
commit 3a238d296c
7 changed files with 36 additions and 3 deletions

View file

@ -40,6 +40,25 @@ public class AppPreferences {
//------------ SETTINGS ------------------//
public boolean getNsIpValidationNeeded() {return preferences.getBoolean("NSIPVALIDATION", true);}
public void setNsIpValidationNeeded(boolean need){preferences.putBoolean("NSIPVALIDATION", need);}
public boolean getExpertMode(){return preferences.getBoolean("EXPERTMODE", false);}
public void setExpertMode(boolean mode){preferences.putBoolean("EXPERTMODE", mode);}
public boolean getAutoDetectIp(){return preferences.getBoolean("AUTOHOSTIP", true);}
public void setAutoDetectIp(boolean mode){preferences.putBoolean("AUTOHOSTIP", mode);}
public boolean getRandPort(){return preferences.getBoolean("RANDHOSTPORT", true);}
public void setRandPort(boolean mode){preferences.putBoolean("RANDHOSTPORT", mode);}
public boolean getNotServeRequests(){return preferences.getBoolean("DONTSERVEREQ", false);}
public void setNotServeRequests(boolean mode){preferences.putBoolean("DONTSERVEREQ", mode);}
public String getHostIp(){ return preferences.get("HOSTIP", "0.0.0.0");}
public void setHostIp(String ip){preferences.put("HOSTIP", ip);}
public String getHostPort(){ return preferences.get("HOSTPORT", "6042");}
public void setHostPort(String port){preferences.put("HOSTPORT", port);}
public String getHostPostfix(){ return preferences.get("HOSTPOSTFIX", "");}
public void setHostPostfix(String postfix){preferences.put("HOSTPOSTFIX", postfix);}
}

View file

@ -3,7 +3,6 @@ package nsusbloader.Controllers;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import nsusbloader.AppPreferences;
@ -40,18 +39,27 @@ public class SettingsController implements Initializable {
public void initialize(URL url, ResourceBundle resourceBundle) {
validateNSHostNameCb.setSelected(AppPreferences.getInstance().getNsIpValidationNeeded());
expertSettingsVBox.setDisable(AppPreferences.getInstance().getExpertMode());
expertSettingsVBox.setDisable(!AppPreferences.getInstance().getExpertMode());
expertModeCb.setSelected(AppPreferences.getInstance().getExpertMode());
expertModeCb.setOnAction(e->{
if (expertModeCb.isSelected())
expertSettingsVBox.setDisable(false);
else
expertSettingsVBox.setDisable(true);
});
autoDetectIpCb.setSelected(AppPreferences.getInstance().getAutoDetectIp());
randPortCb.setSelected(AppPreferences.getInstance().getRandPort());
dontServeCb.setSelected(AppPreferences.getInstance().getNotServeRequests());
}
public boolean getExpertModeSelected(){
return expertModeCb.isSelected();
}
public boolean isNsIpValidate(){ return validateNSHostNameCb.isSelected(); }
}

View file

@ -36,6 +36,8 @@
<Label text="%netTabHostIPLbl" />
<Label text=":" />
<Label text="%netTabHostPortLbl" />
<Label text="/" />
<Label text="%netTabHostExtraLbl" />
</children>
</HBox>
<HBox>

View file

@ -34,3 +34,4 @@ netTabAutoDetectIpCb=Auto-detect IP
netTabRandSelectPortCb=Randomly get port
netTabDontServeRequestsCb=Don't serve requests
netTabDontServeRequestsDescription=If selected, this computer won't reply to NSP files requests coming from NS (over the net) and use defined host settings to tell TinFoil where should it look for files.
netTabHostExtraLbl=extra

View file

@ -33,4 +33,5 @@ netTabAutoDetectIpCb=Auto-detect IP <- FIX
netTabRandSelectPortCb=Randomly get port <- FIX
netTabDontServeRequestsCb=Don't serve requests <- FIX
netTabDontServeRequestsDescription=If selected, this computer won't reply to NSP files requests coming from NS (over the net) and use defined host settings to tell TinFoil where should it look for files. <- Fix
netTabHostExtraLbl=extra <- FIX

View file

@ -35,4 +35,5 @@ netTabAutoDetectIpCb=\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u043
netTabRandSelectPortCb=\u041E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0442\u044C \u043F\u043E\u0440\u0442 \u0441\u043B\u0443\u0447\u0430\u0439\u043D\u044B\u043C \u043E\u0431\u0440\u0430\u0437\u043E\u043C
netTabDontServeRequestsCb=\u041D\u0435 \u043E\u0431\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u0442\u044C \u0437\u0430\u043F\u0440\u043E\u0441\u044B
netTabDontServeRequestsDescription=\u0415\u0441\u043B\u0438 \u0432\u044B\u0431\u0440\u0430\u043D\u043E, \u0442\u043E\u0433\u0434\u0430 \u044D\u0442\u043E\u0442 \u043A\u043E\u043C\u043F\u044C\u044E\u0442\u0435\u0440 \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u043E\u0442\u0432\u0435\u0447\u0430\u0442\u044C \u043D\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u044B NSP \u0444\u0430\u0439\u043B\u043E\u0432. \u0411\u0443\u0434\u0443\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0445\u043E\u0441\u0442\u0430 \u0447\u0442\u043E\u0431\u044B \u0443\u043A\u0430\u0437\u0430\u0442\u044C TinFoil \u043E\u0442\u043A\u0443\u0434\u0430 \u0435\u043C\u0443 \u0441\u043B\u0435\u0434\u0443\u0435\u0442 \u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B\u044B.
netTabHostExtraLbl=\u044D\u043A\u0441\u0442\u0440\u0430

View file

@ -33,4 +33,5 @@ netTabHostPortLbl=\u043F\u043E\u0440\u0442
netTabAutoDetectIpCb=\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u043D\u043E \u0432\u0438\u0437\u043D\u0430\u0447\u0430\u0442\u0438 IP
netTabRandSelectPortCb=\u0412\u0438\u0437\u043D\u0430\u0447\u0430\u0442\u0438 \u043F\u043E\u0440\u0442 \u0432\u0438\u043F\u0430\u0434\u043A\u043E\u0432\u0438\u043C \u0447\u0438\u043D\u043E\u043C
netTabDontServeRequestsCb=\u041D\u0435 \u043E\u0431\u0440\u043E\u0431\u043B\u044F\u0442\u0438 \u0437\u0430\u043F\u0438\u0442\u0438
netTabDontServeRequestsDescription=\u042F\u043A\u0449\u043E \u0432\u0438\u0431\u0440\u0430\u043D\u043E, \u0442\u043E\u0434\u0456 \u0446\u0435\u0439 \u043A\u043E\u043C\u043F'\u044E\u0442\u0435\u0440 \u043D\u0435 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438\u043C\u0435 \u043D\u0430 \u0437\u0430\u043F\u0438\u0442\u0438 NSP \u0444\u0430\u0439\u043B\u0456\u0432. \u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0432\u0430\u0442\u0438\u043C\u0443\u0442\u044C\u0441\u044F \u043D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F \u0445\u043E\u0441\u0442\u0430 \u0434\u043B\u044F \u0432\u043A\u0430\u0437\u0430\u043D\u043D\u044F TinFoil \u043C\u0456\u0441\u0446\u044F \u0437\u0432\u0456\u0434\u043A\u0438 \u0444\u0430\u0439\u043B\u0438 \u043C\u0430\u044E\u0442\u044C \u0431\u0440\u0430\u0442\u0438\u0441\u044F.
netTabDontServeRequestsDescription=\u042F\u043A\u0449\u043E \u0432\u0438\u0431\u0440\u0430\u043D\u043E, \u0442\u043E\u0434\u0456 \u0446\u0435\u0439 \u043A\u043E\u043C\u043F'\u044E\u0442\u0435\u0440 \u043D\u0435 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438\u043C\u0435 \u043D\u0430 \u0437\u0430\u043F\u0438\u0442\u0438 NSP \u0444\u0430\u0439\u043B\u0456\u0432. \u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0432\u0430\u0442\u0438\u043C\u0443\u0442\u044C\u0441\u044F \u043D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F \u0445\u043E\u0441\u0442\u0430 \u0434\u043B\u044F \u0432\u043A\u0430\u0437\u0430\u043D\u043D\u044F TinFoil \u043C\u0456\u0441\u0446\u044F \u0437\u0432\u0456\u0434\u043A\u0438 \u0444\u0430\u0439\u043B\u0438 \u043C\u0430\u044E\u0442\u044C \u0431\u0440\u0430\u0442\u0438\u0441\u044F.
netTabHostExtraLbl=\u0435\u043A\u0441\u0442\u0440\u0430