Merge branch 'master' into Development

This commit is contained in:
Manfred Karrer 2016-11-13 22:56:31 +01:00
commit 3fb7cb1de4
6 changed files with 25 additions and 22 deletions

View file

@ -16,7 +16,7 @@ You can read about all of this and more in the [whitepaper](https://bitsquare.io
Status
------
Bitsquare has releases the beta version on the 27th of April 2016 after 3 months testing on mainnet.
Bitsquare has released the beta version on the 27th of April 2016 after 3 months testing on mainnet.
For the latest version checkout our [releases page](https://github.com/bitsquare/bitsquare/releases) at Github.
Building from source

View file

@ -22,6 +22,10 @@ import io.bitsquare.app.Version;
public final class CryptoCurrency extends TradeCurrency {
// That object is saved to disc. We need to take care of changes to not break deserialization.
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
// http://boschista.deviantart.com/journal/Cool-ASCII-Symbols-214218618
private final static String PREFIX = "";
private boolean isAsset;
public CryptoCurrency(String currencyCode, String name) {
@ -40,4 +44,9 @@ public final class CryptoCurrency extends TradeCurrency {
public boolean isAsset() {
return isAsset;
}
@Override
public String getDisplayPrefix() {
return PREFIX;
}
}

View file

@ -26,6 +26,9 @@ public final class FiatCurrency extends TradeCurrency {
// That object is saved to disc. We need to take care of changes to not break deserialization.
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
// http://boschista.deviantart.com/journal/Cool-ASCII-Symbols-214218618
private final static String PREFIX = "";
private final Currency currency;
public FiatCurrency(String currencyCode) {
@ -42,6 +45,11 @@ public final class FiatCurrency extends TradeCurrency {
return currency;
}
@Override
public String getDisplayPrefix() {
return PREFIX;
}
@Override
public String toString() {
return "FiatCurrency{" +

View file

@ -58,6 +58,10 @@ public abstract class TradeCurrency implements Persistable, Comparable<TradeCurr
return symbol;
}
public String getDisplayPrefix() {
return "";
}
public String getNameAndCode() {
return name + " (" + code + ")";
}

View file

@ -145,12 +145,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Activatab
@Override
public String toString(TradeCurrency tradeCurrency) {
// http://boschista.deviantart.com/journal/Cool-ASCII-Symbols-214218618
if (tradeCurrency instanceof FiatCurrency)
return "" + tradeCurrency.getNameAndCode();
else if (tradeCurrency instanceof CryptoCurrency)
return "" + tradeCurrency.getNameAndCode();
else
return "-";
return tradeCurrency.getDisplayPrefix() + tradeCurrency.getNameAndCode();
}
@Override

View file

@ -25,9 +25,7 @@ import com.googlecode.jcsv.writer.internal.CSVWriterBuilder;
import io.bitsquare.app.DevFlags;
import io.bitsquare.common.util.Utilities;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.locale.CryptoCurrency;
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.FiatCurrency;
import io.bitsquare.locale.TradeCurrency;
import io.bitsquare.payment.PaymentAccount;
import io.bitsquare.storage.Storage;
@ -184,7 +182,6 @@ public class GUIUtil {
public String toString(CurrencyListItem item) {
TradeCurrency tradeCurrency = item.tradeCurrency;
String code = tradeCurrency.getCode();
// http://boschista.deviantart.com/journal/Cool-ASCII-Symbols-214218618
if (code.equals(GUIUtil.SHOW_ALL_FLAG))
return "▶ Show all";
else if (code.equals(GUIUtil.EDIT_FLAG))
@ -193,12 +190,7 @@ public class GUIUtil {
String displayString = CurrencyUtil.getNameByCode(code) + " (" + code + ")";
if (preferences.getSortMarketCurrenciesNumerically())
displayString += " - " + item.numTrades + " " + postFix;
if (tradeCurrency instanceof FiatCurrency)
return "" + displayString;
else if (tradeCurrency instanceof CryptoCurrency) {
return "" + displayString;
} else
return "-";
return tradeCurrency.getDisplayPrefix() + displayString;
}
}
@ -220,12 +212,7 @@ public class GUIUtil {
return "▶ Show all";
else if (code.equals(GUIUtil.EDIT_FLAG))
return "▼ Edit currency list";
else if (tradeCurrency instanceof FiatCurrency)
return "" + displayString;
else if (tradeCurrency instanceof CryptoCurrency) {
return "" + displayString;
} else
return "-";
return tradeCurrency.getDisplayPrefix() + displayString;
}
@Override