mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-05 21:24:19 -04:00
Add show all currency filter option in offerbook views
This commit is contained in:
parent
485b33acf6
commit
f5a61f9924
9 changed files with 106 additions and 79 deletions
|
@ -41,10 +41,10 @@ public class CurrencyUtil {
|
|||
set.addAll(getSortedSEPACurrencyCodes());
|
||||
|
||||
// PerfectMoney:
|
||||
set.add(new TradeCurrency("USD"));
|
||||
set.add(new FiatCurrency("USD"));
|
||||
|
||||
// Alipay:
|
||||
set.add(new TradeCurrency("CNY"));
|
||||
set.add(new FiatCurrency("CNY"));
|
||||
|
||||
// OKPay: We want to maintain the order so we don't use a Set but add items if nto already in list
|
||||
getAllOKPayCurrencies().stream().forEach(set::add);
|
||||
|
|
|
@ -109,7 +109,10 @@ public final class PaymentMethod implements Persistable, Comparable {
|
|||
|
||||
@Override
|
||||
public int compareTo(@NotNull Object other) {
|
||||
return this.id.compareTo(((PaymentMethod) other).id);
|
||||
if (id != null)
|
||||
return this.id.compareTo(((PaymentMethod) other).id);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -119,24 +122,24 @@ public final class PaymentMethod implements Persistable, Comparable {
|
|||
|
||||
PaymentMethod that = (PaymentMethod) o;
|
||||
|
||||
if (getLockTime() != that.getLockTime()) return false;
|
||||
if (getMaxTradePeriod() != that.getMaxTradePeriod()) return false;
|
||||
return !(getId() != null ? !getId().equals(that.getId()) : that.getId() != null);
|
||||
if (lockTime != that.lockTime) return false;
|
||||
if (maxTradePeriod != that.maxTradePeriod) return false;
|
||||
return !(id != null ? !id.equals(that.id) : that.id != null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getId() != null ? getId().hashCode() : 0;
|
||||
result = 31 * result + (int) (getLockTime() ^ (getLockTime() >>> 32));
|
||||
result = 31 * result + getMaxTradePeriod();
|
||||
int result = id != null ? id.hashCode() : 0;
|
||||
result = 31 * result + (int) (lockTime ^ (lockTime >>> 32));
|
||||
result = 31 * result + maxTradePeriod;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PaymentMethod{" +
|
||||
"name='" + id + '\'' +
|
||||
"id='" + id + '\'' +
|
||||
", lockTime=" + lockTime +
|
||||
", waitPeriodForOpenDispute=" + maxTradePeriod +
|
||||
'}';
|
||||
|
|
|
@ -24,6 +24,7 @@ import io.bitsquare.btc.FeePolicy;
|
|||
import io.bitsquare.common.persistance.Persistable;
|
||||
import io.bitsquare.locale.CountryUtil;
|
||||
import io.bitsquare.locale.CurrencyUtil;
|
||||
import io.bitsquare.locale.FiatCurrency;
|
||||
import io.bitsquare.locale.TradeCurrency;
|
||||
import io.bitsquare.storage.Storage;
|
||||
import javafx.beans.Observable;
|
||||
|
@ -78,7 +79,7 @@ public final class Preferences implements Persistable {
|
|||
return defaultLocale;
|
||||
}
|
||||
|
||||
private static TradeCurrency defaultTradeCurrency = new TradeCurrency(CurrencyUtil.getCurrencyByCountryCode(CountryUtil.getDefaultCountryCode()).getCurrency().getCurrencyCode());
|
||||
private static TradeCurrency defaultTradeCurrency = new FiatCurrency(CurrencyUtil.getCurrencyByCountryCode(CountryUtil.getDefaultCountryCode()).getCurrency().getCurrencyCode());
|
||||
|
||||
public static TradeCurrency getDefaultTradeCurrency() {
|
||||
return defaultTradeCurrency;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue