mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 22:45:21 +01:00
Merge pull request #2638 from ripcurlx/improve-issuance-info-popup
Add information of Satoshis needed for coloring
This commit is contained in:
commit
b9ab0f1965
3 changed files with 42 additions and 9 deletions
|
@ -1854,6 +1854,13 @@ dao.feeTx.confirm.details={0} fee: {1}\n\
|
|||
Transaction size: {4} Kb\n\n\
|
||||
Are you sure you want to publish the {5} transaction?
|
||||
|
||||
dao.feeTx.issuanceProposal.confirm.details={0} fee: {1}\n\
|
||||
BTC needed for BSQ issuance: {2} ({3} Satoshis/BSQ)\n\
|
||||
On acceptance, the proposal fee will be deducted from the issued BSQ.\n\n\
|
||||
Mining fee: {4} ({5} Satoshis/byte)\n\
|
||||
Transaction size: {6} Kb\n\n\
|
||||
Are you sure you want to publish the {7} transaction?
|
||||
|
||||
dao.news.bisqDAO.title=THE BISQ DAO
|
||||
dao.news.bisqDAO.description=Just as the Bisq exchange is decentralized and censorship-resistant, so is its \
|
||||
governance model - and the Bisq DAO and BSQ token are the tools that make it possible.
|
||||
|
|
|
@ -35,6 +35,7 @@ import bisq.core.btc.wallet.BsqWalletService;
|
|||
import bisq.core.dao.DaoFacade;
|
||||
import bisq.core.dao.governance.bond.Bond;
|
||||
import bisq.core.dao.governance.param.Param;
|
||||
import bisq.core.dao.governance.proposal.IssuanceProposal;
|
||||
import bisq.core.dao.governance.proposal.ProposalType;
|
||||
import bisq.core.dao.governance.proposal.ProposalValidationException;
|
||||
import bisq.core.dao.governance.proposal.ProposalWithTransaction;
|
||||
|
@ -334,7 +335,11 @@ public class MakeProposalView extends ActivatableView<GridPane, Void> implements
|
|||
|
||||
private void showFeeInfoAndPublishMyProposal(Proposal proposal, Transaction transaction, Coin miningFee, int txSize, Coin fee) {
|
||||
if (!DevEnv.isDevMode()) {
|
||||
GUIUtil.showBsqFeeInfoPopup(fee, miningFee, txSize, bsqFormatter, btcFormatter,
|
||||
Coin btcForIssuance = null;
|
||||
|
||||
if (proposal instanceof IssuanceProposal) btcForIssuance = ((IssuanceProposal) proposal).getRequestedBsq();
|
||||
|
||||
GUIUtil.showBsqFeeInfoPopup(fee, miningFee, btcForIssuance, txSize, bsqFormatter, btcFormatter,
|
||||
Res.get("dao.proposal"), () -> doPublishMyProposal(proposal, transaction));
|
||||
} else {
|
||||
doPublishMyProposal(proposal, transaction);
|
||||
|
|
|
@ -849,23 +849,44 @@ public class GUIUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public static void showBsqFeeInfoPopup(Coin fee, Coin miningFee, int txSize, BsqFormatter bsqFormatter,
|
||||
public static void showBsqFeeInfoPopup(Coin fee, Coin miningFee, Coin btcForIssuance, int txSize, BsqFormatter bsqFormatter,
|
||||
BSFormatter btcFormatter, String type,
|
||||
Runnable actionHandler) {
|
||||
String confirmationMessage;
|
||||
|
||||
if (btcForIssuance != null) {
|
||||
confirmationMessage = Res.get("dao.feeTx.issuanceProposal.confirm.details",
|
||||
StringUtils.capitalize(type),
|
||||
bsqFormatter.formatCoinWithCode(fee),
|
||||
bsqFormatter.formatBTCWithCode(btcForIssuance),
|
||||
100,
|
||||
btcFormatter.formatCoinWithCode(miningFee),
|
||||
CoinUtil.getFeePerByte(miningFee, txSize),
|
||||
txSize / 1000d,
|
||||
type);
|
||||
} else {
|
||||
confirmationMessage = Res.get("dao.feeTx.confirm.details",
|
||||
StringUtils.capitalize(type),
|
||||
bsqFormatter.formatCoinWithCode(fee),
|
||||
btcFormatter.formatCoinWithCode(miningFee),
|
||||
CoinUtil.getFeePerByte(miningFee, txSize),
|
||||
txSize / 1000d,
|
||||
type);
|
||||
}
|
||||
new Popup<>().headLine(Res.get("dao.feeTx.confirm", type))
|
||||
.confirmation(Res.get("dao.feeTx.confirm.details",
|
||||
StringUtils.capitalize(type),
|
||||
bsqFormatter.formatCoinWithCode(fee),
|
||||
btcFormatter.formatCoinWithCode(miningFee),
|
||||
CoinUtil.getFeePerByte(miningFee, txSize),
|
||||
txSize / 1000d,
|
||||
type))
|
||||
.confirmation(confirmationMessage)
|
||||
.actionButtonText(Res.get("shared.yes"))
|
||||
.onAction(actionHandler)
|
||||
.closeButtonText(Res.get("shared.cancel"))
|
||||
.show();
|
||||
}
|
||||
|
||||
public static void showBsqFeeInfoPopup(Coin fee, Coin miningFee, int txSize, BsqFormatter bsqFormatter,
|
||||
BSFormatter btcFormatter, String type,
|
||||
Runnable actionHandler) {
|
||||
showBsqFeeInfoPopup(fee, miningFee, null, txSize, bsqFormatter, btcFormatter, type, actionHandler);
|
||||
}
|
||||
|
||||
public static void setFitToRowsForTableView(TableView tableView, int rowHeight, int headerHeight, int minNumRows, int maxNumRows) {
|
||||
int size = tableView.getItems().size();
|
||||
int minHeight = rowHeight * minNumRows + headerHeight;
|
||||
|
|
Loading…
Add table
Reference in a new issue