Merge remote-tracking branch 'upstream/master' into add-monospace-font-support-roboto

This commit is contained in:
Christoph Atteneder 2018-02-16 11:00:59 +01:00
commit 75ac5c8a66
No known key found for this signature in database
GPG Key ID: CD5DC1C529CDFD3B
2 changed files with 2 additions and 24 deletions

View File

@ -273,28 +273,6 @@ public class GUIUtil {
};
}
@Deprecated
public static StringConverter<TradeCurrency> getTradeCurrencyConverter() {
return new StringConverter<TradeCurrency>() {
@Override
public String toString(TradeCurrency tradeCurrency) {
String code = tradeCurrency.getCode();
final String displayString = CurrencyUtil.getNameAndCode(code);
// http://boschista.deviantart.com/journal/Cool-ASCII-Symbols-214218618
if (code.equals(GUIUtil.SHOW_ALL_FLAG))
return "" + Res.get("list.currency.showAll");
else if (code.equals(GUIUtil.EDIT_FLAG))
return "" + Res.get("list.currency.editList");
return tradeCurrency.getDisplayPrefix() + displayString;
}
@Override
public TradeCurrency fromString(String s) {
return null;
}
};
}
public static void updateConfidence(TransactionConfidence confidence, Tooltip tooltip, TxConfidenceIndicator txConfidenceIndicator) {
if (confidence != null) {
switch (confidence.getConfidenceType()) {

View File

@ -27,9 +27,8 @@ public class GUIUtilTest {
@Test
public void testTradeCurrencyConverter() {
Res.setBaseCurrencyCode("EUR");
Res.setBaseCurrencyName("Euro");
Map<String, Integer> offerCounts = new HashMap<String, Integer>() {{
put("BTC", 11);
put("EUR", 10);
}};
StringConverter<TradeCurrency> tradeCurrencyConverter = GUIUtil.getTradeCurrencyConverter(
@ -38,6 +37,7 @@ public class GUIUtilTest {
offerCounts
);
assertEquals("✦ BTC (BTC) - 11 offers", tradeCurrencyConverter.toString(bitcoin));
assertEquals("★ Euro (EUR) - 10 offers", tradeCurrencyConverter.toString(euro));
}