mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-03-15 10:26:37 -04:00
Use localized strings for create offer screen and validators
This commit is contained in:
parent
40107785ab
commit
d2e98ff93a
@ -75,14 +75,18 @@ public class BitSquare extends Application {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
public void start(Stage primaryStage) {
|
||||
Profiler.printMsgWithTime("BitSquare.start called");
|
||||
BitSquare.primaryStage = primaryStage;
|
||||
|
||||
Thread.currentThread().setUncaughtExceptionHandler((thread, throwable) -> Popups.handleUncaughtExceptions
|
||||
(Throwables.getRootCause(throwable)));
|
||||
|
||||
AppDirectory.initAppDir(APP_NAME);
|
||||
try {
|
||||
AppDirectory.initAppDir(APP_NAME);
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
|
||||
// currently there is not SystemTray support for java fx (planned for version 3) so we use the old AWT
|
||||
AWTSystemTray.createSystemTray(primaryStage);
|
||||
@ -111,19 +115,24 @@ public class BitSquare extends Application {
|
||||
|
||||
final GuiceFXMLLoader loader =
|
||||
new GuiceFXMLLoader(getClass().getResource(NavigationItem.MAIN.getFxmlUrl()), false);
|
||||
final Parent view = loader.load();
|
||||
final Scene scene = new Scene(view, 1000, 750);
|
||||
scene.getStylesheets().setAll(getClass().getResource("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
try {
|
||||
final Parent view = loader.load();
|
||||
|
||||
setupCloseHandlers(primaryStage, scene);
|
||||
final Scene scene = new Scene(view, 1000, 750);
|
||||
scene.getStylesheets().setAll(getClass().getResource("/io/bitsquare/gui/bitsquare.css").toExternalForm());
|
||||
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.setMinWidth(750);
|
||||
primaryStage.setMinHeight(500);
|
||||
setupCloseHandlers(primaryStage, scene);
|
||||
|
||||
primaryStage.show();
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.setMinWidth(750);
|
||||
primaryStage.setMinHeight(500);
|
||||
|
||||
Profiler.printMsgWithTime("BitSquare: start finished");
|
||||
primaryStage.show();
|
||||
|
||||
Profiler.printMsgWithTime("BitSquare: start finished");
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void setupCloseHandlers(Stage primaryStage, Scene scene) {
|
||||
|
@ -61,6 +61,7 @@ public class GuiceFXMLLoader {
|
||||
isCached = useCaching && cachedGUIItems.containsKey(url);
|
||||
if (!isCached) {
|
||||
loader = new FXMLLoader(url, Localisation.getResourceBundle());
|
||||
|
||||
if (GuiceFXMLLoader.injector != null)
|
||||
loader.setControllerFactory(new GuiceControllerFactory(GuiceFXMLLoader.injector));
|
||||
}
|
||||
|
@ -125,22 +125,17 @@ public class InputTextField extends TextField {
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void applyErrorMessage(InputValidator.ValidationResult validationResult) {
|
||||
if (validationResult.isValid) {
|
||||
if (errorMessageDisplay != null)
|
||||
errorMessageDisplay.hide();
|
||||
}
|
||||
else {
|
||||
|
||||
if (errorMessageDisplay == null)
|
||||
createErrorPopOver(validationResult.errorMessage);
|
||||
else
|
||||
((Label) errorMessageDisplay.getContentNode()).setText(validationResult.errorMessage);
|
||||
if (errorMessageDisplay != null)
|
||||
errorMessageDisplay.hide();
|
||||
|
||||
if (!validationResult.isValid) {
|
||||
createErrorPopOver(validationResult.errorMessage);
|
||||
if (getScene() != null)
|
||||
errorMessageDisplay.show(getScene().getWindow(), getErrorPopupPosition().getX(),
|
||||
getErrorPopupPosition().getY());
|
||||
|
||||
InputTextField.errorMessageDisplay.setDetached(false);
|
||||
if (errorMessageDisplay != null)
|
||||
errorMessageDisplay.setDetached(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,10 +157,10 @@ public class InputTextField extends TextField {
|
||||
errorLabel.setPadding(new Insets(0, 10, 0, 10));
|
||||
errorLabel.setOnMouseClicked(e -> hideErrorMessageDisplay());
|
||||
|
||||
InputTextField.errorMessageDisplay = new PopOver(errorLabel);
|
||||
InputTextField.errorMessageDisplay.setDetachable(true);
|
||||
InputTextField.errorMessageDisplay.setDetachedTitle("Close");
|
||||
InputTextField.errorMessageDisplay.setArrowIndent(5);
|
||||
errorMessageDisplay = new PopOver(errorLabel);
|
||||
errorMessageDisplay.setDetachable(true);
|
||||
errorMessageDisplay.setDetachedTitle("Close");
|
||||
errorMessageDisplay.setArrowIndent(5);
|
||||
}
|
||||
|
||||
}
|
@ -28,6 +28,7 @@ import io.bitsquare.gui.help.Help;
|
||||
import io.bitsquare.gui.help.HelpId;
|
||||
import io.bitsquare.gui.trade.TradeController;
|
||||
import io.bitsquare.gui.util.ImageUtil;
|
||||
import io.bitsquare.locale.Localisation;
|
||||
import io.bitsquare.trade.orderbook.OrderBookFilter;
|
||||
|
||||
import java.net.URL;
|
||||
@ -63,6 +64,8 @@ import org.controlsfx.dialog.Dialog;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static javafx.beans.binding.Bindings.createStringBinding;
|
||||
|
||||
// TODO Implement other positioning method in InoutTextField to display it over the field instead of right side
|
||||
// priceAmountHBox is too large after redesign as to be used as layoutReference.
|
||||
|
||||
@ -84,7 +87,8 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
||||
balanceLabel, payFundsTitleLabel, totalToPayLabel, totalToPayInfoIconLabel,
|
||||
showDetailsTitleLabel, bankAccountTypeLabel, bankAccountCurrencyLabel, bankAccountCountyLabel,
|
||||
acceptedCountriesLabel, acceptedCountriesLabelIcon, acceptedLanguagesLabel, acceptedLanguagesLabelIcon,
|
||||
acceptedArbitratorsLabel, acceptedArbitratorsLabelIcon;
|
||||
acceptedArbitratorsLabel, acceptedArbitratorsLabelIcon, amountBtcLabel,
|
||||
priceFiatLabel, volumeFiatLabel, minAmountBtcLabel, priceDescriptionLabel, volumeDescriptionLabel;
|
||||
@FXML private Button showPaymentInfoScreenButton, showAdvancedSettingsButton, placeOfferButton;
|
||||
|
||||
@FXML private InputTextField amountTextField, minAmountTextField, priceTextField, volumeTextField;
|
||||
@ -113,8 +117,8 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
super.initialize(url, rb);
|
||||
|
||||
setupBindings();
|
||||
setupListeners();
|
||||
setupBindings();
|
||||
balanceTextField.setup(presentationModel.getWalletFacade(), presentationModel.address.get());
|
||||
}
|
||||
|
||||
@ -189,12 +193,12 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
||||
private void onToggleShowAdvancedSettings() {
|
||||
detailsVisible = !detailsVisible;
|
||||
if (detailsVisible) {
|
||||
showAdvancedSettingsButton.setText("Hide advanced settings");
|
||||
showAdvancedSettingsButton.setText(Localisation.get("createOffer.fundsBox.hideAdvanced"));
|
||||
showAdvancedSettingsButton.setGraphic(collapse);
|
||||
showDetailsScreen();
|
||||
}
|
||||
else {
|
||||
showAdvancedSettingsButton.setText("Show advanced settings");
|
||||
showAdvancedSettingsButton.setText(Localisation.get("createOffer.fundsBox.showAdvanced"));
|
||||
showAdvancedSettingsButton.setGraphic(expand);
|
||||
hideDetailsScreen();
|
||||
}
|
||||
@ -260,24 +264,24 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
||||
// warnings
|
||||
presentationModel.showWarningInvalidBtcDecimalPlaces.addListener((o, oldValue, newValue) -> {
|
||||
if (newValue) {
|
||||
Popups.openWarningPopup("Warning", "The amount you have entered exceeds the number of allowed decimal" +
|
||||
" places.\nThe amount has been adjusted to 4 decimal places.");
|
||||
Popups.openWarningPopup(Localisation.get("shared.warning"),
|
||||
Localisation.get("createOffer.amountPriceBox.warning.invalidBtcDecimalPlaces"));
|
||||
presentationModel.showWarningInvalidBtcDecimalPlaces.set(false);
|
||||
}
|
||||
});
|
||||
|
||||
presentationModel.showWarningInvalidFiatDecimalPlaces.addListener((o, oldValue, newValue) -> {
|
||||
if (newValue) {
|
||||
Popups.openWarningPopup("Warning", "The amount you have entered exceeds the number of allowed decimal" +
|
||||
" places.\nThe amount has been adjusted to 2 decimal places.");
|
||||
Popups.openWarningPopup(Localisation.get("shared.warning"),
|
||||
Localisation.get("createOffer.amountPriceBox.warning.invalidFiatDecimalPlaces"));
|
||||
presentationModel.showWarningInvalidFiatDecimalPlaces.set(false);
|
||||
}
|
||||
});
|
||||
|
||||
presentationModel.showWarningAdjustedVolume.addListener((o, oldValue, newValue) -> {
|
||||
if (newValue) {
|
||||
Popups.openWarningPopup("Warning", "The total volume you have entered leads to invalid fractional " +
|
||||
"Bitcoin amounts.\nThe amount has been adjusted and a new total volume be calculated from it.");
|
||||
Popups.openWarningPopup(Localisation.get("shared.warning"),
|
||||
Localisation.get("createOffer.amountPriceBox.warning.adjustedVolume"));
|
||||
presentationModel.showWarningAdjustedVolume.set(false);
|
||||
volumeTextField.setText(presentationModel.volume.get());
|
||||
}
|
||||
@ -285,8 +289,9 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
||||
|
||||
presentationModel.requestPlaceOfferErrorMessage.addListener((o, oldValue, newValue) -> {
|
||||
if (newValue != null) {
|
||||
Popups.openErrorPopup("Error", "An error occurred when placing the offer.\n" +
|
||||
presentationModel.requestPlaceOfferErrorMessage.get());
|
||||
Popups.openErrorPopup(Localisation.get("shared.error"),
|
||||
Localisation.get("createOffer.amountPriceBox.error.requestPlaceOfferErrorMessage",
|
||||
presentationModel.requestPlaceOfferErrorMessage.get()));
|
||||
}
|
||||
});
|
||||
|
||||
@ -295,7 +300,7 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
||||
// Dialogs are a bit limited. There is no callback for the InformationDialog button click, so we added
|
||||
// our own actions.
|
||||
List<Action> actions = new ArrayList<>();
|
||||
actions.add(new AbstractAction("Copy transaction ID") {
|
||||
actions.add(new AbstractAction(Localisation.get("createOffer.success.copyTxId")) {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Clipboard clipboard = Clipboard.getSystemClipboard();
|
||||
@ -304,7 +309,7 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
||||
clipboard.setContent(content);
|
||||
}
|
||||
});
|
||||
actions.add(new AbstractAction("Close") {
|
||||
actions.add(new AbstractAction(Localisation.get("shared.close")) {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
try {
|
||||
@ -316,16 +321,27 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
||||
}
|
||||
});
|
||||
|
||||
Popups.openInformationPopup("Offer published",
|
||||
"The Bitcoin network transaction ID for the offer payment is: " +
|
||||
presentationModel.transactionId.get(),
|
||||
"Your offer has been successfully published to the distributed orderbook.",
|
||||
Popups.openInformationPopup(Localisation.get("createOffer.success.title"),
|
||||
Localisation.get("createOffer.success.info", presentationModel.transactionId.get()),
|
||||
Localisation.get("createOffer.success.headline"),
|
||||
actions);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setupBindings() {
|
||||
amountBtcLabel.textProperty().bind(presentationModel.btcCode);
|
||||
priceFiatLabel.textProperty().bind(presentationModel.fiatCode);
|
||||
volumeFiatLabel.textProperty().bind(presentationModel.fiatCode);
|
||||
minAmountBtcLabel.textProperty().bind(presentationModel.btcCode);
|
||||
priceDescriptionLabel.textProperty().bind(presentationModel.fiatCode);
|
||||
volumeDescriptionLabel.textProperty().bind(presentationModel.fiatCode);//Price per Bitcoin in EUR
|
||||
|
||||
priceDescriptionLabel.textProperty().bind(createStringBinding(() ->
|
||||
Localisation.get("createOffer.amountPriceBox.priceDescr", presentationModel.fiatCode.get())));
|
||||
volumeDescriptionLabel.textProperty().bind(createStringBinding(() ->
|
||||
Localisation.get("createOffer.amountPriceBox.volumeDescr", presentationModel.fiatCode.get())));
|
||||
|
||||
buyLabel.textProperty().bind(presentationModel.directionLabel);
|
||||
|
||||
amountTextField.textProperty().bindBidirectional(presentationModel.amount);
|
||||
@ -377,17 +393,17 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
||||
advancedScreenInited = true;
|
||||
acceptedCountriesLabelIcon.setId("clickable-icon");
|
||||
AwesomeDude.setIcon(acceptedCountriesLabelIcon, AwesomeIcon.EDIT_SIGN);
|
||||
Tooltip.install(acceptedCountriesLabelIcon, new Tooltip("Open settings for editing"));
|
||||
Tooltip.install(acceptedCountriesLabelIcon, new Tooltip(Localisation.get("shared.openSettings")));
|
||||
acceptedCountriesLabelIcon.setOnMouseClicked(e -> openSettings());
|
||||
|
||||
acceptedLanguagesLabelIcon.setId("clickable-icon");
|
||||
AwesomeDude.setIcon(acceptedLanguagesLabelIcon, AwesomeIcon.EDIT_SIGN);
|
||||
Tooltip.install(acceptedLanguagesLabelIcon, new Tooltip("Open settings for editing"));
|
||||
Tooltip.install(acceptedLanguagesLabelIcon, new Tooltip(Localisation.get("shared.openSettings")));
|
||||
acceptedLanguagesLabelIcon.setOnMouseClicked(e -> openSettings());
|
||||
|
||||
acceptedArbitratorsLabelIcon.setId("clickable-icon");
|
||||
AwesomeDude.setIcon(acceptedArbitratorsLabelIcon, AwesomeIcon.EDIT_SIGN);
|
||||
Tooltip.install(acceptedArbitratorsLabelIcon, new Tooltip("Open settings for editing"));
|
||||
Tooltip.install(acceptedArbitratorsLabelIcon, new Tooltip(Localisation.get("shared.openSettings")));
|
||||
acceptedArbitratorsLabelIcon.setOnMouseClicked(e -> openSettings());
|
||||
}
|
||||
|
||||
@ -429,36 +445,42 @@ public class CreateOfferCB extends CachedCodeBehind<CreateOfferPM> {
|
||||
totalToPayInfoIconLabel.setId("clickable-icon");
|
||||
AwesomeDude.setIcon(totalToPayInfoIconLabel, AwesomeIcon.QUESTION_SIGN);
|
||||
|
||||
totalToPayInfoIconLabel.setOnMouseEntered(e -> createInfoPopover());
|
||||
totalToPayInfoIconLabel.setOnMouseExited(e -> {
|
||||
if (totalToPayInfoPopover != null)
|
||||
totalToPayInfoPopover.hide();
|
||||
});
|
||||
}
|
||||
|
||||
// As we don't use binding here we need to recreate it on mouse over to reflect the current state
|
||||
private void createInfoPopover() {
|
||||
GridPane infoGridPane = new GridPane();
|
||||
infoGridPane.setHgap(5);
|
||||
infoGridPane.setVgap(5);
|
||||
infoGridPane.setPadding(new Insets(10, 10, 10, 10));
|
||||
|
||||
addPayInfoEntry(infoGridPane, 0, "Collateral (" + presentationModel.collateralLabel.get() + ")",
|
||||
addPayInfoEntry(infoGridPane, 0,
|
||||
presentationModel.collateralLabel.get(),
|
||||
presentationModel.collateral.get());
|
||||
addPayInfoEntry(infoGridPane, 1, "Offer fee:", presentationModel.offerFee.get());
|
||||
addPayInfoEntry(infoGridPane, 2, "Bitcoin network fee:", presentationModel.networkFee.get());
|
||||
addPayInfoEntry(infoGridPane, 1, Localisation.get("createOffer.fundsBox.offerFee"),
|
||||
presentationModel.offerFee.get());
|
||||
addPayInfoEntry(infoGridPane, 2, Localisation.get("createOffer.fundsBox.networkFee"),
|
||||
presentationModel.networkFee.get());
|
||||
Separator separator = new Separator();
|
||||
separator.setOrientation(Orientation.HORIZONTAL);
|
||||
separator.setStyle("-fx-background: #666;");
|
||||
GridPane.setConstraints(separator, 1, 3);
|
||||
infoGridPane.getChildren().add(separator);
|
||||
addPayInfoEntry(infoGridPane, 4, "Total:", presentationModel.totalToPay.get());
|
||||
|
||||
totalToPayInfoIconLabel.setOnMouseEntered(e -> {
|
||||
if (totalToPayInfoIconLabel.getScene() != null) {
|
||||
totalToPayInfoPopover = new PopOver(infoGridPane);
|
||||
totalToPayInfoPopover.setDetachable(false);
|
||||
totalToPayInfoPopover.setArrowIndent(5);
|
||||
totalToPayInfoPopover.show(totalToPayInfoIconLabel.getScene().getWindow(),
|
||||
getPopupPosition().getX(),
|
||||
getPopupPosition().getY());
|
||||
}
|
||||
});
|
||||
totalToPayInfoIconLabel.setOnMouseExited(e -> {
|
||||
if (totalToPayInfoPopover != null)
|
||||
totalToPayInfoPopover.hide();
|
||||
});
|
||||
addPayInfoEntry(infoGridPane, 4, Localisation.get("createOffer.fundsBox.total"),
|
||||
presentationModel.totalToPay.get());
|
||||
totalToPayInfoPopover = new PopOver(infoGridPane);
|
||||
if (totalToPayInfoIconLabel.getScene() != null) {
|
||||
totalToPayInfoPopover.setDetachable(false);
|
||||
totalToPayInfoPopover.setArrowIndent(5);
|
||||
totalToPayInfoPopover.show(totalToPayInfoIconLabel.getScene().getWindow(),
|
||||
getPopupPosition().getX(),
|
||||
getPopupPosition().getY());
|
||||
}
|
||||
}
|
||||
|
||||
private void addPayInfoEntry(GridPane infoGridPane, int row, String labelText, String value) {
|
||||
|
@ -82,11 +82,14 @@ class CreateOfferModel extends UIModel {
|
||||
final StringProperty bankAccountCurrency = new SimpleStringProperty();
|
||||
final StringProperty bankAccountCounty = new SimpleStringProperty();
|
||||
final StringProperty bankAccountType = new SimpleStringProperty();
|
||||
|
||||
final StringProperty fiatCode = new SimpleStringProperty();
|
||||
final StringProperty btcCode = new SimpleStringProperty();
|
||||
|
||||
final LongProperty collateralAsLong = new SimpleLongProperty();
|
||||
|
||||
final BooleanProperty requestPlaceOfferSuccess = new SimpleBooleanProperty();
|
||||
final BooleanProperty isWalletFunded = new SimpleBooleanProperty();
|
||||
final BooleanProperty useMBTC = new SimpleBooleanProperty();
|
||||
|
||||
final ObjectProperty<Coin> amountAsCoin = new SimpleObjectProperty<>();
|
||||
final ObjectProperty<Coin> minAmountAsCoin = new SimpleObjectProperty<>();
|
||||
@ -154,6 +157,7 @@ class CreateOfferModel extends UIModel {
|
||||
acceptedCountries.setAll(settings.getAcceptedCountries());
|
||||
acceptedLanguages.setAll(settings.getAcceptedLanguageLocales());
|
||||
acceptedArbitrators.setAll(settings.getAcceptedArbitrators());
|
||||
btcCode.bind(settings.btcDenominationProperty());
|
||||
}
|
||||
|
||||
if (user != null) {
|
||||
@ -162,6 +166,8 @@ class CreateOfferModel extends UIModel {
|
||||
bankAccountType.set(bankAccount.getBankAccountType().toString());
|
||||
bankAccountCurrency.set(bankAccount.getCurrency().getCurrencyCode());
|
||||
bankAccountCounty.set(bankAccount.getCountry().getName());
|
||||
|
||||
fiatCode.set(bankAccount.getCurrency().getCurrencyCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,8 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||
final StringProperty paymentLabel = new SimpleStringProperty();
|
||||
final StringProperty transactionId = new SimpleStringProperty();
|
||||
final StringProperty requestPlaceOfferErrorMessage = new SimpleStringProperty();
|
||||
final StringProperty btcCode = new SimpleStringProperty();
|
||||
final StringProperty fiatCode = new SimpleStringProperty();
|
||||
|
||||
final BooleanProperty isPlaceOfferButtonVisible = new SimpleBooleanProperty(false);
|
||||
final BooleanProperty isPlaceOfferButtonDisabled = new SimpleBooleanProperty(true);
|
||||
@ -114,7 +116,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||
super.initialized();
|
||||
|
||||
// static
|
||||
paymentLabel.set("Bitsquare trade (" + model.getOfferId() + ")");
|
||||
paymentLabel.set(Localisation.get("createOffer.fundsBox.paymentLabel", model.getOfferId()));
|
||||
|
||||
if (model.addressEntry != null) {
|
||||
addressAsString.set(model.addressEntry.getAddress().toString());
|
||||
@ -151,7 +153,8 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||
// setOrderBookFilter is a one time call
|
||||
void setOrderBookFilter(@NotNull OrderBookFilter orderBookFilter) {
|
||||
model.setDirection(orderBookFilter.getDirection());
|
||||
directionLabel.set(model.getDirection() == Direction.BUY ? "Buy Bitcoin" : "Sell Bitcoin");
|
||||
directionLabel.set(model.getDirection() == Direction.BUY ? Localisation.get("shared.buy") : Localisation.get
|
||||
("shared.sell"));
|
||||
|
||||
// apply only if valid
|
||||
if (orderBookFilter.getAmount() != null && isBtcInputValid(orderBookFilter.getAmount().toPlainString())
|
||||
@ -206,7 +209,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||
// handle minAmount/amount relationship
|
||||
if (!model.isMinAmountLessOrEqualAmount()) {
|
||||
amountValidationResult.set(new InputValidator.ValidationResult(false,
|
||||
"Amount cannot be smaller than minimum amount."));
|
||||
Localisation.get("createOffer.validation.amountSmallerThanAmount")));
|
||||
}
|
||||
else {
|
||||
amountValidationResult.set(result);
|
||||
@ -228,7 +231,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||
|
||||
if (!model.isMinAmountLessOrEqualAmount()) {
|
||||
minAmountValidationResult.set(new InputValidator.ValidationResult(false,
|
||||
"Minimum amount cannot be larger than amount."));
|
||||
Localisation.get("createOffer.validation.minAmountLargerThanAmount")));
|
||||
}
|
||||
else {
|
||||
minAmountValidationResult.set(result);
|
||||
@ -359,8 +362,10 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||
collateral.bind(createStringBinding(() -> formatCoinWithCode(model.collateralAsCoin.get()),
|
||||
model.collateralAsCoin));
|
||||
|
||||
collateralLabel.bind(Bindings.createStringBinding(() -> "Collateral (" + BSFormatter.formatCollateralPercent
|
||||
(model.collateralAsLong.get()) + "):", model.collateralAsLong));
|
||||
collateralLabel.bind(Bindings.createStringBinding(() ->
|
||||
Localisation.get("createOffer.fundsBox.collateral",
|
||||
BSFormatter.formatCollateralPercent(model.collateralAsLong.get())),
|
||||
model.collateralAsLong));
|
||||
totalToPayAsCoin.bind(model.totalToPayAsCoin);
|
||||
|
||||
offerFee.bind(createStringBinding(() -> formatCoinWithCode(model.offerFeeAsCoin.get()),
|
||||
@ -376,6 +381,9 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||
requestPlaceOfferErrorMessage.bind(model.requestPlaceOfferErrorMessage);
|
||||
showTransactionPublishedScreen.bind(model.requestPlaceOfferSuccess);
|
||||
transactionId.bind(model.transactionId);
|
||||
|
||||
btcCode.bind(model.btcCode);
|
||||
fiatCode.bind(model.fiatCode);
|
||||
}
|
||||
|
||||
private void calculateVolume() {
|
||||
@ -392,7 +400,7 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||
// Amount calculation could lead to amount/minAmount invalidation
|
||||
if (!model.isMinAmountLessOrEqualAmount()) {
|
||||
amountValidationResult.set(new InputValidator.ValidationResult(false,
|
||||
"Amount cannot be smaller than minimum amount."));
|
||||
Localisation.get("createOffer.validation.amountSmallerThanAmount")));
|
||||
}
|
||||
else {
|
||||
if (amount.get() != null)
|
||||
|
@ -50,8 +50,8 @@
|
||||
<Insets right="-10" bottom="-10" left="-10" top="-10"/>
|
||||
</GridPane.margin>
|
||||
<Label fx:id="priceAmountTitleLabel" id="form-group-title-active"
|
||||
text="Create your offer" layoutX="8" layoutY="-8">
|
||||
<padding>
|
||||
text="%createOffer.amountPriceBox.title" layoutX="8" layoutY="-8">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
</padding>
|
||||
</Label>
|
||||
@ -66,8 +66,9 @@
|
||||
<Image url="@/images/buy_62_54.png"/>
|
||||
</image>
|
||||
</ImageView>
|
||||
<Label fx:id="buyLabel" id="direction-icon-label" text="Buy Bitcoins" alignment="CENTER">
|
||||
<padding>
|
||||
<Label fx:id="buyLabel" id="direction-icon-label" text="%createOffer.amountPriceBox.subTitle"
|
||||
alignment="CENTER">
|
||||
<padding>
|
||||
<Insets top="-5.0"/>
|
||||
</padding>
|
||||
</Label>
|
||||
@ -79,12 +80,14 @@
|
||||
</GridPane.margin>
|
||||
<VBox spacing="4">
|
||||
<children>
|
||||
<Label id="input-description-label" text="Amount of Bitcoin to buy" prefWidth="170"/>
|
||||
<Label id="input-description-label" text="%createOffer.amountPriceBox.amountDescr"
|
||||
prefWidth="170"/>
|
||||
<HBox>
|
||||
<children>
|
||||
<InputTextField fx:id="amountTextField" id="text-input-with-currency-text-field"
|
||||
promptText="Enter amount" prefWidth="170" alignment="CENTER_RIGHT"/>
|
||||
<Label id="currency-info-label" text="BTC"/>
|
||||
promptText="%createOffer.amount.prompt" prefWidth="170"
|
||||
alignment="CENTER_RIGHT"/>
|
||||
<Label fx:id="amountBtcLabel" id="currency-info-label"/>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
@ -100,12 +103,13 @@
|
||||
|
||||
<VBox spacing="4">
|
||||
<children>
|
||||
<Label id="input-description-label" text="Price per Bitcoin in EUR" prefWidth="170"/>
|
||||
<Label fx:id="priceDescriptionLabel" id="input-description-label" prefWidth="170"/>
|
||||
<HBox>
|
||||
<children>
|
||||
<InputTextField fx:id="priceTextField" id="text-input-with-currency-text-field"
|
||||
promptText="Enter price" prefWidth="170" alignment="CENTER_RIGHT"/>
|
||||
<Label id="currency-info-label" text="EUR" alignment="CENTER"/>
|
||||
promptText="%createOffer.price.prompt" prefWidth="170"
|
||||
alignment="CENTER_RIGHT"/>
|
||||
<Label fx:id="priceFiatLabel" id="currency-info-label" alignment="CENTER"/>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
@ -122,12 +126,13 @@
|
||||
|
||||
<VBox spacing="4">
|
||||
<children>
|
||||
<Label id="input-description-label" text="Amount in EUR to spend" prefWidth="170"/>
|
||||
<Label fx:id="volumeDescriptionLabel" id="input-description-label" prefWidth="170"/>
|
||||
<HBox>
|
||||
<children>
|
||||
<InputTextField fx:id="volumeTextField" id="text-input-with-currency-text-field"
|
||||
promptText="Trade volume" prefWidth="170" alignment="CENTER_RIGHT"/>
|
||||
<Label id="currency-info-label" text="EUR"/>
|
||||
promptText="%createOffer.volume.prompt" prefWidth="170"
|
||||
alignment="CENTER_RIGHT"/>
|
||||
<Label fx:id="volumeFiatLabel" id="currency-info-label"/>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
@ -138,12 +143,14 @@
|
||||
<GridPane.margin>
|
||||
<Insets right="10.0" top="5.0" bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
<Label id="input-description-label" text="Minimum amount of Bitcoin" prefWidth="170.0"/>
|
||||
<Label id="input-description-label" text="%createOffer.amountPriceBox.minAmountDescr"
|
||||
prefWidth="170.0"/>
|
||||
<HBox>
|
||||
<children>
|
||||
<InputTextField fx:id="minAmountTextField" id="text-input-with-currency-text-field"
|
||||
promptText="Enter min. amount" alignment="CENTER_RIGHT" prefWidth="170.0"/>
|
||||
<Label id="currency-info-label" text="BTC"/>
|
||||
promptText="%createOffer.minAmount.prompt" alignment="CENTER_RIGHT"
|
||||
prefWidth="170.0"/>
|
||||
<Label fx:id="minAmountBtcLabel" id="currency-info-label"/>
|
||||
</children>
|
||||
</HBox>
|
||||
</VBox>
|
||||
@ -155,17 +162,13 @@
|
||||
</GridPane.margin>
|
||||
<Image fx:id="infoIcon" url="@/images/info_44.png"/>
|
||||
</ImageView>
|
||||
<TextFlow GridPane.columnIndex="1" GridPane.rowIndex="2" prefWidth="740.0">
|
||||
|
||||
<Label prefWidth="740.0" wrapText="true"
|
||||
text="With the minimum amount you can attract more potential traders with giving them more flexibility. But note that there is no automatic creation of a new offer for the remaining amount in the case that a trader takes your offer with a lower amount as defined in the amount field. Your offer will be removed from the orderbook once a trader has taken your offer.">
|
||||
</Label>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
<Hyperlink text="Read more..." id="info-link" onAction="#onOpenGeneralHelp"/>
|
||||
<TextFlow GridPane.columnIndex="1" GridPane.rowIndex="2" prefWidth="740.0">
|
||||
<Label prefWidth="740.0" wrapText="true" text="%createOffer.amountPriceBox.info"/>
|
||||
<Hyperlink text="%shared.readMore" id="info-link" onAction="#onOpenGeneralHelp"/>
|
||||
</TextFlow>
|
||||
<Button fx:id="showPaymentInfoScreenButton" text="Next step" id="show-details-button"
|
||||
|
||||
<Button fx:id="showPaymentInfoScreenButton" text="%createOffer.amountPriceBox.next" id="show-details-button"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="3" defaultButton="true"
|
||||
onAction="#onShowPayFundsScreen">
|
||||
<GridPane.margin>
|
||||
@ -183,7 +186,7 @@
|
||||
<GridPane.margin>
|
||||
<Insets right="-10" bottom="-10" left="-10" top="-10"/>
|
||||
</GridPane.margin>
|
||||
<Label fx:id="payFundsTitleLabel" text="Fund your trade wallet" id="form-group-title-active"
|
||||
<Label fx:id="payFundsTitleLabel" text="%createOffer.fundsBox.title" id="form-group-title-active"
|
||||
layoutX="8" layoutY="-8">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
@ -192,7 +195,7 @@
|
||||
</Pane>
|
||||
|
||||
<HBox GridPane.rowIndex="4" spacing="4" alignment="CENTER_RIGHT">
|
||||
<Label fx:id="totalToPayLabel" text="Funds needed for that trade:" visible="false"/>
|
||||
<Label fx:id="totalToPayLabel" text="%createOffer.fundsBox.totalsNeeded" visible="false"/>
|
||||
<Label fx:id="totalToPayInfoIconLabel" visible="false"/>
|
||||
<GridPane.margin>
|
||||
<Insets top="10.0"/>
|
||||
@ -205,12 +208,12 @@
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
|
||||
<Label fx:id="addressLabel" text="Trade wallet address:" GridPane.rowIndex="5" visible="false"/>
|
||||
<Label fx:id="addressLabel" text="%createOffer.fundsBox.address" GridPane.rowIndex="5" visible="false"/>
|
||||
<AddressTextField fx:id="addressTextField" GridPane.columnIndex="1" GridPane.rowIndex="5"
|
||||
focusTraversable="true" visible="false"/>
|
||||
|
||||
<Label fx:id="balanceLabel" text="Trade wallet balance:" GridPane.rowIndex="6" visible="false">
|
||||
<GridPane.margin>
|
||||
<Label fx:id="balanceLabel" text="%createOffer.fundsBox.balance" GridPane.rowIndex="6" visible="false">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
@ -231,22 +234,18 @@
|
||||
|
||||
<TextFlow fx:id="payFundsInfoTextFlow" GridPane.columnIndex="1" GridPane.rowIndex="7" prefWidth="740.0"
|
||||
visible="false">
|
||||
<Label prefWidth="740.0" wrapText="true"
|
||||
text="For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary BTC amount. Those funds are reserved and will be used in the case that your offer gets executed. If you cancel your offer you can withdraw your funds from that trading wallet. The only payment which will be done now when placing the offer is the offer fee payment.">
|
||||
</Label>
|
||||
<Hyperlink text="Read more..." id="info-link" onAction="#onOpenFundingHelp"/>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
<Label prefWidth="740.0" wrapText="true" text="%createOffer.fundsBox.info"/>
|
||||
<Hyperlink text="%shared.readMore" id="info-link" onAction="#onOpenFundingHelp"/>
|
||||
</TextFlow>
|
||||
|
||||
<HBox spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="8">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="20" top="20.0"/>
|
||||
</GridPane.margin>
|
||||
<Button fx:id="showAdvancedSettingsButton" text="Show advanced settings"
|
||||
<Button fx:id="showAdvancedSettingsButton" text="%createOffer.fundsBox.showAdvanced"
|
||||
onAction="#onToggleShowAdvancedSettings" visible="false"/>
|
||||
<Button fx:id="placeOfferButton" text="Place offer" visible="false" defaultButton="true"
|
||||
<Button fx:id="placeOfferButton" text="%createOffer.fundsBox.placeOffer" visible="false"
|
||||
defaultButton="true"
|
||||
onAction="#onPlaceOffer"/>
|
||||
</HBox>
|
||||
|
||||
@ -260,7 +259,8 @@
|
||||
<GridPane.margin>
|
||||
<Insets right="-10" bottom="-10" left="-10" top="-10"/>
|
||||
</GridPane.margin>
|
||||
<Label fx:id="showDetailsTitleLabel" text="Advanced settings" id="form-group-title-active" layoutX="8"
|
||||
<Label fx:id="showDetailsTitleLabel" text="%createOffer.advancedBox.title" id="form-group-title-active"
|
||||
layoutX="8"
|
||||
layoutY="-8">
|
||||
<padding>
|
||||
<Insets left="5" right="7"/>
|
||||
@ -269,7 +269,7 @@
|
||||
</Pane>
|
||||
|
||||
<HBox GridPane.rowIndex="9" spacing="4" alignment="CENTER_RIGHT">
|
||||
<Label fx:id="acceptedCountriesLabel" text="Accepted countries:" visible="false"/>
|
||||
<Label fx:id="acceptedCountriesLabel" text="%createOffer.advancedBox.countries" visible="false"/>
|
||||
<Label fx:id="acceptedCountriesLabelIcon" visible="false"/>
|
||||
<GridPane.margin>
|
||||
<Insets top="0.0"/>
|
||||
@ -279,29 +279,32 @@
|
||||
editable="false" focusTraversable="false"/>
|
||||
|
||||
<HBox GridPane.rowIndex="10" spacing="4" alignment="CENTER_RIGHT">
|
||||
<Label fx:id="acceptedLanguagesLabel" text="Accepted languages:" visible="false"/>
|
||||
<Label fx:id="acceptedLanguagesLabel" text="%createOffer.advancedBox.languages" visible="false"/>
|
||||
<Label fx:id="acceptedLanguagesLabelIcon" visible="false"/>
|
||||
</HBox>
|
||||
<TextField fx:id="acceptedLanguagesTextField" GridPane.columnIndex="1" GridPane.rowIndex="10"
|
||||
editable="false" focusTraversable="false" visible="false"/>
|
||||
|
||||
<HBox GridPane.rowIndex="11" spacing="4" alignment="CENTER_RIGHT">
|
||||
<Label fx:id="acceptedArbitratorsLabel" text="Accepted arbitrators:" visible="false"/>
|
||||
<Label fx:id="acceptedArbitratorsLabel" text="%createOffer.advancedBox.arbitrators" visible="false"/>
|
||||
<Label fx:id="acceptedArbitratorsLabelIcon" visible="false"/>
|
||||
</HBox>
|
||||
<TextField fx:id="acceptedArbitratorsTextField" GridPane.columnIndex="1" GridPane.rowIndex="11"
|
||||
editable="false" focusTraversable="false" visible="false"/>
|
||||
|
||||
<Label fx:id="bankAccountTypeLabel" text="Fiat transfer type:" GridPane.rowIndex="12" visible="false"/>
|
||||
<Label fx:id="bankAccountTypeLabel" text="%createOffer.advancedBox.txType" GridPane.rowIndex="12"
|
||||
visible="false"/>
|
||||
<TextField fx:id="bankAccountTypeTextField" GridPane.columnIndex="1" GridPane.rowIndex="12" editable="false"
|
||||
focusTraversable="false" visible="false"/>
|
||||
|
||||
<Label fx:id="bankAccountCurrencyLabel" text="Currency:" GridPane.rowIndex="13" visible="false"/>
|
||||
<Label fx:id="bankAccountCurrencyLabel" text="%createOffer.advancedBox.currency" GridPane.rowIndex="13"
|
||||
visible="false"/>
|
||||
<TextField fx:id="bankAccountCurrencyTextField" GridPane.rowIndex="13" GridPane.columnIndex="1"
|
||||
editable="false" focusTraversable="false" visible="false"/>
|
||||
|
||||
<Label fx:id="bankAccountCountyLabel" text="County of Fiat account:" GridPane.rowIndex="14" visible="false">
|
||||
<GridPane.margin>
|
||||
<Label fx:id="bankAccountCountyLabel" text="%createOffer.advancedBox.county" GridPane.rowIndex="14"
|
||||
visible="false">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
</Label>
|
||||
@ -322,13 +325,8 @@
|
||||
|
||||
<TextFlow fx:id="showDetailsInfoLabel" GridPane.columnIndex="1" GridPane.rowIndex="15" prefWidth="740.0"
|
||||
visible="false">
|
||||
<Label prefWidth="740.0" wrapText="true"
|
||||
text="Your trading partners must fulfill your offer restrictions. You can edit the accepted countries, languages and arbitrators in the settings. The Fiat account details are used from your current selected Fiat account (if you have multiple Fiat accounts).">
|
||||
</Label>
|
||||
<Hyperlink text="Read more..." id="info-link" onAction="#onOpenAdvancedSettingsHelp"/>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0"/>
|
||||
</GridPane.margin>
|
||||
<Label prefWidth="740.0" wrapText="true" text="%createOffer.advancedBox.info"/>
|
||||
<Hyperlink text="%shared.readMore" id="info-link" onAction="#onOpenAdvancedSettingsHelp"/>
|
||||
</TextFlow>
|
||||
|
||||
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
package io.bitsquare.gui.util.validation;
|
||||
|
||||
import io.bitsquare.locale.Localisation;
|
||||
|
||||
import com.google.bitcoin.core.NetworkParameters;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -78,9 +80,7 @@ public class BtcValidator extends NumberValidator {
|
||||
BigDecimal bd = new BigDecimal(input);
|
||||
final BigDecimal satoshis = bd.movePointRight(8);
|
||||
if (satoshis.scale() > 0)
|
||||
return new ValidationResult(
|
||||
false,
|
||||
"Input results in a Bitcoin value with a fraction of the smallest unit (Satoshi).");
|
||||
return new ValidationResult(false, Localisation.get("validation.btc.toSmall"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
@ -89,9 +89,7 @@ public class BtcValidator extends NumberValidator {
|
||||
BigDecimal bd = new BigDecimal(input);
|
||||
final BigDecimal satoshis = bd.movePointRight(8);
|
||||
if (satoshis.longValue() > NetworkParameters.MAX_MONEY.longValue())
|
||||
return new ValidationResult(
|
||||
false,
|
||||
"Input larger as maximum possible Bitcoin value is not allowed.");
|
||||
return new ValidationResult(false, Localisation.get("validation.btc.toLarge"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
package io.bitsquare.gui.util.validation;
|
||||
|
||||
import io.bitsquare.locale.Localisation;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -63,9 +65,7 @@ public class FiatValidator extends NumberValidator {
|
||||
protected ValidationResult validateIfNotExceedsMinFiatValue(String input) {
|
||||
double d = Double.parseDouble(input);
|
||||
if (d < MIN_FIAT_VALUE)
|
||||
return new ValidationResult(
|
||||
false,
|
||||
"Input smaller as minimum possible Fiat value is not allowed..");
|
||||
return new ValidationResult(false, Localisation.get("validation.fiat.toSmall"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
@ -73,9 +73,7 @@ public class FiatValidator extends NumberValidator {
|
||||
protected ValidationResult validateIfNotExceedsMaxFiatValue(String input) {
|
||||
double d = Double.parseDouble(input);
|
||||
if (d > MAX_FIAT_VALUE)
|
||||
return new ValidationResult(
|
||||
false,
|
||||
"Input larger as maximum possible Fiat value is not allowed.");
|
||||
return new ValidationResult(false, Localisation.get("validation.fiat.toLarge"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
package io.bitsquare.gui.util.validation;
|
||||
|
||||
import io.bitsquare.locale.Localisation;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -44,7 +46,7 @@ public abstract class InputValidator {
|
||||
|
||||
protected ValidationResult validateIfNotEmpty(String input) {
|
||||
if (input == null || input.length() == 0)
|
||||
return new ValidationResult(false, "Empty input is not allowed.");
|
||||
return new ValidationResult(false, Localisation.get("validation.empty"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
package io.bitsquare.gui.util.validation;
|
||||
|
||||
import io.bitsquare.locale.Localisation;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -45,20 +47,20 @@ public abstract class NumberValidator extends InputValidator {
|
||||
Double.parseDouble(input);
|
||||
return new ValidationResult(true);
|
||||
} catch (Exception e) {
|
||||
return new ValidationResult(false, "Input is not a valid number.");
|
||||
return new ValidationResult(false, Localisation.get("validation.NaN"));
|
||||
}
|
||||
}
|
||||
|
||||
protected ValidationResult validateIfNotZero(String input) {
|
||||
if (Double.parseDouble(input) == 0)
|
||||
return new ValidationResult(false, "Input of 0 is not allowed.");
|
||||
return new ValidationResult(false, Localisation.get("validation.zero"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
||||
protected ValidationResult validateIfNotNegative(String input) {
|
||||
if (Double.parseDouble(input) < 0)
|
||||
return new ValidationResult(false, "A negative value is not allowed.");
|
||||
return new ValidationResult(false, Localisation.get("validation.negative"));
|
||||
else
|
||||
return new ValidationResult(true);
|
||||
}
|
||||
|
@ -20,12 +20,17 @@ package io.bitsquare.settings;
|
||||
import io.bitsquare.arbitrator.Arbitrator;
|
||||
import io.bitsquare.locale.Country;
|
||||
|
||||
import com.google.bitcoin.utils.CoinFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
|
||||
public class Settings implements Serializable {
|
||||
private static final long serialVersionUID = 7995048077355006861L;
|
||||
|
||||
@ -36,6 +41,7 @@ public class Settings implements Serializable {
|
||||
private long collateral = 100; // is 1/1000 so 100 results to 100/1000 = 0,1 (or 10%)
|
||||
// which will be used for multiplying with the amount to get the collateral size in BTC.
|
||||
|
||||
final StringProperty btcDenomination = new SimpleStringProperty(CoinFormat.CODE_BTC);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Constructor
|
||||
@ -113,4 +119,15 @@ public class Settings implements Serializable {
|
||||
return collateral;
|
||||
}
|
||||
|
||||
public String getBtcDenomination() {
|
||||
return btcDenomination.get();
|
||||
}
|
||||
|
||||
public StringProperty btcDenominationProperty() {
|
||||
return btcDenomination;
|
||||
}
|
||||
|
||||
public void setBtcDenomination(String useMBTC) {
|
||||
this.btcDenomination.set(useMBTC);
|
||||
}
|
||||
}
|
||||
|
@ -1 +1,3 @@
|
||||
com.google.bitcoin = FATAL
|
||||
com.google.bitcoin = FATAL
|
||||
|
||||
|
||||
|
@ -1,5 +1,77 @@
|
||||
# TODO: locale support will be added when ui is more final
|
||||
|
||||
# shared
|
||||
shared.readMore=Read more...
|
||||
shared.warning=Warning
|
||||
shared.error=Error
|
||||
shared.close=Close
|
||||
shared.openSettings=Open settings for editing
|
||||
shared.buy=Buy Bitcoin
|
||||
shared.sell=Sell Bitcoin
|
||||
|
||||
|
||||
# validation
|
||||
validation.empty=Empty input is not allowed.
|
||||
validation.NaN=Input is not a valid number.
|
||||
validation.zero=Input of 0 is not allowed.
|
||||
validation.negative=A negative value is not allowed.
|
||||
validation.fiat.toSmall=Input smaller as minimum possible Fiat value is not allowed.
|
||||
validation.fiat.toLarge=Input larger as maximum possible Fiat value is not allowed.
|
||||
validation.btc.toSmall=Input results in a Bitcoin value with a fraction of the smallest unit (Satoshi).
|
||||
validation.btc.toLarge=Input larger as maximum possible Bitcoin value is not allowed..
|
||||
|
||||
|
||||
# Create offer
|
||||
createOffer.amount.prompt=Enter amount
|
||||
createOffer.price.prompt=Enter price
|
||||
createOffer.volume.prompt=Trade volume
|
||||
createOffer.minAmount.prompt=Enter min. amount
|
||||
|
||||
createOffer.amountPriceBox.title=Create your offer
|
||||
createOffer.amountPriceBox.subTitle=Buy Bitcoin
|
||||
createOffer.amountPriceBox.amountDescr=Amount of Bitcoin to buy
|
||||
createOffer.amountPriceBox.priceDescr=Price per Bitcoin in {0}
|
||||
createOffer.amountPriceBox.volumeDescr=Amount in {0} to spend
|
||||
createOffer.amountPriceBox.minAmountDescr=Minimum amount of Bitcoin
|
||||
createOffer.amountPriceBox.info=With the minimum amount you can attract more potential traders with giving them more flexibility. But note that there is no automatic creation of a new offer for the remaining amount in the case that a trader takes your offer with a lower amount as defined in the amount field. Your offer will be removed from the orderbook once a trader has taken your offer.
|
||||
createOffer.amountPriceBox.next=Next step
|
||||
createOffer.amountPriceBox.warning.invalidBtcDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places.\nThe amount has been adjusted to 4 decimal places.
|
||||
createOffer.amountPriceBox.warning.invalidFiatDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places. The amount has been adjusted to 2 decimal places.
|
||||
createOffer.amountPriceBox.warning.adjustedVolume=The total volume you have entered leads to invalid fractional Bitcoin amounts. The amount has been adjusted and a new total volume be calculated from it.
|
||||
|
||||
createOffer.validation.amountSmallerThanAmount=Amount cannot be smaller than minimum amount.
|
||||
createOffer.validation.minAmountLargerThanAmount=Minimum amount cannot be larger than amount.
|
||||
|
||||
createOffer.fundsBox.title=Fund your trade wallet
|
||||
createOffer.fundsBox.totalsNeeded=Funds needed for that trade:
|
||||
createOffer.fundsBox.address=Trade wallet address:
|
||||
createOffer.fundsBox.balance=Trade wallet balance:
|
||||
createOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those funds are reserved and will be used in the case that your offer gets executed. If you cancel your offer you can withdraw your funds from that trading wallet. The only payment which will be done now when placing the offer is the offer fee payment.
|
||||
createOffer.fundsBox.collateral=Collateral ("{0}"):
|
||||
createOffer.fundsBox.offerFee=Offer fee:
|
||||
createOffer.fundsBox.networkFee=Bitcoin network fee:
|
||||
createOffer.fundsBox.total=Total:
|
||||
createOffer.fundsBox.showAdvanced=Show advanced settings
|
||||
createOffer.fundsBox.hideAdvanced=Hide advanced settings
|
||||
createOffer.fundsBox.placeOffer=Place offer
|
||||
createOffer.fundsBox.paymentLabel=Bitsquare trade ({0})
|
||||
|
||||
createOffer.advancedBox.title=Advanced settings
|
||||
createOffer.advancedBox.countries=Accepted countries:
|
||||
createOffer.advancedBox.languages=Accepted languages:
|
||||
createOffer.advancedBox.arbitrators=Accepted arbitrators:
|
||||
createOffer.advancedBox.txType=Fiat transfer type:
|
||||
createOffer.advancedBox.currency=Currency:
|
||||
createOffer.advancedBox.county=County of Fiat account:
|
||||
createOffer.advancedBox.info=Your trading partners must fulfill your offer restrictions. You can edit the accepted countries, languages and arbitrators in the settings. The Fiat account details are used from your current selected Fiat account (if you have multiple Fiat accounts).
|
||||
|
||||
createOffer.success.title=Offer published
|
||||
createOffer.success.headline=Your offer has been successfully published to the distributed orderbook.
|
||||
createOffer.success.info=The Bitcoin network transaction ID for the offer payment is: {0}
|
||||
createOffer.success.copyTxId=Copy transaction ID
|
||||
createOffer.error.requestPlaceOfferErrorMessage=An error occurred when placing the offer.\n{0}
|
||||
|
||||
|
||||
# TODO update the following when doing the UI
|
||||
# generic
|
||||
OTHER=Other
|
||||
|
||||
|
@ -71,12 +71,12 @@ public class UITestRunner extends Application {
|
||||
getUrl("/io/bitsquare/gui/trade/createoffer/CreateOfferView.fxml"), false);
|
||||
try {
|
||||
view = loader.load();
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getStackTrace().toString());
|
||||
}
|
||||
|
||||
pane.getChildren().setAll(view);
|
||||
refreshStylesheets();
|
||||
}
|
||||
|
||||
private void refreshStylesheets() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user