Fine tune trade process

This commit is contained in:
Manfred Karrer 2014-09-27 01:39:55 +02:00
parent 026a3e4b93
commit 14b452efc3
23 changed files with 191 additions and 111 deletions

View file

@ -92,6 +92,7 @@ lower gradient color on tab: dddddd
#nav-balance-label {
-fx-font-weight: bold;
-fx-alignment: center;
-fx-background-color: #dddddd;
}
#nav-alert-label {
-fx-font-weight: bold;
@ -172,7 +173,7 @@ textfield */
}
.table-view .column-header .label {
-fx-alignment-alignment: center;
-fx-alignment: center;
}
.table-view .focus {

View file

@ -67,11 +67,12 @@ public class AddressTextField extends AnchorPane {
///////////////////////////////////////////////////////////////////////////////////////////
public AddressTextField() {
TextField addressLabel = new TextField();
addressLabel.setId("address-text-field");
addressLabel.setEditable(false);
addressLabel.textProperty().bind(address);
addressLabel.setOnMouseClicked(mouseEvent -> {
TextField textField = new TextField();
textField.setId("address-text-field");
textField.setEditable(false);
textField.textProperty().bind(address);
Tooltip.install(textField, new Tooltip("Open your default Bitcoin wallet with that address."));
textField.setOnMouseClicked(mouseEvent -> {
try {
Desktop.getDesktop().browse(URI.create(getBitcoinURI()));
} catch (IOException e) {
@ -80,8 +81,8 @@ public class AddressTextField extends AnchorPane {
"Perhaps you don't have one installed?");
}
});
addressLabel.focusTraversableProperty().set(focusTraversableProperty().get());
focusedProperty().addListener((ov, oldValue, newValue) -> addressLabel.requestFocus());
textField.focusTraversableProperty().set(focusTraversableProperty().get());
focusedProperty().addListener((ov, oldValue, newValue) -> textField.requestFocus());
Label copyIcon = new Label();
copyIcon.setLayoutY(3);
@ -136,10 +137,10 @@ public class AddressTextField extends AnchorPane {
AnchorPane.setRightAnchor(qrCode, 5.0);
AnchorPane.setRightAnchor(copyIcon, 30.0);
AnchorPane.setRightAnchor(addressLabel, 55.0);
AnchorPane.setLeftAnchor(addressLabel, 0.0);
AnchorPane.setRightAnchor(textField, 55.0);
AnchorPane.setLeftAnchor(textField, 0.0);
getChildren().addAll(addressLabel, copyIcon, qrCode);
getChildren().addAll(textField, copyIcon, qrCode);
}

View file

@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
public class BalanceTextField extends AnchorPane {
private static final Logger log = LoggerFactory.getLogger(BalanceTextField.class);
private final TextField balanceTextField;
private final TextField textField;
private final Tooltip progressIndicatorTooltip;
private final ConfidenceProgressIndicator progressIndicator;
@ -52,9 +52,9 @@ public class BalanceTextField extends AnchorPane {
///////////////////////////////////////////////////////////////////////////////////////////
public BalanceTextField() {
balanceTextField = new TextField();
balanceTextField.setFocusTraversable(false);
balanceTextField.setEditable(false);
textField = new TextField();
textField.setFocusTraversable(false);
textField.setEditable(false);
progressIndicator = new ConfidenceProgressIndicator();
progressIndicator.setFocusTraversable(false);
@ -68,10 +68,10 @@ public class BalanceTextField extends AnchorPane {
Tooltip.install(progressIndicator, progressIndicatorTooltip);
AnchorPane.setRightAnchor(progressIndicator, 0.0);
AnchorPane.setRightAnchor(balanceTextField, 55.0);
AnchorPane.setLeftAnchor(balanceTextField, 0.0);
AnchorPane.setRightAnchor(textField, 55.0);
AnchorPane.setLeftAnchor(textField, 0.0);
getChildren().addAll(balanceTextField, progressIndicator);
getChildren().addAll(textField, progressIndicator);
}
public void setup(WalletFacade walletFacade, Address address, BSFormatter formatter) {
@ -123,17 +123,17 @@ public class BalanceTextField extends AnchorPane {
if (progressIndicator.getProgress() != 0) {
progressIndicator.setVisible(true);
AnchorPane.setRightAnchor(progressIndicator, 0.0);
AnchorPane.setRightAnchor(balanceTextField, 35.0);
AnchorPane.setRightAnchor(textField, 35.0);
}
}
}
private void updateBalance(Coin balance) {
balanceTextField.setText(formatter.formatCoinWithCode(balance));
textField.setText(formatter.formatCoinWithCode(balance));
if (balance.isPositive())
balanceTextField.setEffect(fundedEffect);
textField.setEffect(fundedEffect);
else
balanceTextField.setEffect(notFundedEffect);
textField.setEffect(notFundedEffect);
}
}

View file

@ -44,7 +44,7 @@ import org.slf4j.LoggerFactory;
public class TxIdTextField extends AnchorPane {
private static final Logger log = LoggerFactory.getLogger(TxIdTextField.class);
private final TextField txIdLabel;
private final TextField textField;
private final Tooltip progressIndicatorTooltip;
private final ConfidenceProgressIndicator progressIndicator;
private final Label copyIcon;
@ -73,20 +73,21 @@ public class TxIdTextField extends AnchorPane {
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
AnchorPane.setRightAnchor(copyIcon, 30.0);
txIdLabel = new TextField();
txIdLabel.setId("address-text-field");
txIdLabel.setEditable(false);
AnchorPane.setRightAnchor(txIdLabel, 55.0);
AnchorPane.setLeftAnchor(txIdLabel, 0.0);
txIdLabel.focusTraversableProperty().set(focusTraversableProperty().get());
focusedProperty().addListener((ov, oldValue, newValue) -> txIdLabel.requestFocus());
textField = new TextField();
textField.setId("address-text-field");
textField.setEditable(false);
Tooltip.install(textField, new Tooltip("Open a blockchain explorer with that transactions ID"));
AnchorPane.setRightAnchor(textField, 55.0);
AnchorPane.setLeftAnchor(textField, 0.0);
textField.focusTraversableProperty().set(focusTraversableProperty().get());
focusedProperty().addListener((ov, oldValue, newValue) -> textField.requestFocus());
getChildren().addAll(txIdLabel, copyIcon, progressIndicator);
getChildren().addAll(textField, copyIcon, progressIndicator);
}
public void setup(WalletFacade walletFacade, String txID) {
txIdLabel.setText(txID);
txIdLabel.setOnMouseClicked(mouseEvent -> {
textField.setText(txID);
textField.setOnMouseClicked(mouseEvent -> {
try {
Desktop.getDesktop().browse(URI.create("https://blockchain.info/address/" + txID));
} catch (IOException e) {

View file

@ -214,6 +214,7 @@ public class MainViewCB extends ViewCB<MainPM> {
numPendingTradesLabel.setText(String.valueOf(numPendingTrades));
}
log.trace("openInfoNotification " + BitSquare.getAppName());
SystemNotification.openInfoNotification(BitSquare.getAppName(), "You got a new trade message.");
}
else {
@ -225,8 +226,11 @@ public class MainViewCB extends ViewCB<MainPM> {
private void onMainNavigationAdded() {
Profiler.printMsgWithTime("MainController.ondMainNavigationAdded");
presentationModel.numPendingTrades.addListener((ov, olaValue, newValue) -> applyPendingTradesInfoIcon((int)
newValue));
presentationModel.numPendingTrades.addListener((ov, oldValue, newValue) ->
{
if ((int) newValue > (int) oldValue)
applyPendingTradesInfoIcon((int) newValue);
});
applyPendingTradesInfoIcon(presentationModel.numPendingTrades.get());
navigation.navigateToLastStoredItem();
onContentAdded();

View file

@ -26,7 +26,7 @@
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
<TableView fx:id="tableView" VBox.vgrow="ALWAYS">
<TableView fx:id="table" VBox.vgrow="ALWAYS">
<columns>
<TableColumn text="Date" fx:id="dateColumn" minWidth="100" sortable="false">
<cellValueFactory>

View file

@ -48,7 +48,7 @@ public class TransactionsViewCB extends CachedViewCB {
private BSFormatter formatter;
private ObservableList<TransactionsListItem> transactionsListItems;
@FXML TableView<TransactionsListItem> tableView;
@FXML TableView<TransactionsListItem> table;
@FXML TableColumn<TransactionsListItem, TransactionsListItem> dateColumn, addressColumn, amountColumn, typeColumn,
confidenceColumn;
@ -72,7 +72,8 @@ public class TransactionsViewCB extends CachedViewCB {
public void initialize(URL url, ResourceBundle rb) {
super.initialize(url, rb);
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
table.setPlaceholder(new Label("No transactions available"));
setAddressColumnCellFactory();
setConfidenceColumnCellFactory();
@ -95,7 +96,7 @@ public class TransactionsViewCB extends CachedViewCB {
transactionsListItems.addAll(transactions.stream().map(transaction ->
new TransactionsListItem(transaction, walletFacade, formatter)).collect(Collectors.toList()));
tableView.setItems(transactionsListItems);
table.setItems(transactionsListItems);
}
@SuppressWarnings("EmptyMethod")
@ -129,7 +130,7 @@ public class TransactionsViewCB extends CachedViewCB {
public TableCell<TransactionsListItem, TransactionsListItem> call(TableColumn<TransactionsListItem,
TransactionsListItem> column) {
return new TableCell<TransactionsListItem, TransactionsListItem>() {
Hyperlink hyperlink;
private Hyperlink hyperlink;
@Override
public void updateItem(final TransactionsListItem item, boolean empty) {

View file

@ -27,7 +27,7 @@
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
<TableView fx:id="tableView" VBox.vgrow="ALWAYS">
<TableView fx:id="table" VBox.vgrow="ALWAYS">
<columns>
<TableColumn text="Label" fx:id="labelColumn" minWidth="100" sortable="false"/>
<TableColumn text="Address" fx:id="addressColumn" minWidth="240" sortable="false">

View file

@ -67,7 +67,7 @@ public class WithdrawalViewCB extends CachedViewCB {
private BSFormatter formatter;
private ObservableList<WithdrawalListItem> addressList;
@FXML TableView<WithdrawalListItem> tableView;
@FXML TableView<WithdrawalListItem> table;
@FXML TableColumn<WithdrawalListItem, WithdrawalListItem> labelColumn, addressColumn, balanceColumn, copyColumn,
confidenceColumn;
@FXML Button addNewAddressButton;
@ -90,7 +90,8 @@ public class WithdrawalViewCB extends CachedViewCB {
@Override
public void initialize(URL url, ResourceBundle rb) {
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
table.setPlaceholder(new Label("No funded wallets for withdrawal available"));
setLabelColumnCellFactory();
setBalanceColumnCellFactory();
@ -112,7 +113,7 @@ public class WithdrawalViewCB extends CachedViewCB {
public void activate() {
super.activate();
tableView.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
table.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
if (newValue != null) {
if (Coin.ZERO.compareTo(newValue.getBalance()) <= 0) {
@ -134,7 +135,7 @@ public class WithdrawalViewCB extends CachedViewCB {
addressList.addAll(addressEntryList.stream().map(anAddressEntryList ->
new WithdrawalListItem(anAddressEntryList, walletFacade, formatter)).collect(Collectors.toList()));
tableView.setItems(addressList);
table.setItems(addressList);
}
@SuppressWarnings("EmptyMethod")
@ -220,7 +221,7 @@ public class WithdrawalViewCB extends CachedViewCB {
WithdrawalListItem> column) {
return new TableCell<WithdrawalListItem, WithdrawalListItem>() {
Hyperlink hyperlink;
private Hyperlink hyperlink;
@Override
public void updateItem(final WithdrawalListItem item, boolean empty) {

View file

@ -65,6 +65,7 @@ public class ClosedTradesViewCB extends CachedViewCB<ClosedTradesPM> {
setDateColumnCellFactory();
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
table.setPlaceholder(new Label("No closed trades available"));
super.initialize(url, rb);
}
@ -113,7 +114,7 @@ public class ClosedTradesViewCB extends CachedViewCB<ClosedTradesPM> {
public TableCell<ClosedTradesListItem, ClosedTradesListItem> call(TableColumn<ClosedTradesListItem,
ClosedTradesListItem> column) {
return new TableCell<ClosedTradesListItem, ClosedTradesListItem>() {
Hyperlink hyperlink;
private Hyperlink hyperlink;
@Override
public void updateItem(final ClosedTradesListItem item, boolean empty) {
@ -121,6 +122,7 @@ public class ClosedTradesViewCB extends CachedViewCB<ClosedTradesPM> {
if (item != null && !empty) {
hyperlink = new Hyperlink(presentationModel.getTradeId(item));
hyperlink.setId("id-link");
Tooltip.install(hyperlink, new Tooltip(presentationModel.getTradeId(item)));
hyperlink.setOnAction(event -> openOfferDetails(item));
setGraphic(hyperlink);

View file

@ -67,6 +67,7 @@ public class OffersViewCB extends CachedViewCB<OffersPM> {
setRemoveColumnCellFactory();
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
table.setPlaceholder(new Label("No open offers available"));
super.initialize(url, rb);
}
@ -118,7 +119,7 @@ public class OffersViewCB extends CachedViewCB<OffersPM> {
public TableCell<OfferListItem, OfferListItem> call(TableColumn<OfferListItem,
OfferListItem> column) {
return new TableCell<OfferListItem, OfferListItem>() {
Hyperlink hyperlink;
private Hyperlink hyperlink;
@Override
public void updateItem(final OfferListItem item, boolean empty) {
@ -126,6 +127,7 @@ public class OffersViewCB extends CachedViewCB<OffersPM> {
if (item != null && !empty) {
hyperlink = new Hyperlink(presentationModel.getTradeId(item));
hyperlink.setId("id-link");
Tooltip.install(hyperlink, new Tooltip(presentationModel.getTradeId(item)));
hyperlink.setOnAction(event -> openOfferDetails(item));
setGraphic(hyperlink);

View file

@ -181,7 +181,6 @@ class PendingTradesModel extends UIModel {
if (closedTrade != null) {
list.removeIf(e -> e.getTrade().getId().equals(closedTrade.getId()));
closedTrade = null;
}
}
else {
@ -201,7 +200,6 @@ class PendingTradesModel extends UIModel {
void closeSummary() {
if (closedTrade != null) {
list.removeIf(e -> e.getTrade().getId().equals(closedTrade.getId()));
closedTrade = null;
}
}
@ -234,6 +232,9 @@ class PendingTradesModel extends UIModel {
return selectedItem;
}
String getCurrencyCode() {
return selectedItem.getTrade().getOffer().getCurrency().getCurrencyCode();
}
///////////////////////////////////////////////////////////////////////////////////////////
// Private

View file

@ -151,6 +151,10 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
return model.getSelectedItem();
}
String getCurrencyCode() {
return model.getCurrencyCode();
}
// columns
String getTradeId(PendingTradesListItem item) {
return item.getTrade().getId();
@ -169,7 +173,15 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
}
String getDirectionLabel(PendingTradesListItem item) {
return (item != null) ? formatter.formatDirection(item.getTrade().getOffer().getMirroredDirection()) : "";
if (item != null) {
if (model.isOfferer())
return formatter.formatDirection(item.getTrade().getOffer().getDirection()) + " Bitcoin";
else
return formatter.formatDirection(item.getTrade().getOffer().getMirroredDirection()) + " Bitcoin";
}
else {
return "";
}
}
String getDate(PendingTradesListItem item) {

View file

@ -164,7 +164,8 @@
<InfoDisplay fx:id="summaryInfoDisplay" onAction="#onOpenSummaryHelp" rowIndex="9" gridPane="$root"
visible="false"/>
<Button fx:id="closeSummaryButton" text="Close summary" onAction="#onCloseSummary" GridPane.rowIndex="10"
<Button fx:id="openWithdrawalButton" text="Open withdrawal screen" onAction="#onOpenWithdrawal"
GridPane.rowIndex="10"
GridPane.columnIndex="1" defaultButton="true" visible="false">
<GridPane.margin>
<Insets top="15"/>
@ -188,7 +189,6 @@
<RowConstraints/>
<RowConstraints/>
<RowConstraints/>
<RowConstraints/>
</rowConstraints>
</GridPane>

View file

@ -18,6 +18,7 @@
package io.bitsquare.gui.main.orders.pending;
import io.bitsquare.gui.CachedViewCB;
import io.bitsquare.gui.Navigation;
import io.bitsquare.gui.components.InfoDisplay;
import io.bitsquare.gui.components.TextFieldWithCopyIcon;
import io.bitsquare.gui.components.TitledGroupBg;
@ -26,6 +27,7 @@ import io.bitsquare.gui.components.processbar.ProcessStepBar;
import io.bitsquare.gui.components.processbar.ProcessStepItem;
import io.bitsquare.gui.main.help.Help;
import io.bitsquare.gui.main.help.HelpId;
import io.bitsquare.locale.BSResources;
import java.net.URL;
@ -35,6 +37,7 @@ import java.util.ResourceBundle;
import javax.inject.Inject;
import javafx.application.Platform;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.beans.value.ChangeListener;
import javafx.collections.ListChangeListener;
@ -63,11 +66,12 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
collateralTextField;
@FXML TxIdTextField txIdTextField;
@FXML InfoDisplay infoDisplay, paymentsInfoDisplay, summaryInfoDisplay;
@FXML Button confirmPaymentReceiptButton, paymentsButton, closeSummaryButton;
@FXML Button confirmPaymentReceiptButton, paymentsButton, openWithdrawalButton;
@FXML TextFieldWithCopyIcon holderNameTextField, secondaryIdTextField, primaryIdTextField;
@FXML TableView<PendingTradesListItem> table;
@FXML TableColumn<PendingTradesListItem, PendingTradesListItem> priceColumn, amountColumn, volumeColumn,
directionColumn, dateColumn, tradeIdColumn, selectColumn;
private Navigation navigation;
///////////////////////////////////////////////////////////////////////////////////////////
@ -75,8 +79,10 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
PendingTradesViewCB(PendingTradesPM presentationModel) {
PendingTradesViewCB(PendingTradesPM presentationModel, Navigation navigation) {
super(presentationModel);
this.navigation = navigation;
}
@ -95,6 +101,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
setSelectColumnCellFactory();
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
table.setPlaceholder(new Label("No pending trades available"));
txIdChangeListener = (ov, oldValue, newValue) ->
txIdTextField.setup(presentationModel.getWalletFacade(), newValue);
@ -176,9 +183,12 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
}
@FXML
void onCloseSummary() {
presentationModel.closeSummary();
void onOpenWithdrawal() {
setSummaryControlsVisible(false);
presentationModel.closeSummary();
Platform.runLater(() ->
navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.FUNDS, Navigation.Item.WITHDRAWAL));
}
@FXML
@ -258,43 +268,58 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
switch (state) {
case OFFERER_BUYER_WAIT_TX_CONF:
processBar.setSelectedIndex(0);
statusTextField.setText("Deposit transaction is published. Waiting " +
"for at least 1 confirmation");
infoDisplay.setText("Deposit transaction has bee published. You need to wait for at least one " +
"block chain confirmation. After that you need to make the payments transfer.");
statusTextField.setText("Deposit transaction has been published. You need to wait for at least " +
"one block chain confirmation.");
infoDisplay.setText("The Bitcoin buyer needs to wait for at least one block chain confirmation to" +
" be sure that the deposit funding has not been double spent. For higher trade volumes we" +
" recommend to wait up to 6 confirmations.");
infoDisplay.layout();
break;
case OFFERER_BUYER_START_PAYMENT:
processBar.setSelectedIndex(1);
setPaymentsControlsVisible(true);
statusTextField.setText("Deposit transaction has at least 1 confirmation. Start payment.");
infoDisplay.setText("Deposit transaction has at least one blockchain confirmation. You need to " +
"start the payment.");
statusTextField.setText("Deposit transaction has at least one block chain confirmation. " +
"Please start now the payment.");
infoDisplay.setText("You are now safe to start the payment. You can wait for up to 6 block chain " +
"confirmations if you want more security.");
infoDisplay.layout();
paymentMethodTextField.setText(presentationModel.getPaymentMethod());
holderNameTextField.setText(presentationModel.getHolderName());
primaryIdTextField.setText(presentationModel.getPrimaryId());
secondaryIdTextField.setText(presentationModel.getSecondaryId());
paymentsInfoDisplay.setText("Copy and paste the payments accounts data to your payments " +
"accounts web page and transfer the payment to the other trader. When the transfer is " +
"done confirm it with the 'Payment started' button.");
paymentsInfoDisplay.setText(BSResources.get("Copy and paste the payment account data to your " +
"internet banking web page and transfer the {0} amount to the other traders " +
"payment account. When the transfer is completed inform the other trader by " +
"clicking the button below.",
presentationModel.getCurrencyCode()));
paymentsInfoDisplay.layout();
break;
case OFFERER_BUYER_WAIT_CONFIRM_PAYMENT_RECEIVED:
processBar.setSelectedIndex(2);
statusTextField.setText("Waiting until the other trader has received your payment.");
infoDisplay.setText("Waiting until the other trader has confirmed that he has received your " +
"payment.");
statusTextField.setText(BSResources.get("Waiting for the Bitcoin sellers confirmation " +
"that the {0} payment has arrived.",
presentationModel.getCurrencyCode()));
infoDisplay.setText(BSResources.get("When the confirmation that the {0} payment arrived at the " +
"Bitcoin sellers payment account, the payout transaction will be published.",
presentationModel.getCurrencyCode()));
infoDisplay.layout();
break;
case OFFERER_BUYER_COMPLETED:
processBar.setSelectedIndex(3);
setSummaryControlsVisible(true);
statusTextField.setText("Trade has successfully completed.");
infoDisplay.setText("Trade has successfully completed. You can find the details to that trade" +
" in the closed trades section.");
statusTextField.setText("Congratulations! Trade has successfully completed.");
infoDisplay.setText("The trade is now completed and you can withdraw your Bitcoin to any external" +
"wallet. To protect your privacy you should take care that your trades are not merged " +
"in " +
"that external wallet. For more information about privacy see our help pages.");
infoDisplay.layout();
btcLabel.setText("You have bought:");
fiatLabel.setText("You have paid:");
@ -302,7 +327,9 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
fiatTextField.setText(presentationModel.getFiatVolume());
feesTextField.setText(presentationModel.getTotalFees());
collateralTextField.setText(presentationModel.getCollateral());
summaryInfoDisplay.setText("You can open that summary any time in the closed orders section.");
summaryInfoDisplay.setText("Your trade bond has been refunded to you. " +
"You can review the details to that trade any time in the closed trades section.");
summaryInfoDisplay.layout();
break;
}
}
@ -321,28 +348,41 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
case TAKER_SELLER_WAIT_TX_CONF:
processBar.setSelectedIndex(0);
statusTextField.setText("Deposit transaction is published. Waiting for at least 1 confirmation");
infoDisplay.setText("Deposit transaction has bee published. He needs to wait for at least one " +
"blockchain confirmation.");
statusTextField.setText("Deposit transaction has been published. " +
"The Bitcoin buyer need to wait for at least one block chain confirmation.");
infoDisplay.setText(BSResources.get("The Bitcoin buyer needs to wait for at least one " +
"block chain confirmation before starting the {0} payment. " +
"That is needed to assure that the deposit input funding has not been " +
"double-spent. " +
"For higher trade volumes it is recommended to wait up to 6 confirmations.",
presentationModel.getCurrencyCode()));
infoDisplay.layout();
break;
case TAKER_SELLER_WAIT_PAYMENT_STARTED:
processBar.setSelectedIndex(1);
statusTextField.setText("Deposit transaction has at least 1 confirmation. Waiting that other " +
"trader starts payment.");
infoDisplay.setText("Deposit transaction has at least one blockchain " +
"confirmation. The other trader need to start the payment. You will get informed when " +
"that been done.");
statusTextField.setText(BSResources.get("Deposit transaction has at least one block chain " +
"confirmation. " +
"Waiting that other trader starts the {0} payment.",
presentationModel.getCurrencyCode()));
infoDisplay.setText(BSResources.get("You will get informed when the other trader has indicated " +
"the {0} payment has been started.",
presentationModel.getCurrencyCode()));
infoDisplay.layout();
break;
case TAKER_SELLER_CONFIRM_RECEIVE_PAYMENT:
processBar.setSelectedIndex(2);
confirmPaymentReceiptButton.setVisible(true);
statusTextField.setText("Payment is on the way. Check your payments account and confirm when you " +
"have received the payment.");
infoDisplay.setText("The other trader has started the payment. You need to check your payments " +
"account and confirm the payment when the money has arrived there.");
statusTextField.setText(BSResources.get("The Bitcoin buyer has started the {0} payment." +
"Check your payments account and confirm when you have received the payment.",
presentationModel.getCurrencyCode()));
infoDisplay.setText(BSResources.get("It is important that you confirm when you have received the " +
"{0} payment as this will publish the payout transaction where you get returned " +
"your trade bond and the Bitcoin buyer receive the Bitcoin amount you sold.",
presentationModel.getCurrencyCode()));
infoDisplay.layout();
break;
case TAKER_SELLER_COMPLETED:
@ -350,9 +390,13 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
setSummaryControlsVisible(true);
statusTextField.setText("Trade has successfully completed.");
infoDisplay.setText("Trade has successfully completed. You can find the details to that trade" +
" in the closed trades section.");
statusTextField.setText("Congratulations! Trade has successfully completed.");
infoDisplay.setText("The trade is now completed and you can withdraw the refunded Bitcoin from " +
"the trade bond to any external wallet. " +
"To protect your privacy you should take care that your coins are not merged in " +
"that external wallet. For more information about privacy see our help pages.");
infoDisplay.layout();
btcLabel.setText("You have sold:");
fiatLabel.setText("You have received:");
@ -360,7 +404,9 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
fiatTextField.setText(presentationModel.getFiatVolume());
feesTextField.setText(presentationModel.getTotalFees());
collateralTextField.setText(presentationModel.getCollateral());
summaryInfoDisplay.setText("You can open that summary any time in the closed orders section.");
summaryInfoDisplay.setText("Your trade bond has been refunded to you. " +
"You can review the details to that trade any time in the closed trades section.");
summaryInfoDisplay.layout();
break;
}
}
@ -402,7 +448,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
collateralLabel.setVisible(visible);
collateralTextField.setVisible(visible);
summaryInfoDisplay.setVisible(visible);
closeSummaryButton.setVisible(visible);
openWithdrawalButton.setVisible(visible);
}
@ -421,7 +467,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
(TableColumn<PendingTradesListItem,
PendingTradesListItem> column) {
return new TableCell<PendingTradesListItem, PendingTradesListItem>() {
Hyperlink hyperlink;
private Hyperlink hyperlink;
@Override
public void updateItem(final PendingTradesListItem item, boolean empty) {
@ -429,6 +475,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
if (item != null && !empty) {
hyperlink = new Hyperlink(presentationModel.getTradeId(item));
hyperlink.setId("id-link");
Tooltip.install(hyperlink, new Tooltip(presentationModel.getTradeId(item)));
hyperlink.setOnAction(event -> openOfferDetails(item));
setGraphic(hyperlink);

View file

@ -172,7 +172,7 @@ public class TradeViewCB extends CachedViewCB implements TradeNavigator {
new ViewLoader(getClass().getResource(navigationItem.getFxmlUrl()), false);
try {
final Parent view = orderBookLoader.load();
final Tab tab = new Tab("Orderbook");
final Tab tab = new Tab(direction == Direction.BUY ? "Buy Bitcoin" : "Sell Bitcoin");
tab.setClosable(false);
tab.setContent(view);
tabPane.getTabs().add(tab);

View file

@ -31,7 +31,7 @@
<Insets bottom="20.0" left="25.0" top="30.0" right="25"/>
</padding>
<TitledGroupBg text="Order book filter" GridPane.rowIndex="0" GridPane.columnIndex="0"
<TitledGroupBg text="Filter offers" GridPane.rowIndex="0" GridPane.columnIndex="0"
GridPane.rowSpan="5" GridPane.columnSpan="2"/>
<Label text="Filter by amount or price:" GridPane.rowIndex="0" GridPane.valignment="TOP">
@ -98,12 +98,12 @@
<Label fx:id="extendedButton1Label" text="Payments account countries:" GridPane.columnIndex="0"
GridPane.rowIndex="3" visible="false" managed="false"/>
<Button fx:id="extendedButton1" text="Open filter" GridPane.columnIndex="1"
<Button fx:id="extendedButton1" text="Open countries filter" GridPane.columnIndex="1"
GridPane.rowIndex="3" visible="false" managed="false"/>
<Label fx:id="extendedButton2Label" text="Payments account methods:" GridPane.columnIndex="0"
GridPane.rowIndex="4" visible="false" managed="false"/>
<Button fx:id="extendedButton2" text="Open filter" GridPane.columnIndex="1"
<Button fx:id="extendedButton2" text="Open payment methods filter" GridPane.columnIndex="1"
GridPane.rowIndex="4" visible="false" managed="false">
<GridPane.margin>
<Insets bottom="-5"/>
@ -119,10 +119,10 @@
</GridPane.margin>
</HBox>
<TitledSeparator text="Order book for buying Bitcoin" GridPane.rowIndex="6" GridPane.columnIndex="0"
<TitledSeparator text="Offers" GridPane.rowIndex="6" GridPane.columnIndex="0"
GridPane.columnSpan="2"/>
<TableView fx:id="orderBookTable" GridPane.rowIndex="6" GridPane.columnIndex="0" GridPane.columnSpan="2"
<TableView fx:id="table" GridPane.rowIndex="6" GridPane.columnIndex="0" GridPane.columnSpan="2"
prefHeight="1500">
<GridPane.margin>
<Insets top="10.0" left="-10" right="-10" bottom="-15"/>

View file

@ -80,7 +80,7 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
@FXML Label amountBtcLabel, priceDescriptionLabel, priceFiatLabel, volumeDescriptionLabel,
volumeFiatLabel, extendedButton1Label, extendedButton2Label, extendedCheckBoxLabel;
@FXML InputTextField volumeTextField, amountTextField, priceTextField;
@FXML TableView<OrderBookListItem> orderBookTable;
@FXML TableView<OrderBookListItem> table;
@FXML Button createOfferButton, showAdvancedSettingsButton, extendedButton1, extendedButton2;
@FXML TableColumn<OrderBookListItem, OrderBookListItem> priceColumn, amountColumn, volumeColumn,
directionColumn, countryColumn, bankAccountTypeColumn;
@ -118,8 +118,11 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
setBankAccountTypeColumnCellFactory();
setDirectionColumnCellFactory();
orderBookTable.getSortOrder().add(priceColumn);
orderBookTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
table.getSortOrder().add(priceColumn);
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
Label placeholder = new Label("No offers available.\nTry to change your filter or account settings.");
placeholder.setWrapText(true);
table.setPlaceholder(placeholder);
setupBindings();
setupValidators();
@ -138,11 +141,11 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
// setOrderBookInfo has been called before
SortedList<OrderBookListItem> offerList = presentationModel.getOfferList();
orderBookTable.setItems(offerList);
offerList.comparatorProperty().bind(orderBookTable.comparatorProperty());
table.setItems(offerList);
offerList.comparatorProperty().bind(table.comparatorProperty());
priceColumn.setSortType((presentationModel.getDirection() == Direction.BUY) ?
TableColumn.SortType.ASCENDING : TableColumn.SortType.DESCENDING);
orderBookTable.sort();
table.sort();
}
@SuppressWarnings("EmptyMethod")
@ -255,7 +258,7 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
Navigation.Item.ACCOUNT_SETTINGS,
Navigation.Item.RESTRICTIONS);
else
orderBookTable.getSelectionModel().clearSelection();
table.getSelectionModel().clearSelection();
}
private void showDetailsScreen() {

View file

@ -251,6 +251,10 @@ class TakeOfferPM extends PresentationModel<TakeOfferModel> {
return fiatCode;
}
String getAmount() {
return formatter.formatCoinWithCode(model.amountAsCoin.get());
}
String getAmountRange() {
return amountRange;
}

View file

@ -112,7 +112,8 @@
</GridPane.margin>
<Label id="input-description-label" text="%takeOffer.amountPriceBox.amountRangeDescription"
prefWidth="170" textAlignment="CENTER"/>
<Label fx:id="amountRangeTextField" id="label-with-background" prefWidth="170" textAlignment="CENTER"/>
<Label fx:id="amountRangeTextField" id="label-with-background" prefWidth="170"
style=" -fx-alignment: center;"/>
</VBox>
<InfoDisplay gridPane="$gridPane" onAction="#onOpenGeneralHelp" rowIndex="2"

View file

@ -419,7 +419,7 @@ public class TakeOfferViewCB extends CachedViewCB<TakeOfferPM> {
addPayInfoEntry(infoGridPane, 0,
BSResources.get("takeOffer.fundsBox.amount"),
presentationModel.amount.get());
presentationModel.getAmount());
addPayInfoEntry(infoGridPane, 1,
presentationModel.getCollateralLabel(),
presentationModel.collateral.get());

View file

@ -522,8 +522,7 @@ public class MessageFacade implements MessageBroker {
final Object object = data.object();
Platform.runLater(() -> {
Long timeStamp = (Long) object;
log.trace("Get invalidationTimestamp from DHT was successful. TimeStamp=" +
timeStamp);
//log.trace("Get invalidationTimestamp from DHT was successful. TimeStamp=" + timeStamp);
invalidationTimestamp.set(timeStamp);
});
}

View file

@ -50,7 +50,7 @@ createOffer.fundsBox.totalsNeeded.prompt=Will be calculated from the Bitcoin amo
createOffer.fundsBox.address=Trade wallet address:
createOffer.fundsBox.balance=Trade wallet balance:
createOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those funds are reserved and will be used in the case that your offer gets executed. If you cancel your offer you can withdraw your funds from that trading wallet. The only payment which will be done now when placing the offer is the offer fee payment.
createOffer.fundsBox.collateral=Refundable collateral ({0}):
createOffer.fundsBox.collateral=Trade bond ({0}):
createOffer.fundsBox.offerFee=Offer fee:
createOffer.fundsBox.networkFee=Bitcoin network fee:
createOffer.fundsBox.total=Total:
@ -99,7 +99,7 @@ takeOffer.fundsBox.address=Trade wallet address:
takeOffer.fundsBox.balance=Trade wallet balance:
takeOffer.fundsBox.info=For every offer there is a dedicated trade wallet. You need to fund that trade wallet with the necessary Bitcoin amount. Those funds will be paid in to a locked deposit address. At the end of a successful trade you will get back your collateral and the Bitcoin amount you sold will be transferred to the buyer.
takeOffer.fundsBox.amount=Amount to sell:
takeOffer.fundsBox.collateral=Refundable collateral ({0}):
takeOffer.fundsBox.collateral=Trade bond ({0}):
takeOffer.fundsBox.offerFee=Offer fee:
takeOffer.fundsBox.networkFee=Bitcoin network fee:
takeOffer.fundsBox.total=Total: