Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add txId to proposal display #2519

Merged
merged 2 commits into from Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -55,6 +55,7 @@
import bisq.core.dao.state.model.governance.Vote;
import bisq.core.locale.CurrencyUtil;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;
import bisq.core.util.BsqFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.core.util.validation.UrlInputValidator;
Expand Down Expand Up @@ -107,6 +108,7 @@ public class ProposalDisplay {
@Nullable
private final ChangeParamValidator changeParamValidator;
private final Navigation navigation;
private final Preferences preferences;

@Nullable
private TextField proposalFeeTextField, comboBoxValueTextField, requiredBondForRoleTextField;
Expand Down Expand Up @@ -143,12 +145,13 @@ public class ProposalDisplay {
private VBox linkWithIconContainer, comboBoxValueContainer, myVoteBox, voteResultBox;

public ProposalDisplay(GridPane gridPane, BsqFormatter bsqFormatter, DaoFacade daoFacade,
@Nullable ChangeParamValidator changeParamValidator, Navigation navigation) {
@Nullable ChangeParamValidator changeParamValidator, Navigation navigation, @Nullable Preferences preferences) {
this.gridPane = gridPane;
this.bsqFormatter = bsqFormatter;
this.daoFacade = daoFacade;
this.changeParamValidator = changeParamValidator;
this.navigation = navigation;
this.preferences = preferences;

// focusOutListener = observable -> inputChangedListeners.forEach(Runnable::run);

Expand Down Expand Up @@ -489,7 +492,7 @@ public void applyProposalPayload(Proposal proposal) {
if (txHyperlinkWithIcon != null) {
txHyperlinkWithIcon.setText(proposal.getTxId());
txHyperlinkWithIcon.setOnAction(e ->
GUIUtil.openWebPage("https://explorer.bisq.network/testnet/tx.html?tx=" + proposal.getTxId()));
GUIUtil.openTxInBsqBlockExplorer(proposal.getTxId(), preferences));
}

if (proposal instanceof CompensationProposal) {
Expand Down
Expand Up @@ -432,7 +432,7 @@ private ProposalWithTransaction getProposalWithTransaction(ProposalType type)

private void addProposalDisplay() {
if (selectedProposalType != null) {
proposalDisplay = new ProposalDisplay(root, bsqFormatter, daoFacade, changeParamValidator, navigation);
proposalDisplay = new ProposalDisplay(root, bsqFormatter, daoFacade, changeParamValidator, navigation, null);

proposalDisplay.createAllFields(Res.get("dao.proposal.create.new"), alwaysVisibleGridRowIndex, Layout.GROUP_DISTANCE,
selectedProposalType, true);
Expand Down
Expand Up @@ -683,7 +683,7 @@ private void createProposalsTableView() {

private void createEmptyProposalDisplay() {
proposalDisplay = new ProposalDisplay(proposalDisplayGridPane, bsqFormatter, daoFacade,
changeParamValidator, navigation);
changeParamValidator, navigation, preferences);
proposalDisplayView = proposalDisplay.getView();
GridPane.setMargin(proposalDisplayView, new Insets(0, -10, 0, -10));
GridPane.setRowIndex(proposalDisplayView, ++gridRow);
Expand Down
Expand Up @@ -445,7 +445,7 @@ private void createProposalsTable() {
private ProposalDisplay createProposalDisplay(EvaluatedProposal evaluatedProposal, Ballot ballot) {
Proposal proposal = evaluatedProposal.getProposal();
ProposalDisplay proposalDisplay = new ProposalDisplay(new GridPane(), bsqFormatter,
daoFacade, null, navigation);
daoFacade, null, navigation, preferences);

ScrollPane proposalDisplayView = proposalDisplay.getView();
GridPane.setMargin(proposalDisplayView, new Insets(0, -10, -15, -10));
Expand Down