mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
Show recommended miner fee in popup when ask user for funding offer
This commit is contained in:
parent
c190d7f1df
commit
065a57606a
5 changed files with 100 additions and 93 deletions
|
@ -18,7 +18,7 @@ public class DevEnv {
|
|||
// If set to true we ignore several UI behavior like confirmation popups as well dummy accounts are created and
|
||||
// offers are filled with default values. Intended to make dev testing faster.
|
||||
@SuppressWarnings("PointlessBooleanExpression")
|
||||
public static final boolean DEV_MODE = STRESS_TEST_MODE || true;
|
||||
public static final boolean DEV_MODE = STRESS_TEST_MODE || false;
|
||||
|
||||
public static final boolean DAO_PHASE2_ACTIVATED = false;
|
||||
}
|
||||
|
|
|
@ -336,7 +336,7 @@ offerbook.warning.tradeLimitNotMatching=Your payment account has been created {0
|
|||
createOffer.amount.prompt=Enter amount in BTC
|
||||
createOffer.price.prompt=Enter price
|
||||
createOffer.volume.prompt=Enter amount in {0}
|
||||
createOffer.amountPriceBox.amountDescription=Amount of bitcoin to {0}
|
||||
createOffer.amountPriceBox.amountDescription=Amount of BTC to {0}
|
||||
createOffer.amountPriceBox.priceDescriptionFiat=Fixed price per {0}
|
||||
createOffer.amountPriceBox.buy.volumeDescription=Amount in {0} to spend
|
||||
createOffer.amountPriceBox.sell.volumeDescription=Amount in {0} to receive
|
||||
|
@ -390,8 +390,8 @@ createOffer.setDeposit=Set buyer's security deposit
|
|||
####################################################################
|
||||
|
||||
takeOffer.amount.prompt=Enter amount in BTC
|
||||
takeOffer.amountPriceBox.buy.amountDescription=Amount of bitcoin to sell
|
||||
takeOffer.amountPriceBox.sell.amountDescription=Amount of bitcoin to buy
|
||||
takeOffer.amountPriceBox.buy.amountDescription=Amount of BTC to sell
|
||||
takeOffer.amountPriceBox.sell.amountDescription=Amount of BTC to buy
|
||||
takeOffer.amountPriceBox.priceDescription=Price per bitcoin in {0}
|
||||
takeOffer.amountPriceBox.amountRangeDescription=Possible amount range
|
||||
takeOffer.amountPriceBox.warning.invalidBtcDecimalPlaces=The amount you have entered exceeds the number of allowed decimal places.\nThe amount has been adjusted to 4 decimal places.
|
||||
|
@ -1307,9 +1307,8 @@ systemTray.tooltip=Bisq: The decentralized exchange network
|
|||
####################################################################
|
||||
|
||||
guiUtil.miningFeeInfo=Please be sure that the mining fee used at your external wallet is \
|
||||
sufficiently high so that the funding transaction will be accepted by the miners.\n\
|
||||
Otherwise the trade transactions cannot be confirmed and a trade would end up in a dispute.\n\n\
|
||||
You can check out the currently recommended fees at: https://bitcoinfees.21.co
|
||||
at least {0} Satoshi/Byte. Otherwise the trade transactions cannot be confirmed and a trade would end up in a dispute.
|
||||
|
||||
guiUtil.accountExport.savedToPath=Trading accounts saved to path:\n{0}
|
||||
guiUtil.accountExport.noAccountSetup=You don't have trading accounts set up for exporting.
|
||||
guiUtil.accountExport.selectPath=Select path to {0}
|
||||
|
|
|
@ -77,6 +77,7 @@ import io.bisq.gui.main.overlays.windows.TacWindow;
|
|||
import io.bisq.gui.main.overlays.windows.WalletPasswordWindow;
|
||||
import io.bisq.gui.main.overlays.windows.downloadupdate.DisplayUpdateDownloadWindow;
|
||||
import io.bisq.gui.util.BSFormatter;
|
||||
import io.bisq.gui.util.GUIUtil;
|
||||
import io.bisq.network.crypto.DecryptedDataTuple;
|
||||
import io.bisq.network.crypto.EncryptionService;
|
||||
import io.bisq.network.p2p.BootstrapListener;
|
||||
|
@ -640,6 +641,7 @@ public class MainViewModel implements ViewModel {
|
|||
p2PService.onAllServicesInitialized();
|
||||
|
||||
feeService.onAllServicesInitialized();
|
||||
GUIUtil.setFeeService(feeService);
|
||||
|
||||
daoManager.onAllServicesInitialized(errorMessage -> new Popup<>().error(errorMessage).show());
|
||||
|
||||
|
|
|
@ -245,23 +245,23 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
private void addBindings() {
|
||||
if (dataModel.getDirection() == OfferPayload.Direction.BUY) {
|
||||
volumeDescriptionLabel.bind(createStringBinding(
|
||||
() -> Res.get("createOffer.amountPriceBox.buy.volumeDescription", dataModel.getTradeCurrencyCode().get()),
|
||||
dataModel.getTradeCurrencyCode()));
|
||||
() -> Res.get("createOffer.amountPriceBox.buy.volumeDescription", dataModel.getTradeCurrencyCode().get()),
|
||||
dataModel.getTradeCurrencyCode()));
|
||||
} else {
|
||||
volumeDescriptionLabel.bind(createStringBinding(
|
||||
() -> Res.get("createOffer.amountPriceBox.sell.volumeDescription", dataModel.getTradeCurrencyCode().get()),
|
||||
dataModel.getTradeCurrencyCode()));
|
||||
() -> Res.get("createOffer.amountPriceBox.sell.volumeDescription", dataModel.getTradeCurrencyCode().get()),
|
||||
dataModel.getTradeCurrencyCode()));
|
||||
}
|
||||
volumePromptLabel.bind(createStringBinding(
|
||||
() -> Res.get("createOffer.volume.prompt", dataModel.getTradeCurrencyCode().get()),
|
||||
dataModel.getTradeCurrencyCode()));
|
||||
() -> Res.get("createOffer.volume.prompt", dataModel.getTradeCurrencyCode().get()),
|
||||
dataModel.getTradeCurrencyCode()));
|
||||
|
||||
totalToPay.bind(createStringBinding(() -> btcFormatter.formatCoinWithCode(dataModel.totalToPayAsCoinProperty().get()),
|
||||
dataModel.totalToPayAsCoinProperty()));
|
||||
dataModel.totalToPayAsCoinProperty()));
|
||||
|
||||
|
||||
tradeAmount.bind(createStringBinding(() -> btcFormatter.formatCoinWithCode(dataModel.getAmount().get()),
|
||||
dataModel.getAmount()));
|
||||
dataModel.getAmount()));
|
||||
|
||||
|
||||
tradeCurrencyCode.bind(dataModel.getTradeCurrencyCode());
|
||||
|
@ -307,8 +307,8 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
double priceAsDouble = btcFormatter.parseNumberStringToDouble(price.get());
|
||||
double relation = priceAsDouble / marketPriceAsDouble;
|
||||
final OfferPayload.Direction compareDirection = CurrencyUtil.isCryptoCurrency(currencyCode) ?
|
||||
OfferPayload.Direction.SELL :
|
||||
OfferPayload.Direction.BUY;
|
||||
OfferPayload.Direction.SELL :
|
||||
OfferPayload.Direction.BUY;
|
||||
double percentage = dataModel.getDirection() == compareDirection ? 1 - relation : relation - 1;
|
||||
percentage = MathUtils.roundDouble(percentage, 4);
|
||||
dataModel.setMarketPriceMargin(percentage);
|
||||
|
@ -333,8 +333,8 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
double percentage = btcFormatter.parsePercentStringToDouble(newValue);
|
||||
if (percentage >= 1 || percentage <= -1) {
|
||||
new Popup<>().warning(Res.get("popup.warning.tooLargePercentageValue") + "\n" +
|
||||
Res.get("popup.warning.examplePercentageValue"))
|
||||
.show();
|
||||
Res.get("popup.warning.examplePercentageValue"))
|
||||
.show();
|
||||
} else {
|
||||
final String currencyCode = dataModel.getTradeCurrencyCode().get();
|
||||
MarketPrice marketPrice = priceFeedService.getMarketPrice(currencyCode);
|
||||
|
@ -343,14 +343,14 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
double marketPriceAsDouble = marketPrice.getPrice();
|
||||
final boolean isCryptoCurrency = CurrencyUtil.isCryptoCurrency(currencyCode);
|
||||
final OfferPayload.Direction compareDirection = isCryptoCurrency ?
|
||||
OfferPayload.Direction.SELL :
|
||||
OfferPayload.Direction.BUY;
|
||||
OfferPayload.Direction.SELL :
|
||||
OfferPayload.Direction.BUY;
|
||||
double factor = dataModel.getDirection() == compareDirection ?
|
||||
1 - percentage :
|
||||
1 + percentage;
|
||||
1 - percentage :
|
||||
1 + percentage;
|
||||
double targetPrice = marketPriceAsDouble * factor;
|
||||
int precision = isCryptoCurrency ?
|
||||
Altcoin.SMALLEST_UNIT_EXPONENT : Fiat.SMALLEST_UNIT_EXPONENT;
|
||||
Altcoin.SMALLEST_UNIT_EXPONENT : Fiat.SMALLEST_UNIT_EXPONENT;
|
||||
// protect from triggering unwanted updates
|
||||
ignorePriceStringListener = true;
|
||||
price.set(btcFormatter.formatRoundedDoubleWithPrecision(targetPrice, precision));
|
||||
|
@ -530,7 +530,7 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
final boolean isBuy = dataModel.getDirection() == OfferPayload.Direction.BUY;
|
||||
directionLabel = isBuy ? Res.get("shared.buyBitcoin") : Res.get("shared.sellBitcoin");
|
||||
amountDescription = Res.get("createOffer.amountPriceBox.amountDescription",
|
||||
isBuy ? Res.get("shared.buy") : Res.get("shared.sell"));
|
||||
isBuy ? Res.get("shared.buy") : Res.get("shared.sell"));
|
||||
|
||||
buyerSecurityDeposit.set(btcFormatter.formatCoin(dataModel.getBuyerSecurityDeposit().get()));
|
||||
|
||||
|
@ -619,11 +619,11 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
} else {
|
||||
//noinspection unchecked
|
||||
new Popup<>().warning(Res.get("shared.notEnoughFunds",
|
||||
btcFormatter.formatCoinWithCode(dataModel.totalToPayAsCoinProperty().get()),
|
||||
btcFormatter.formatCoinWithCode(dataModel.totalAvailableBalance)))
|
||||
.actionButtonTextWithGoTo("navigation.funds.depositFunds")
|
||||
.onAction(() -> navigation.navigateTo(MainView.class, FundsView.class, DepositView.class))
|
||||
.show();
|
||||
btcFormatter.formatCoinWithCode(dataModel.totalToPayAsCoinProperty().get()),
|
||||
btcFormatter.formatCoinWithCode(dataModel.totalAvailableBalance)))
|
||||
.actionButtonTextWithGoTo("navigation.funds.depositFunds")
|
||||
.onAction(() -> navigation.navigateTo(MainView.class, FundsView.class, DepositView.class))
|
||||
.show();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -740,25 +740,25 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
Coin defaultSecurityDeposit = Restrictions.getDefaultBuyerSecurityDeposit();
|
||||
String key = "buyerSecurityDepositLowerAsDefault";
|
||||
if (preferences.showAgain(key) &&
|
||||
btcFormatter.parseToCoin(buyerSecurityDeposit.get()).compareTo(defaultSecurityDeposit) < 0) {
|
||||
btcFormatter.parseToCoin(buyerSecurityDeposit.get()).compareTo(defaultSecurityDeposit) < 0) {
|
||||
final String postfix = dataModel.isBuyOffer() ?
|
||||
Res.get("createOffer.tooLowSecDeposit.makerIsBuyer") :
|
||||
Res.get("createOffer.tooLowSecDeposit.makerIsSeller");
|
||||
Res.get("createOffer.tooLowSecDeposit.makerIsBuyer") :
|
||||
Res.get("createOffer.tooLowSecDeposit.makerIsSeller");
|
||||
new Popup<>()
|
||||
.warning(Res.get("createOffer.tooLowSecDeposit.warning",
|
||||
btcFormatter.formatCoinWithCode(defaultSecurityDeposit)) + "\n\n" + postfix)
|
||||
.width(800)
|
||||
.actionButtonText(Res.get("createOffer.resetToDefault"))
|
||||
.onAction(() -> {
|
||||
dataModel.setBuyerSecurityDeposit(defaultSecurityDeposit);
|
||||
ignoreSecurityDepositStringListener = true;
|
||||
buyerSecurityDeposit.set(btcFormatter.formatCoin(dataModel.getBuyerSecurityDeposit().get()));
|
||||
ignoreSecurityDepositStringListener = false;
|
||||
})
|
||||
.closeButtonText(Res.get("createOffer.useLowerValue"))
|
||||
.onClose(this::applyBuyerSecurityDepositOnFocusOut)
|
||||
.dontShowAgainId(key)
|
||||
.show();
|
||||
.warning(Res.get("createOffer.tooLowSecDeposit.warning",
|
||||
btcFormatter.formatCoinWithCode(defaultSecurityDeposit)) + "\n\n" + postfix)
|
||||
.width(800)
|
||||
.actionButtonText(Res.get("createOffer.resetToDefault"))
|
||||
.onAction(() -> {
|
||||
dataModel.setBuyerSecurityDeposit(defaultSecurityDeposit);
|
||||
ignoreSecurityDepositStringListener = true;
|
||||
buyerSecurityDeposit.set(btcFormatter.formatCoin(dataModel.getBuyerSecurityDeposit().get()));
|
||||
ignoreSecurityDepositStringListener = false;
|
||||
})
|
||||
.closeButtonText(Res.get("createOffer.useLowerValue"))
|
||||
.onClose(this::applyBuyerSecurityDepositOnFocusOut)
|
||||
.dontShowAgainId(key)
|
||||
.show();
|
||||
} else {
|
||||
applyBuyerSecurityDepositOnFocusOut();
|
||||
}
|
||||
|
@ -795,12 +795,12 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
Popup popup = new Popup<>();
|
||||
//noinspection unchecked
|
||||
popup.warning(Res.get("createOffer.priceOutSideOfDeviation",
|
||||
btcFormatter.formatToPercentWithSymbol(preferences.getMaxPriceDistanceInPercent())))
|
||||
.actionButtonText(Res.get("createOffer.changePrice"))
|
||||
.onAction(popup::hide)
|
||||
.closeButtonTextWithGoTo("navigation.settings.preferences")
|
||||
.onClose(() -> navigation.navigateTo(MainView.class, SettingsView.class, PreferencesView.class))
|
||||
.show();
|
||||
btcFormatter.formatToPercentWithSymbol(preferences.getMaxPriceDistanceInPercent())))
|
||||
.actionButtonText(Res.get("createOffer.changePrice"))
|
||||
.onAction(popup::hide)
|
||||
.closeButtonTextWithGoTo("navigation.settings.preferences")
|
||||
.onClose(() -> navigation.navigateTo(MainView.class, SettingsView.class, PreferencesView.class))
|
||||
.show();
|
||||
}
|
||||
|
||||
BSFormatter getBtcFormatter() {
|
||||
|
@ -821,7 +821,7 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
|
||||
public String getSecurityDepositInfo() {
|
||||
return btcFormatter.formatCoinWithCode(dataModel.getSecurityDeposit()) +
|
||||
GUIUtil.getPercentageOfTradeAmount(dataModel.getSecurityDeposit(), dataModel.getAmount().get(), btcFormatter);
|
||||
GUIUtil.getPercentageOfTradeAmount(dataModel.getSecurityDeposit(), dataModel.getAmount().get(), btcFormatter);
|
||||
}
|
||||
|
||||
public String getMakerFee() {
|
||||
|
@ -845,7 +845,7 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
public String getTxFee() {
|
||||
Coin txFeeAsCoin = dataModel.getTxFee();
|
||||
return btcFormatter.formatCoinWithCode(txFeeAsCoin) +
|
||||
GUIUtil.getPercentageOfTradeAmount(txFeeAsCoin, dataModel.getAmount().get(), btcFormatter);
|
||||
GUIUtil.getPercentageOfTradeAmount(txFeeAsCoin, dataModel.getAmount().get(), btcFormatter);
|
||||
|
||||
}
|
||||
|
||||
|
@ -970,8 +970,8 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
|
||||
private void updateSpinnerInfo() {
|
||||
if (!showPayFundsScreenDisplayed.get() ||
|
||||
errorMessage.get() != null ||
|
||||
showTransactionPublishedScreen.get()) {
|
||||
errorMessage.get() != null ||
|
||||
showTransactionPublishedScreen.get()) {
|
||||
waitingForFundsText.set("");
|
||||
} else if (dataModel.getIsBtcWalletFunded().get()) {
|
||||
waitingForFundsText.set("");
|
||||
|
@ -990,13 +990,13 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
private void updateButtonDisableState() {
|
||||
log.debug("updateButtonDisableState");
|
||||
boolean inputDataValid = isBtcInputValid(amount.get()).isValid &&
|
||||
isBtcInputValid(minAmount.get()).isValid &&
|
||||
isPriceInputValid(price.get()).isValid &&
|
||||
securityDepositValidator.validate(buyerSecurityDeposit.get()).isValid &&
|
||||
dataModel.getPrice().get() != null &&
|
||||
dataModel.getPrice().get().getValue() != 0 &&
|
||||
isVolumeInputValid(volume.get()).isValid &&
|
||||
dataModel.isMinAmountLessOrEqualAmount();
|
||||
isBtcInputValid(minAmount.get()).isValid &&
|
||||
isPriceInputValid(price.get()).isValid &&
|
||||
securityDepositValidator.validate(buyerSecurityDeposit.get()).isValid &&
|
||||
dataModel.getPrice().get() != null &&
|
||||
dataModel.getPrice().get().getValue() != 0 &&
|
||||
isVolumeInputValid(volume.get()).isValid &&
|
||||
dataModel.isMinAmountLessOrEqualAmount();
|
||||
|
||||
isNextButtonDisabled.set(!inputDataValid);
|
||||
// boolean notSufficientFees = dataModel.isWalletFunded.get() && dataModel.isMainNet.get() && !dataModel.isFeeFromFundingTxSufficient.get();
|
||||
|
|
|
@ -34,6 +34,7 @@ import io.bisq.common.util.Utilities;
|
|||
import io.bisq.core.app.BisqEnvironment;
|
||||
import io.bisq.core.payment.PaymentAccount;
|
||||
import io.bisq.core.payment.PaymentAccountList;
|
||||
import io.bisq.core.provider.fee.FeeService;
|
||||
import io.bisq.core.user.DontShowAgainLookup;
|
||||
import io.bisq.core.user.Preferences;
|
||||
import io.bisq.core.user.User;
|
||||
|
@ -74,6 +75,11 @@ import java.util.stream.Collectors;
|
|||
public class GUIUtil {
|
||||
public final static String SHOW_ALL_FLAG = "SHOW_ALL_FLAG";
|
||||
public final static String EDIT_FLAG = "EDIT_FLAG";
|
||||
private static FeeService feeService;
|
||||
|
||||
public static void setFeeService(FeeService feeService) {
|
||||
GUIUtil.feeService = feeService;
|
||||
}
|
||||
|
||||
public static double getScrollbarWidth(Node scrollablePane) {
|
||||
Node node = scrollablePane.lookup(".scroll-bar");
|
||||
|
@ -91,7 +97,7 @@ public class GUIUtil {
|
|||
String key = "miningFeeInfo";
|
||||
//noinspection ConstantConditions,ConstantConditions
|
||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key) && BisqEnvironment.getBaseCurrencyNetwork().isBitcoin()) {
|
||||
new Popup<>().information(Res.get("guiUtil.miningFeeInfo"))
|
||||
new Popup<>().attention(Res.get("guiUtil.miningFeeInfo", String.valueOf(GUIUtil.feeService.getTxFeePerByte().value)))
|
||||
.onClose(runnable::run)
|
||||
.useIUnderstandButton()
|
||||
.show();
|
||||
|
@ -162,15 +168,15 @@ public class GUIUtil {
|
|||
if (file != null) {
|
||||
try (OutputStreamWriter outputStreamWriter = new OutputStreamWriter(new FileOutputStream(file, false), Charsets.UTF_8)) {
|
||||
CSVWriter<T> headerWriter = new CSVWriterBuilder<T>(outputStreamWriter)
|
||||
.strategy(CSVStrategy.UK_DEFAULT)
|
||||
.entryConverter(headerConverter)
|
||||
.build();
|
||||
.strategy(CSVStrategy.UK_DEFAULT)
|
||||
.entryConverter(headerConverter)
|
||||
.build();
|
||||
headerWriter.write(emptyItem);
|
||||
|
||||
CSVWriter<T> contentWriter = new CSVWriterBuilder<T>(outputStreamWriter)
|
||||
.strategy(CSVStrategy.UK_DEFAULT)
|
||||
.entryConverter(contentConverter)
|
||||
.build();
|
||||
.strategy(CSVStrategy.UK_DEFAULT)
|
||||
.entryConverter(contentConverter)
|
||||
.build();
|
||||
contentWriter.writeAll(list);
|
||||
} catch (RuntimeException | IOException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -254,13 +260,13 @@ public class GUIUtil {
|
|||
});
|
||||
|
||||
List<CurrencyListItem> list = tradeCurrencySet.stream()
|
||||
.filter(e -> CurrencyUtil.isFiatCurrency(e.getCode()))
|
||||
.map(e -> new CurrencyListItem(e, tradesPerCurrencyMap.get(e.getCode())))
|
||||
.collect(Collectors.toList());
|
||||
.filter(e -> CurrencyUtil.isFiatCurrency(e.getCode()))
|
||||
.map(e -> new CurrencyListItem(e, tradesPerCurrencyMap.get(e.getCode())))
|
||||
.collect(Collectors.toList());
|
||||
List<CurrencyListItem> cryptoList = tradeCurrencySet.stream()
|
||||
.filter(e -> CurrencyUtil.isCryptoCurrency(e.getCode()))
|
||||
.map(e -> new CurrencyListItem(e, tradesPerCurrencyMap.get(e.getCode())))
|
||||
.collect(Collectors.toList());
|
||||
.filter(e -> CurrencyUtil.isCryptoCurrency(e.getCode()))
|
||||
.map(e -> new CurrencyListItem(e, tradesPerCurrencyMap.get(e.getCode())))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (preferences.isSortMarketCurrenciesNumerically()) {
|
||||
list.sort((o1, o2) -> new Integer(o2.numTrades).compareTo(o1.numTrades));
|
||||
|
@ -308,14 +314,14 @@ public class GUIUtil {
|
|||
String key = "warnOpenURLWhenTorEnabled";
|
||||
if (DontShowAgainLookup.showAgain(key)) {
|
||||
new Popup<>().information(Res.get("guiUtil.openWebBrowser.warning", target))
|
||||
.actionButtonText(Res.get("guiUtil.openWebBrowser.doOpen"))
|
||||
.onAction(() -> {
|
||||
DontShowAgainLookup.dontShowAgain(key, true);
|
||||
doOpenWebPage(target);
|
||||
})
|
||||
.closeButtonText(Res.get("guiUtil.openWebBrowser.copyUrl"))
|
||||
.onClose(() -> Utilities.copyToClipboard(target))
|
||||
.show();
|
||||
.actionButtonText(Res.get("guiUtil.openWebBrowser.doOpen"))
|
||||
.onAction(() -> {
|
||||
DontShowAgainLookup.dontShowAgain(key, true);
|
||||
doOpenWebPage(target);
|
||||
})
|
||||
.closeButtonText(Res.get("guiUtil.openWebBrowser.copyUrl"))
|
||||
.onClose(() -> Utilities.copyToClipboard(target))
|
||||
.show();
|
||||
} else {
|
||||
doOpenWebPage(target);
|
||||
}
|
||||
|
@ -343,7 +349,7 @@ public class GUIUtil {
|
|||
|
||||
public static String getPercentageOfTradeAmount(Coin fee, Coin tradeAmount, BSFormatter formatter) {
|
||||
return " (" + formatter.formatToPercentWithSymbol((double) fee.value / (double) tradeAmount.value) +
|
||||
" " + Res.get("guiUtil.ofTradeAmount") + ")";
|
||||
" " + Res.get("guiUtil.ofTradeAmount") + ")";
|
||||
}
|
||||
|
||||
@SuppressWarnings({"UnusedParameters", "SameReturnValue"})
|
||||
|
@ -373,10 +379,10 @@ public class GUIUtil {
|
|||
String key = "confirmClearXchangeRequirements";
|
||||
final String currencyName = BisqEnvironment.getBaseCurrencyNetwork().getCurrencyName();
|
||||
new Popup<>().information(Res.get("payment.clearXchange.info", currencyName, currencyName))
|
||||
.width(900)
|
||||
.closeButtonText(Res.get("shared.iConfirm"))
|
||||
.dontShowAgainId(key)
|
||||
.show();
|
||||
.width(900)
|
||||
.closeButtonText(Res.get("shared.iConfirm"))
|
||||
.dontShowAgainId(key)
|
||||
.show();
|
||||
}
|
||||
|
||||
public static void fillAvailableHeight(Pane container, Region component, DoubleProperty initialOccupiedHeight) {
|
||||
|
@ -397,8 +403,8 @@ public class GUIUtil {
|
|||
|
||||
public static String getBitcoinURI(String address, Coin amount, String label) {
|
||||
return address != null ?
|
||||
BitcoinURI.convertToBitcoinURI(Address.fromBase58(BisqEnvironment.getParameters(),
|
||||
address), amount, label, null) :
|
||||
"";
|
||||
BitcoinURI.convertToBitcoinURI(Address.fromBase58(BisqEnvironment.getParameters(),
|
||||
address), amount, label, null) :
|
||||
"";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue