From a6c9fe5a51b00ff14216827710f2da946fdbc765 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Fri, 16 Feb 2018 10:54:12 +0100 Subject: [PATCH] Only let user select amount if there is actually an amount range to select from --- .../main/offer/takeoffer/TakeOfferView.java | 42 ++++++++++++++----- .../offer/takeoffer/TakeOfferViewModel.java | 2 + 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/gui/src/main/java/io/bisq/gui/main/offer/takeoffer/TakeOfferView.java b/gui/src/main/java/io/bisq/gui/main/offer/takeoffer/TakeOfferView.java index 34da719ae4..634c159d38 100644 --- a/gui/src/main/java/io/bisq/gui/main/offer/takeoffer/TakeOfferView.java +++ b/gui/src/main/java/io/bisq/gui/main/offer/takeoffer/TakeOfferView.java @@ -87,14 +87,14 @@ public class TakeOfferView extends ActivatableViewAndModel paymentAccountsComboBox; private Label directionLabel, amountDescriptionLabel, addressLabel, balanceLabel, totalToPayLabel, paymentAccountsLabel, paymentMethodLabel, priceCurrencyLabel, priceAsPercentageLabel, volumeCurrencyLabel, priceDescriptionLabel, volumeDescriptionLabel, - waitingForFundsLabel, offerAvailabilityLabel; + waitingForFundsLabel, offerAvailabilityLabel, amountCurrency; private InputTextField amountTextField; private TextField paymentMethodTextField, currencyTextField, priceTextField, priceAsPercentageTextField, volumeTextField, amountRangeTextField; @@ -116,7 +116,6 @@ public class TakeOfferView extends ActivatableViewAndModel { - if (DevEnv.DAO_TRADING_ACTIVATED) - showFeeOption(); - else - onShowPayFundsScreen(); + showNextStepAfterAmountIsSet(); }); cancelButton1 = new AutoTooltipButton(Res.get("shared.cancel")); @@ -741,6 +751,13 @@ public class TakeOfferView extends ActivatableViewAndModel amountValueCurrencyBoxTuple = getAmountCurrencyBox(Res.get("takeOffer.amount.prompt")); HBox amountValueCurrencyBox = amountValueCurrencyBoxTuple.first; amountTextField = amountValueCurrencyBoxTuple.second; + amountCurrency = amountValueCurrencyBoxTuple.third; Tuple2 amountInputBoxTuple = getTradeInputBox(amountValueCurrencyBox, model.getAmountDescription()); amountDescriptionLabel = amountInputBoxTuple.first; VBox amountBox = amountInputBoxTuple.second; @@ -951,12 +969,14 @@ public class TakeOfferView extends ActivatableViewAndModel amountValueCurrencyBoxTuple = getNonEditableValueCurrencyBox(); - HBox amountValueCurrencyBox = amountValueCurrencyBoxTuple.first; amountRangeTextField = amountValueCurrencyBoxTuple.second; - Tuple2 amountInputBoxTuple = getTradeInputBox(amountValueCurrencyBox, + Tuple2 amountInputBoxTuple = getTradeInputBox( amountValueCurrencyBoxTuple.first, Res.get("takeOffer.amountPriceBox.amountRangeDescription")); + amountRangeBox = amountInputBoxTuple.second; + amountRangeBox.setVisible(false); + Label xLabel = new AutoTooltipLabel("x"); xLabel.setFont(Font.font("Helvetica-Bold", 20)); xLabel.setPadding(new Insets(14, 3, 0, 3)); @@ -965,7 +985,7 @@ public class TakeOfferView extends ActivatableViewAndModel im return dataModel.getOffer(); } + public boolean isRange() {return dataModel.getOffer().isRange(); } + public String getAmountRange() { return amountRange; }