UI bugfixes

This commit is contained in:
Manfred Karrer 2016-03-09 22:03:03 +01:00
parent f706ddaad4
commit 94288021dd
10 changed files with 35 additions and 27 deletions

View File

@ -180,11 +180,11 @@ public class BitsquareApp extends Application {
showEmptyWalletPopup();
} else if (new KeyCodeCombination(KeyCode.M, KeyCombination.SHORTCUT_DOWN).match(keyEvent)) {
showSendAlertMessagePopup();
} else if (BitsquareApp.DEV_MODE) {
} else if (new KeyCodeCombination(KeyCode.F, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
showFPSWindow();
else if (BitsquareApp.DEV_MODE) {
if (new KeyCodeCombination(KeyCode.D, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
showDebugWindow();
else if (new KeyCodeCombination(KeyCode.F, KeyCombination.SHORTCUT_DOWN).match(keyEvent))
showFPSWindow();
}
});

View File

@ -518,7 +518,7 @@ public class MainViewModel implements ViewModel {
break;
case HALF_REACHED:
key = "displayHalfTradePeriodOver" + trade.getId();
if (preferences.showAgain(key) && !BitsquareApp.DEV_MODE) {
if (preferences.showAgain(key)) {
preferences.dontShowAgain(key, true);
new Popup().warning("Your trade with ID " + trade.getShortId() +
" has reached the half of the max. allowed trading period and " +
@ -530,7 +530,7 @@ public class MainViewModel implements ViewModel {
break;
case TRADE_PERIOD_OVER:
key = "displayTradePeriodOver" + trade.getId();
if (preferences.showAgain(key) && !BitsquareApp.DEV_MODE) {
if (preferences.showAgain(key)) {
preferences.dontShowAgain(key, true);
new Popup().warning("Your trade with ID " + trade.getShortId() +
" has reached the max. allowed trading period and is " +

View File

@ -153,8 +153,10 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
FilteredList<Dispute> filteredList = new FilteredList<>(disputeManager.getDisputesAsObservableList());
setFilteredListPredicate(filteredList);
SortedList<Dispute> sortedList = new SortedList<>(filteredList);
sortedList.setComparator((o1, o2) -> o2.getOpeningDate().compareTo(o1.getOpeningDate()));
// sortedList.setComparator((o1, o2) -> o2.getOpeningDate().compareTo(o1.getOpeningDate()));
sortedList.comparatorProperty().bind(disputesTable.comparatorProperty());
disputesTable.setItems(sortedList);
disputesTable.sort();
disputesTable.getSelectionModel().selectedItemProperty().addListener(disputeChangeListener);
Dispute selectedItem = disputesTable.getSelectionModel().getSelectedItem();

View File

@ -92,9 +92,9 @@ public class FundsView extends ActivatableViewAndModel<TabPane, Activatable> {
"Withdrawing funds can be done after a trade is completed.\n\n" +
"Dedicated wallets help protect user privacy and prevent leaking information of previous trades to other" +
"traders.")
.closeButtonText("I understand")
.actionButtonText("Visit FAQ web page")
.onAction(() -> Utilities.openWebPage("https://bitsquare.io/faq"))
.closeButtonText("I understand")
.dontShowAgainId(key, preferences)
.show();
}

View File

@ -425,7 +425,8 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
key = "takeOfferFundWalletInfo";
String tradeAmountText = model.isSeller() ? "the trade amount, " : "";
new Popup().headLine("Fund your trading wallet").instruction("You need to pay in " +
new Popup().headLine("Fund your trading wallet")
.instruction("You need to pay in " +
model.totalToPay.get() + " to your local Bitsquare trading wallet.\n" +
"The amount is the sum of " + tradeAmountText + "the security deposit, the trading fee and " +
"the bitcoin mining fee.\n\n" +

View File

@ -189,9 +189,8 @@ public class NotificationCenter {
.onAction(() -> {
preferences.dontShowAgain(key, true);
navigation.navigateTo(MainView.class, PortfolioView.class, PendingTradesView.class);
UserThread.runAfter(() -> {
selectItemByTradeIdConsumer.accept(trade.getId());
}, 1);
if (selectItemByTradeIdConsumer != null)
UserThread.runAfter(() -> selectItemByTradeIdConsumer.accept(trade.getId()), 1);
})
.onClose(() -> preferences.dontShowAgain(key, true))
.show();
@ -199,7 +198,8 @@ public class NotificationCenter {
notification.actionButtonText("Select trade")
.onAction(() -> {
preferences.dontShowAgain(key, true);
selectItemByTradeIdConsumer.accept(trade.getId());
if (selectItemByTradeIdConsumer != null)
selectItemByTradeIdConsumer.accept(trade.getId());
})
.onClose(() -> preferences.dontShowAgain(key, true))
.show();

View File

@ -66,7 +66,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
}
public final BSFormatter formatter;
private final BtcAddressValidator btcAddressValidator;
public final BtcAddressValidator btcAddressValidator;
public final P2PService p2PService;
public final User user;

View File

@ -17,7 +17,6 @@
package io.bitsquare.gui.main.portfolio.pendingtrades.steps.buyer;
import io.bitsquare.app.BitsquareApp;
import io.bitsquare.common.util.Tuple3;
import io.bitsquare.gui.components.TextFieldWithCopyIcon;
import io.bitsquare.gui.components.TitledGroupBg;
@ -66,7 +65,6 @@ public class BuyerStep2View extends TradeStepView {
if (state == Trade.State.DEPOSIT_CONFIRMED_IN_BLOCK_CHAIN) {
PaymentAccountContractData paymentAccountContractData = model.dataModel.getSellersPaymentAccountContractData();
String key = "startPayment" + trade.getId();
log.error("key " + key);
String message = "";
if (paymentAccountContractData instanceof BlockChainAccountContractData)
message = "Your trade has reached at least one blockchain confirmation.\n" +
@ -91,9 +89,9 @@ public class BuyerStep2View extends TradeStepView {
"Bitcoin, Btc or Bitsquare.";
if (preferences.showAgain(key)) {
preferences.dontShowAgain(key, true);
new Popup().headLine("Attention required for trade with ID " + trade.getShortId())
.instruction(message)
.onClose(() -> preferences.dontShowAgain(key, true))
.show();
}
} else if (state == Trade.State.BUYER_CONFIRMED_FIAT_PAYMENT_INITIATED) {
@ -221,7 +219,7 @@ public class BuyerStep2View extends TradeStepView {
private void onPaymentStarted() {
if (model.p2PService.isBootstrapped()) {
String key = "confirmPaymentStarted";
if (preferences.showAgain(key) && !BitsquareApp.DEV_MODE) {
if (preferences.showAgain(key)) {
Popup popup = new Popup();
popup.headLine("Confirm that you have started the payment")
.confirmation("Have you initiated the " + model.dataModel.getCurrencyCode() +

View File

@ -23,6 +23,7 @@ import io.bitsquare.btc.AddressEntry;
import io.bitsquare.btc.Restrictions;
import io.bitsquare.btc.WalletService;
import io.bitsquare.common.util.Tuple2;
import io.bitsquare.gui.components.InputTextField;
import io.bitsquare.gui.main.MainView;
import io.bitsquare.gui.main.funds.FundsView;
import io.bitsquare.gui.main.funds.transactions.TransactionsView;
@ -46,7 +47,7 @@ public class BuyerStep5View extends TradeStepView {
protected Label btcTradeAmountLabel;
protected Label fiatTradeAmountLabel;
private TextField withdrawAddressTextField;
private InputTextField withdrawAddressTextField;
private Button withdrawButton;
@ -122,12 +123,13 @@ public class BuyerStep5View extends TradeStepView {
withdrawAddressTextField.setText("mi8k5f9L972VgDaT4LgjAhriC9hHEPL7EW");
} else {
String key = "tradeCompleted" + trade.getId();
if (preferences.showAgain(key))
if (preferences.showAgain(key)) {
preferences.dontShowAgain(key, true);
new Notification().headLine("Trade completed")
.notification("You can withdraw your funds now to your external Bitcoin wallet.")
.onClose(() -> preferences.dontShowAgain(key, true))
.autoClose()
.show();
}
}
}
@ -168,7 +170,9 @@ public class BuyerStep5View extends TradeStepView {
new Popup().warning("Your funds have already been withdrawn.\nPlease check the transaction history.").show();
model.dataModel.tradeManager.addTradeToClosedTrades(trade);
} else {
if (Restrictions.isAboveFixedTxFeeAndDust(senderAmount) && !toAddresses.isEmpty()) {
if (toAddresses.isEmpty()) {
validateWithdrawAddress();
} else if (Restrictions.isAboveFixedTxFeeAndDust(senderAmount)) {
try {
Coin requiredFee = walletService.getRequiredFee(fromAddresses, toAddresses, senderAmount, null);
Coin receiverAmount = senderAmount.subtract(requiredFee);
@ -194,11 +198,9 @@ public class BuyerStep5View extends TradeStepView {
} else {
doWithdrawal();
}
}
} catch (AddressFormatException e) {
e.printStackTrace();
log.error(e.getMessage());
validateWithdrawAddress();
}
} else {
new Popup()
@ -208,6 +210,12 @@ public class BuyerStep5View extends TradeStepView {
}
}
private void validateWithdrawAddress() {
withdrawAddressTextField.setValidator(model.btcAddressValidator);
withdrawAddressTextField.requestFocus();
withdrawButton.requestFocus();
}
protected String getBtcTradeAmountLabel() {
return "You have bought:";
}

View File

@ -17,7 +17,6 @@
package io.bitsquare.gui.main.portfolio.pendingtrades.steps.seller;
import io.bitsquare.app.BitsquareApp;
import io.bitsquare.common.util.Tuple3;
import io.bitsquare.gui.components.TextFieldWithCopyIcon;
import io.bitsquare.gui.components.TitledGroupBg;
@ -86,9 +85,9 @@ public class SellerStep3View extends TradeStepView {
"The reference text of the transaction is: \"" + trade.getShortId() + "\"";
}
if (preferences.showAgain(key)) {
preferences.dontShowAgain(key, true);
new Popup().headLine("Attention required for trade with ID " + trade.getShortId())
.instruction(message)
.onClose(() -> preferences.dontShowAgain(key, true))
.show();
}
@ -228,7 +227,7 @@ public class SellerStep3View extends TradeStepView {
if (model.p2PService.isBootstrapped()) {
Preferences preferences = model.dataModel.preferences;
String key = "confirmPaymentReceived";
if (preferences.showAgain(key) && !BitsquareApp.DEV_MODE) {
if (preferences.showAgain(key)) {
new Popup()
.headLine("Confirm that you have received the payment")
.confirmation("Have you received the " + model.dataModel.getCurrencyCode() + " payment from your trading partner?\n\n" +