Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Buy BSQ" button next to trade fee selector #5055

Merged
merged 25 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f59d6fe
Add "Buy BSQ" button next to trade fee selector
ripcurlx Nov 4, 2021
107cc3a
Tiny refactoring
Jakub-CZ Jan 1, 2021
4c77044
Move button style to bisq.css
Jakub-CZ May 16, 2021
57b9c6f
Display button only when insufficient BSQ funds
Jakub-CZ May 17, 2021
717d7c2
Close current SELL offer tab
ripcurlx Nov 4, 2021
6692ce5
Improve wording
ripcurlx Oct 4, 2021
35e76e3
Add Button to confirm payment in BSQ wallet
ripcurlx Sep 30, 2021
9cf373a
Not show buy bsq hint for buy bsq offers
ripcurlx Oct 6, 2021
e1b405f
Apply minor refactorings
ripcurlx Nov 4, 2021
d2baabc
Move utility methods from GUIUtil to OfferViewUtil
ripcurlx Oct 6, 2021
ee30cd9
Refactor auto-closing of sell BTC offer view
ripcurlx Oct 6, 2021
9e2be92
Not auto-close create offer view
ripcurlx Oct 6, 2021
5527208
Add more context to buy BSQ button
ripcurlx Oct 6, 2021
d6cd83a
Improve informational popup
ripcurlx Oct 11, 2021
4063b72
Add tooltip for disabled create offer button
ripcurlx Nov 4, 2021
60a0d87
Refactor account name generation
ripcurlx Oct 12, 2021
a5b2859
Simplify and clean up data models
ripcurlx Nov 4, 2021
b7c4e5e
Create BSQ account and take offer if not existing
ripcurlx Nov 4, 2021
55826cb
Fix failing tests
ripcurlx Oct 13, 2021
e17fd9e
Add informational popup after account creation
ripcurlx Oct 15, 2021
0e4933f
Fix rebase merge errors
ripcurlx Nov 4, 2021
fac4b3c
Fix combobox BSQ selection error
ripcurlx Nov 4, 2021
12cd88c
Fix translations
ripcurlx Nov 4, 2021
2b90633
Improve naming of helper method
ripcurlx Nov 8, 2021
07e224e
Simplify containers and improve truncation behavior
ripcurlx Nov 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ market.trades.showVolumeInUSD=Show volume in USD

offerbook.createOffer=Create offer
offerbook.takeOffer=Take offer
offerbook.takeOffer.createAccount=Create account and take offer
offerbook.takeOfferToBuy=Take offer to buy {0}
offerbook.takeOfferToSell=Take offer to sell {0}
offerbook.trader=Trader
Expand Down Expand Up @@ -388,6 +389,7 @@ offerbook.createOfferToBuy.withFiat=Create new offer to buy {0} with {1}
offerbook.createOfferToSell.forFiat=Create new offer to sell {0} for {1}
offerbook.createOfferToBuy.withCrypto=Create new offer to sell {0} (buy {1})
offerbook.createOfferToSell.forCrypto=Create new offer to buy {0} (sell {1})
offerbook.createOfferDisabled.tooltip=You can only create one offer at a time

offerbook.takeOfferButton.tooltip=Take offer for {0}
offerbook.yesCreateOffer=Yes, create offer
Expand All @@ -402,6 +404,7 @@ offerbook.warning.noTradingAccountForCurrency.headline=No payment account for se
offerbook.warning.noTradingAccountForCurrency.msg=You don't have a payment account set up for the selected currency.\n\nWould you like to create an offer for another currency instead?
offerbook.warning.noMatchingAccount.headline=No matching payment account.
offerbook.warning.noMatchingAccount.msg=This offer uses a payment method you haven't set up yet. \n\nWould you like to set up a new payment account now?
offerbook.warning.noMatchingBsqAccount.msg=This offer uses BSQ as a payment method you haven't set up yet. \n\nWould you like to automatically create an account now?

offerbook.warning.counterpartyTradeRestrictions=This offer cannot be taken due to counterparty trade restrictions

Expand Down Expand Up @@ -440,6 +443,13 @@ offerbook.info.buyAtFixedPrice=You will buy at this fixed price.
offerbook.info.sellAtFixedPrice=You will sell at this fixed price.
offerbook.info.noArbitrationInUserLanguage=In case of a dispute, please note that arbitration for this offer will be handled in {0}. Language is currently set to {1}.
offerbook.info.roundedFiatVolume=The amount was rounded to increase the privacy of your trade.
offerbook.info.accountCreated.headline=Congratulations
offerbook.info.accountCreated.message=You''ve just successfully created a BSQ payment account.\n\
Your account can be found under Account > Altcoins Accounts > {0} and your BSQ wallet under DAO > BSQ Wallet.\n\n
ripcurlx marked this conversation as resolved.
Show resolved Hide resolved
offerbook.info.accountCreated.tradeInstant=You've chosen to take a BSQ instant offer, so a BSQ instant payment account was created for you. \
Be aware that instant trades are meant to be completed within 1 hour, \
so you should be online and available for the next 1 hour.\n\n
offerbook.info.accountCreated.takeOffer=You can now proceed to take this offer after closing this popup.

offerbook.bsqSwap.createOffer=Create Bsq swap offer

Expand Down Expand Up @@ -481,6 +491,11 @@ createOffer.triggerPrice.tooltip=As protection against drastic price movements y
createOffer.triggerPrice.invalid.tooLow=Value must be higher than {0}
createOffer.triggerPrice.invalid.tooHigh=Value must be lower than {0}

createOffer.buyBsq.popupMessage=Trading fees are paid to fund the Bisq DAO. Fees can be paid in BSQ or BTC.\n\n\
BSQ fees directly help fund Bisq's development, so Bisq encourages traders to use BSQ by offering a 50% discount on trading fees. \
This discount varies as the BSQ/BTC rate fluctuates. To maintain the 50% discount target, trading fees are updated every cycle as necessary.\n\n\
For more about fees, see [HYPERLINK:https://bisq.wiki/Trading_fees]. For more about trading BSQ, see [HYPERLINK:https://bisq.wiki/Trading_BSQ]. For more about the Bisq DAO, see [HYPERLINK:https://bisq.wiki/Introduction_to_the_DAO#The_Bisq_DAO].

# new entries
createOffer.placeOfferButton=Review: Place offer to {0} bitcoin
createOffer.createOfferFundWalletInfo.headline=Fund your offer
Expand Down Expand Up @@ -860,6 +875,7 @@ portfolio.pending.step3_seller.xmrTxHash=Transaction ID
portfolio.pending.step3_seller.xmrTxKey=Transaction key
portfolio.pending.step3_seller.buyersAccount=Buyers account data
portfolio.pending.step3_seller.confirmReceipt=Confirm payment receipt
portfolio.pending.step3_seller.showBsqWallet=Show payment in BSQ wallet
portfolio.pending.step3_seller.buyerStartedPayment=The BTC buyer has started the {0} payment.\n{1}
portfolio.pending.step3_seller.buyerStartedPayment.altcoin=Check for blockchain confirmations at your altcoin wallet or block explorer and confirm the payment when you have sufficient blockchain confirmations.
portfolio.pending.step3_seller.buyerStartedPayment.fiat=Check at your trading account (e.g. bank account) and confirm when you have received the payment.
Expand Down
8 changes: 8 additions & 0 deletions desktop/src/main/java/bisq/desktop/bisq.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@
-fx-padding: 0 10 0 10;
}

.tiny-button,
.action-button.tiny-button {
-fx-font-size: 0.769em;
-fx-pref-height: 20;
-fx-padding: 3 8 3 8;
-fx-border-radius: 5;
}

.text-button {
-fx-background-color: transparent;
-fx-underline: true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ public HyperlinkWithIcon(String text) {
this(text, AwesomeIcon.INFO_SIGN);
}

public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon) {
public HyperlinkWithIcon(String text, String fontSize) {
this(text, AwesomeIcon.INFO_SIGN, fontSize);
}

public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon, String fontSize) {
super(text);

Label icon = new Label();
AwesomeDude.setIcon(icon, awesomeIcon);
AwesomeDude.setIcon(icon, awesomeIcon, fontSize);
icon.setMinWidth(20);
icon.setOpacity(0.7);
icon.getStyleClass().addAll("hyperlink", "no-underline");
Expand All @@ -55,6 +59,10 @@ public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon) {
setIcon(icon);
}

public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon) {
this(text, awesomeIcon, "1.231em");
}

public HyperlinkWithIcon(String text, GlyphIcons icon) {
this(text, icon, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@

import bisq.common.util.Tuple2;

import org.apache.commons.lang3.StringUtils;

import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
Expand All @@ -62,8 +60,13 @@ public static int addFormForBuyer(GridPane gridPane, int gridRow,
return gridRow;
}

public AdvancedCashForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, AdvancedCashValidator advancedCashValidator,
InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
public AdvancedCashForm(PaymentAccount paymentAccount,
AccountAgeWitnessService accountAgeWitnessService,
AdvancedCashValidator advancedCashValidator,
InputValidator inputValidator,
GridPane gridPane,
int gridRow,
CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.advancedCashAccount = (AdvancedCashAccount) paymentAccount;
this.advancedCashValidator = advancedCashValidator;
Expand Down Expand Up @@ -101,12 +104,7 @@ private void addCurrenciesGrid(boolean isEditable) {

@Override
protected void autoFillNameTextField() {
if (useCustomAccountNameToggleButton != null && !useCustomAccountNameToggleButton.isSelected()) {
String accountNr = accountNrInputTextField.getText();
accountNr = StringUtils.abbreviate(accountNr, 9);
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(accountNr));
}
setAccountNameWithString(accountNrInputTextField.getText());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
import bisq.common.UserThread;
import bisq.common.util.Tuple3;

import org.apache.commons.lang3.StringUtils;

import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
Expand All @@ -53,6 +51,7 @@

import javafx.util.StringConverter;

import static bisq.desktop.util.DisplayUtils.createAssetsAccountName;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addLabelCheckBox;
Expand Down Expand Up @@ -167,12 +166,7 @@ public void updateFromInputs() {
@Override
protected void autoFillNameTextField() {
if (useCustomAccountNameToggleButton != null && !useCustomAccountNameToggleButton.isSelected()) {
String currency = paymentAccount.getSingleTradeCurrency() != null ? paymentAccount.getSingleTradeCurrency().getCode() : "";
if (currency != null) {
String address = addressInputTextField.getText();
address = StringUtils.abbreviate(address, 9);
accountNameTextField.setText(currency.concat(": ").concat(address));
}
accountNameTextField.setText(createAssetsAccountName(paymentAccount, addressInputTextField.getText()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@

import bisq.common.util.Tuple2;

import org.apache.commons.lang3.StringUtils;

import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
Expand Down Expand Up @@ -100,12 +98,7 @@ private void addCurrenciesGrid(boolean isEditable) {

@Override
protected void autoFillNameTextField() {
if (useCustomAccountNameToggleButton != null && !useCustomAccountNameToggleButton.isSelected()) {
String accountNr = accountNrInputTextField.getText();
accountNr = StringUtils.abbreviate(accountNr, 9);
String method = Res.get(paymentAccount.getPaymentMethod().getId());
accountNameTextField.setText(method.concat(": ").concat(accountNr));
}
setAccountNameWithString(accountNrInputTextField.getText());
}

@Override
Expand Down
Loading