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 2 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/src/main/resources/i18n/displayStrings.properties
Expand Up @@ -446,10 +446,10 @@ offerbook.info.roundedFiatVolume=The amount was rounded to increase the privacy
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
offerbook.info.accountCreated.tradeInstant=As you've chosen to take a BSQ instant offer a BSQ instant account was created for you. \
For instant trading it is required that both trading peers are online to be able \
to complete the trade in less than 1 hour.\n\n
offerbook.info.accountCreated.takeOffer=You can no proceed to take this offer after closing this popup.
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 @@ -613,6 +613,11 @@ public void setOfferActionHandler(OfferView.OfferActionHandler offerActionHandle

public void onTabSelected(boolean isSelected) {
model.onTabSelected(isSelected);

if (isSelected) {
updateCurrencyComboBoxFromModel();
root.requestFocus();
}
}

///////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Expand Up @@ -226,16 +226,7 @@ public OfferBookViewModel(User user,
protected void activate() {
filteredItems.addListener(filterItemsListener);

String code = direction == OfferDirection.BUY ? preferences.getBuyScreenCurrencyCode() : preferences.getSellScreenCurrencyCode();
if (code != null && !code.isEmpty() && !isShowAllEntry(code) &&
CurrencyUtil.getTradeCurrency(code).isPresent()) {
showAllTradeCurrenciesProperty.set(false);
selectedTradeCurrency = CurrencyUtil.getTradeCurrency(code).get();
} else {
showAllTradeCurrenciesProperty.set(true);
selectedTradeCurrency = GlobalSettings.getDefaultTradeCurrency();
}
tradeCurrencyCode.set(selectedTradeCurrency.getCode());
updateSelectedTradeCurrency();

if (user != null) {
disableMatchToggle.set(user.getPaymentAccounts() == null || user.getPaymentAccounts().isEmpty());
Expand Down Expand Up @@ -269,6 +260,11 @@ void initWithDirection(OfferDirection direction) {
void onTabSelected(boolean isSelected) {
this.isTabSelected = isSelected;
setMarketPriceFeedCurrency();

if (isTabSelected) {
updateSelectedTradeCurrency();
filterOffers();
}
}

///////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -703,4 +699,17 @@ public void onCreateOffer() {
public void onTakeOffer(Offer offer) {
offerActionHandler.onTakeOffer(offer);
}

private void updateSelectedTradeCurrency() {
String code = direction == OfferDirection.BUY ? preferences.getBuyScreenCurrencyCode() : preferences.getSellScreenCurrencyCode();
if (code != null && !code.isEmpty() && !isShowAllEntry(code) &&
CurrencyUtil.getTradeCurrency(code).isPresent()) {
showAllTradeCurrenciesProperty.set(false);
selectedTradeCurrency = CurrencyUtil.getTradeCurrency(code).get();
} else {
showAllTradeCurrenciesProperty.set(true);
selectedTradeCurrency = GlobalSettings.getDefaultTradeCurrency();
}
tradeCurrencyCode.set(selectedTradeCurrency.getCode());
}
}