Make "Show all" default

This commit is contained in:
Manfred Karrer 2016-04-12 01:30:03 +02:00
parent c5656ee9ac
commit dd8d300496
2 changed files with 8 additions and 4 deletions

View file

@ -170,6 +170,8 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
paymentMethodColumn.setComparator((o1, o2) -> o1.getOffer().getPaymentMethod().compareTo(o2.getOffer().getPaymentMethod()));
avatarColumn.setComparator((o1, o2) -> o1.getOffer().getOwnerNodeAddress().hostName.compareTo(o2.getOffer().getOwnerNodeAddress().hostName));
priceColumn.sortableProperty().bind(model.showAllTradeCurrenciesProperty.not());
createOfferButton = addButton(root, ++gridRow, "");
createOfferButton.setMinHeight(40);
createOfferButton.setPadding(new Insets(0, 20, 0, 20));

View file

@ -89,11 +89,12 @@ class OfferBookViewModel extends ActivatableViewModel {
// If id is empty string we ignore filter (display all methods)
PaymentMethod selectedPaymentMethod = new PaymentMethod(SHOW_ALL_FLAG, 0, 0, null);
private CryptoCurrency showAllCurrenciesItem = new CryptoCurrency(SHOW_ALL_FLAG, SHOW_ALL_FLAG);
private final ObservableList<OfferBookListItem> offerBookListItems;
private final ListChangeListener<OfferBookListItem> listChangeListener;
private boolean isTabSelected;
final BooleanProperty showAllTradeCurrenciesProperty = new SimpleBooleanProperty();
final BooleanProperty showAllTradeCurrenciesProperty = new SimpleBooleanProperty(true);
boolean showAllPaymentMethods = true;
@ -152,7 +153,7 @@ class OfferBookViewModel extends ActivatableViewModel {
private void fillAllTradeCurrencies() {
allTradeCurrencies.clear();
// Used for ignoring filter (show all)
allTradeCurrencies.add(new CryptoCurrency(SHOW_ALL_FLAG, SHOW_ALL_FLAG));
allTradeCurrencies.add(showAllCurrenciesItem);
allTradeCurrencies.addAll(preferences.getTradeCurrenciesAsObservable());
allTradeCurrencies.add(new CryptoCurrency(EDIT_FLAG, EDIT_FLAG));
}
@ -186,10 +187,11 @@ class OfferBookViewModel extends ActivatableViewModel {
public void onSetTradeCurrency(TradeCurrency tradeCurrency) {
String code = tradeCurrency.getCode();
showAllTradeCurrenciesProperty.set(isShowAllEntry(code));
boolean showAllEntry = isShowAllEntry(code);
showAllTradeCurrenciesProperty.set(showAllEntry);
if (isEditEntry(code))
navigation.navigateTo(MainView.class, SettingsView.class, PreferencesView.class);
else if (!showAllTradeCurrenciesProperty.get()) {
else if (!showAllEntry) {
this.selectedTradeCurrency = tradeCurrency;
tradeCurrencyCode.set(code);
}