Don't use recursive parser. UI improvements

Don't use recursive parser but raw tx list from bitcoin core.
This commit is contained in:
Manfred Karrer 2018-07-16 18:57:20 +02:00
parent 198afcd6b6
commit e677c1a007
No known key found for this signature in database
GPG key ID: 401250966A6B2C46
5 changed files with 57 additions and 29 deletions

View file

@ -322,25 +322,29 @@ bg color of non edit textFields: fafafa
-fx-text-fill: -bs-red-soft;
}
.dao-tx-type-fee-icon,
.dao-tx-type-fee-icon:hover {
-fx-text-fill: #5ab9ea;
-fx-cursor: hand;
.dao-tx-type-trade-fee-icon,
.dao-tx-type-trade-fee-icon:hover {
-fx-text-fill: #689f43;
}
.dao-tx-type-unverified-icon,
.dao-tx-type-unverified-icon:hover {
-fx-text-fill: -bs-yellow;
-fx-text-fill: #ffac00;
}
.dao-tx-type-invalid-icon,
.dao-tx-type-invalid-icon:hover {
-fx-text-fill: -bs-error-red;
-fx-text-fill: #ffac00;
}
.dao-tx-type-default-icon,
.dao-tx-type-default-icon:hover {
-fx-text-fill: -bs-grey;
.dao-tx-type-self-icon,
.dao-tx-type-self-icon:hover {
-fx-text-fill: #818181;
}
.dao-tx-type-proposal-fee-icon,
.dao-tx-type-proposal-fee-icon:hover {
-fx-text-fill: #6c8b3b;
}
.dao-tx-type-genesis-icon,
@ -360,17 +364,27 @@ bg color of non edit textFields: fafafa
.dao-tx-type-vote-icon,
.dao-tx-type-vote-icon:hover {
-fx-text-fill: -bs-bg-blue1;
-fx-text-fill: #0a4576;
}
.dao-tx-type-vote-reveal-icon,
.dao-tx-type-vote-reveal-icon:hover {
-fx-text-fill: -bs-bg-green2;
-fx-text-fill: #4AC5FF;
}
.dao-tx-type-issuance-icon,
.dao-tx-type-issuance-icon:hover {
-fx-text-fill: -bs-green;
-fx-text-fill: #04a908;
}
.dao-tx-type-lockup-icon,
.dao-tx-type-lockup-icon:hover {
-fx-text-fill: #7f2c36;
}
.dao-tx-type-unlock-icon,
.dao-tx-type-unlock-icon:hover {
-fx-text-fill: #438e6c;
}
.dao-accepted-icon {

View file

@ -83,9 +83,9 @@ public class BondingView extends ActivatableViewAndModel {
dashboard = new MenuItem(navigation, toggleGroup, Res.get("shared.dashboard"),
BondingDashboardView.class, AwesomeIcon.DASHBOARD, baseNavPath);
lockupBSQ = new MenuItem(navigation, toggleGroup, Res.get("dao.bonding.menuItem.lockupBSQ"),
LockupView.class, AwesomeIcon.LIST_UL, baseNavPath);
LockupView.class, AwesomeIcon.LOCK, baseNavPath);
unlockBSQ = new MenuItem(navigation, toggleGroup, Res.get("dao.bonding.menuItem.unlockBSQ"),
UnlockView.class, AwesomeIcon.LIST_UL, baseNavPath);
UnlockView.class, AwesomeIcon.UNLOCK, baseNavPath);
leftVBox.getChildren().addAll(dashboard, lockupBSQ, unlockBSQ);
}

View file

@ -85,7 +85,7 @@ public class VotingView extends ActivatableViewAndModel {
activeBallots = new MenuItem(navigation, toggleGroup, Res.get("dao.voting.menuItem.activeBallots"),
ActiveBallotsView.class, AwesomeIcon.LIST_UL, baseNavPath);
closedBallots = new MenuItem(navigation, toggleGroup, Res.get("dao.voting.menuItem.closedBallots"),
ClosedBallotsView.class, AwesomeIcon.LIST_UL, baseNavPath);
ClosedBallotsView.class, AwesomeIcon.LIST_ALT, baseNavPath);
leftVBox.getChildren().addAll(dashboard, activeBallots, closedBallots);
}

View file

@ -28,11 +28,10 @@
AnchorPane.topAnchor="20"/>
<ScrollPane fx:id="scrollPane"
fitToWidth="true" hbarPolicy="NEVER"
fitToWidth="true" fitToHeight="true"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="270.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<AnchorPane fx:id="content" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"/>
<AnchorPane fx:id="content"/>
</ScrollPane>
</AnchorPane>

View file

@ -56,6 +56,7 @@ import javafx.scene.control.Tooltip;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.geometry.Insets;
@ -150,10 +151,12 @@ public class BsqTxView extends ActivatableView<GridPane, Void> implements BsqBal
VBox vBox = new VBox();
vBox.setSpacing(10);
GridPane.setVgrow(vBox, Priority.ALWAYS);
GridPane.setRowIndex(vBox, ++gridRow);
GridPane.setColumnSpan(vBox, 2);
GridPane.setMargin(vBox, new Insets(40, -10, 5, -10));
vBox.getChildren().addAll(tableView, hBox);
VBox.setVgrow(tableView, Priority.ALWAYS);
root.getChildren().add(vBox);
walletBsqTransactionsListener = change -> updateList();
@ -362,9 +365,10 @@ public class BsqTxView extends ActivatableView<GridPane, Void> implements BsqBal
if (field != null)
field.setOnAction(null);
if (txType == TxType.TRANSFER_BSQ) {
if (item.getAmount().isZero())
labelString = Res.get("funds.tx.direction.self");
if (txType == TxType.TRANSFER_BSQ &&
item.getAmount().isZero() &&
item.getTxType() != TxType.UNLOCK) {
labelString = Res.get("funds.tx.direction.self");
}
label = new AutoTooltipLabel(labelString);
@ -481,6 +485,9 @@ public class BsqTxView extends ActivatableView<GridPane, Void> implements BsqBal
boolean doRotate = false;
switch (txType) {
case UNDEFINED_TX_TYPE:
awesomeIcon = AwesomeIcon.REMOVE_CIRCLE;
style = "dao-tx-type-unverified-icon";
break;
case UNVERIFIED:
awesomeIcon = AwesomeIcon.QUESTION_SIGN;
style = "dao-tx-type-unverified-icon";
@ -495,8 +502,8 @@ public class BsqTxView extends ActivatableView<GridPane, Void> implements BsqBal
break;
case TRANSFER_BSQ:
if (item.getAmount().isZero()) {
awesomeIcon = AwesomeIcon.EXCHANGE;
style = "dao-tx-type-default-icon";
awesomeIcon = AwesomeIcon.RETWEET;
style = "dao-tx-type-self-icon";
} else {
awesomeIcon = item.isReceived() ? AwesomeIcon.SIGNIN : AwesomeIcon.SIGNOUT;
doRotate = item.isReceived();
@ -507,8 +514,8 @@ public class BsqTxView extends ActivatableView<GridPane, Void> implements BsqBal
}
break;
case PAY_TRADE_FEE:
awesomeIcon = AwesomeIcon.TICKET;
style = "dao-tx-type-default-icon";
awesomeIcon = AwesomeIcon.LEAF;
style = "dao-tx-type-trade-fee-icon";
break;
case PROPOSAL:
case COMPENSATION_REQUEST:
@ -521,18 +528,26 @@ public class BsqTxView extends ActivatableView<GridPane, Void> implements BsqBal
final String formattedDate = bsqFormatter.formatDateTime(new Date(blockTimeInSec * 1000));
toolTipText = Res.get("dao.tx.issuance.tooltip", formattedDate);
} else {
awesomeIcon = AwesomeIcon.FILE;
style = "dao-tx-type-fee-icon";
awesomeIcon = AwesomeIcon.SHARE;
style = "dao-tx-type-proposal-fee-icon";
}
break;
case BLIND_VOTE:
awesomeIcon = AwesomeIcon.THUMBS_UP;
awesomeIcon = AwesomeIcon.EYE_CLOSE;
style = "dao-tx-type-vote-icon";
break;
case VOTE_REVEAL:
awesomeIcon = AwesomeIcon.LIGHTBULB;
awesomeIcon = AwesomeIcon.EYE_OPEN;
style = "dao-tx-type-vote-reveal-icon";
break;
case LOCKUP:
awesomeIcon = AwesomeIcon.LOCK;
style = "dao-tx-type-lockup-icon";
break;
case UNLOCK:
awesomeIcon = AwesomeIcon.UNLOCK;
style = "dao-tx-type-unlock-icon";
break;
default:
awesomeIcon = AwesomeIcon.QUESTION_SIGN;
style = "dao-tx-type-unverified-icon";