Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
sendcoinsdialog.cpp
Go to the documentation of this file.
96 connect(ui->checkBoxCoinControlChange, SIGNAL(stateChanged(int)), this, SLOT(coinControlChangeChecked(int)));
97 connect(ui->lineEditCoinControlChange, SIGNAL(textEdited(const QString &)), this, SLOT(coinControlChangeEdited(const QString &)));
125 connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardQuantity()));
128 connect(clipboardAfterFeeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAfterFee()));
130 connect(clipboardLowOutputAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardLowOutput()));
143 if (!settings.contains("nFeeRadio") && settings.contains("nTransactionFee") && settings.value("nTransactionFee").toLongLong() > 0) // compatibility
156 ui->groupFee->button((int)std::max(0, std::min(1, settings.value("nFeeRadio").toInt())))->setChecked(true);
175 connect(_clientModel, SIGNAL(numBlocksChanged(int,QDateTime,QString,double,bool)), this, SLOT(updateSmartFeeLabel()));
194 setBalance(_model->getBalance(), _model->getUnconfirmedBalance(), _model->getImmatureBalance(), _model->getAnonymizedBalance(),
195 _model->getWatchBalance(), _model->getWatchUnconfirmedBalance(), _model->getWatchImmatureBalance());
196 connect(_model, SIGNAL(balanceChanged(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)), this, SLOT(setBalance(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)));
197 connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
201 connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(coinControlUpdateLabels()));
202 connect(_model->getOptionsModel(), SIGNAL(coinControlFeaturesChanged(bool)), this, SLOT(coinControlFeatureChanged(bool)));
208 ui->confTargetSelector->addItem(tr("%1 (%2 blocks)").arg(GUIUtil::formatNiceTimeOffset(n*Params().GetConsensus().nPowTargetSpacing)).arg(n));
210 connect(ui->confTargetSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSmartFeeLabel()));
211 connect(ui->confTargetSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(coinControlUpdateLabels()));
216 connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateFeeSectionControls()));
217 connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels()));
228 int nConfirmTarget = 25 - settings.value("nSmartFeeSliderPosition").toInt(); // 25 == old slider range
233 ui->confTargetSelector->setCurrentIndex(getIndexForConfTarget(model->getDefaultConfirmTarget()));
235 ui->confTargetSelector->setCurrentIndex(getIndexForConfTarget(settings.value("nConfTarget").toInt()));
244 settings.setValue("nConfTarget", getConfTargetForIndex(ui->confTargetSelector->currentIndex()));
308 // Always use a CCoinControl instance, use the CoinControlDialog instance if CoinControl has been enabled
321 BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), currentTransaction.getTransactionFee()));
333 QString amount = "<b>" + BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount);
393 questionString.append("<span style='" + GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_ERROR) + "'>");
394 questionString.append(tr("<b>(%1 of %2 entries displayed)</b>").arg(displayedEntries).arg(messageEntries));
403 questionString.append("<hr /><span style='" + GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_ERROR) + "'>");
404 questionString.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
409 questionString.append(" " + tr("(PrivateSend transactions have higher fees usually due to no change output being allowed)"));
416 questionString.append(tr("Transaction size: %1").arg(QString::number((double)currentTransaction.getTransactionSize() / 1000)) + " kB");
419 questionString.append(tr("Fee rate: %1").arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), feeRate.GetFeePerK())) + "/kB");
430 questionString.append("<span style='" + GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_ERROR) + "'>");
431 questionString.append(tr("Warning: Using PrivateSend with %1 or more inputs can harm your privacy and is not recommended").arg(10));
511 connect(entry, SIGNAL(useAvailableBalance(SendCoinsEntry*)), this, SLOT(useAvailableBalance(SendCoinsEntry*)));
615 void SendCoinsDialog::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& anonymizedBalance,
616 const CAmount& watchBalance, const CAmount& watchUnconfirmedBalance, const CAmount& watchImmatureBalance)
634 ui->labelBalance->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), bal));
640 setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(), model->getAnonymizedBalance(),
641 model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance());
648 void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg)
669 msgParams.first = tr("The total exceeds your balance when the %1 transaction fee is included.").arg(msgArg);
679 msgParams.first = tr("The transaction was rejected with the following reason: %1").arg(sendCoinsReturn.reasonCommitFailed);
683 msgParams.first = tr("A fee higher than %1 is considered an absurdly high fee.").arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), maxTxFee));
764 ui->labelCustomPerKilobyte ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked());
765 ui->customFee ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked());
776 ui->labelFeeMinimized->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), ui->customFee->value()) + "/kB");
784 BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), GetRequiredFee(1000)) + "/kB")
816 CFeeRate feeRate = CFeeRate(GetMinimumFee(1000, coin_control, ::mempool, ::feeEstimator, &feeCalc));
818 ui->labelSmartFee->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), feeRate.GetFeePerK()) + "/kB");
821 ui->labelSmartFee2->show(); // (Smart fee not initialized yet. This usually takes a few blocks...)
828 ui->labelFeeEstimation->setText(tr("Estimated to begin confirmation within %n block(s).", "", feeCalc.returnedTarget));
844 GUIUtil::setClipboard(ui->labelCoinControlAmount->text().left(ui->labelCoinControlAmount->text().indexOf(" ")));
850 GUIUtil::setClipboard(ui->labelCoinControlFee->text().left(ui->labelCoinControlFee->text().indexOf(" ")).replace(ASYMP_UTF8, ""));
856 GUIUtil::setClipboard(ui->labelCoinControlAfterFee->text().left(ui->labelCoinControlAfterFee->text().indexOf(" ")).replace(ASYMP_UTF8, ""));
874 GUIUtil::setClipboard(ui->labelCoinControlChange->text().left(ui->labelCoinControlChange->text().indexOf(" ")).replace(ASYMP_UTF8, ""));
919 ui->labelCoinControlChangeLabel->setStyleSheet(GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_ERROR));
937 QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm custom change address"), tr("The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?"),
945 ui->labelCoinControlChangeLabel->setStyleSheet(GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_PRIMARY));
951 ui->labelCoinControlChangeLabel->setStyleSheet(GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_PRIMARY));
1008 SendConfirmationDialog::SendConfirmationDialog(const QString &title, const QString &text, int _secDelay,
1010 QMessageBox(QMessageBox::Question, title, text, QMessageBox::Yes | QMessageBox::Cancel, parent), secDelay(_secDelay)
Definition: walletmodel.h:153
CTxMemPool mempool
void removeEntry(SendCoinsEntry *entry)
Definition: sendcoinsdialog.cpp:534
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:80
void setValue(const SendCoinsRecipient &value)
Definition: sendcoinsentry.cpp:204
CWalletTx * getTransaction() const
Definition: walletmodeltransaction.cpp:27
QString reasonCommitFailed
Definition: walletmodel.h:161
void updateFeeMinimizedLabel()
Definition: sendcoinsdialog.cpp:768
void setFont(const std::vector< QWidget *> &vecWidgets, FontWeight weight, int nPointSize, bool fItalic)
Workaround to set correct font styles in all themes since there is a bug in macOS which leads to issu...
Definition: guiutil.cpp:1552
boost::optional< unsigned int > m_confirm_target
Override the default confirmation target if set.
Definition: coincontrol.h:45
void on_buttonChooseFee_clicked()
Definition: sendcoinsdialog.cpp:708
CAmount maxTxFee
Absolute maximum transaction fee (in duffs) used by wallet and mempool (rejects high fee in sendrawtr...
Definition: validation.cpp:247
Definition: addressbookpage.h:12
void coinControlClipboardQuantity()
Definition: sendcoinsdialog.cpp:836
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as HTML string (with unit)
Definition: bitcoinunits.cpp:167
void coinControlClipboardAfterFee()
Definition: sendcoinsdialog.cpp:854
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination is a CNoDestination.
Definition: standard.cpp:281
CAmount getTransactionFee() const
Definition: walletmodeltransaction.cpp:37
SendCoinsReturn sendCoins(WalletModelTransaction &transaction)
Definition: walletmodel.cpp:384
QList< SendCoinsRecipient > getRecipients() const
Definition: walletmodeltransaction.cpp:22
void updateCoinControlState(CCoinControl &ctrl)
Definition: sendcoinsdialog.cpp:788
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent, bool fAllowURI)
Definition: guiutil.cpp:286
QString HtmlEscape(const QString &str, bool fMultiLine)
Definition: guiutil.cpp:481
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
Definition: sendcoinsdialog.cpp:607
static void usePrivateSend(bool fUsePrivateSend)
Definition: coincontroldialog.cpp:674
CAmount GetRequiredFee(unsigned int nTxBytes)
Return the minimum required fee taking into account the floating relay fee and user set minimum trans...
Definition: fees.cpp:16
Definition: standard.h:67
AddressTableModel * getAddressTableModel()
Definition: walletmodel.cpp:464
void send(QList< SendCoinsRecipient > recipients)
Definition: sendcoinsdialog.cpp:302
Definition: walletmodel.h:110
boost::optional< CFeeRate > m_feerate
Override the default payTxFee if set.
Definition: coincontrol.h:41
EncryptionStatus getEncryptionStatus() const
Definition: walletmodel.cpp:479
CAmount getBalance(const CCoinControl *coinControl=nullptr) const
Definition: walletmodel.cpp:76
void coinControlFeatureChanged(bool)
Definition: sendcoinsdialog.cpp:878
QWidget * setupTabChain(QWidget *prev)
Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://...
Definition: sendcoinsentry.cpp:192
Definition: walletmodel.h:112
QWidget * setupTabChain(QWidget *prev)
Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://...
Definition: sendcoinsdialog.cpp:547
void updateFonts()
Update the font of all widgets where a custom font has been set with GUIUtil::setFont.
Definition: guiutil.cpp:1563
void on_sendButton_clicked()
Definition: sendcoinsdialog.cpp:251
Definition: ui_interface.h:71
void setAddress(const QString &address)
Definition: sendcoinsdialog.cpp:563
Definition: walletmodel.h:111
void coinControlClipboardChange()
Definition: sendcoinsdialog.cpp:872
void useAvailableBalance(SendCoinsEntry *entry)
Definition: sendcoinsdialog.cpp:719
void setClientModel(ClientModel *clientModel)
Definition: sendcoinsdialog.cpp:170
int getDefaultConfirmTarget() const
Definition: walletmodel.cpp:817
CAmount getWatchUnconfirmedBalance() const
Definition: walletmodel.cpp:132
Definition: walletmodel.h:39
QString labelForAddress(const QString &address) const
Definition: addresstablemodel.cpp:423
SendCoinsDialog(bool fPrivateSend=false, QWidget *parent=0)
Definition: sendcoinsdialog.cpp:54
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const CCoinControl &coinControl)
Definition: walletmodel.cpp:260
void coinControlChangeEdited(const QString &)
Definition: sendcoinsdialog.cpp:913
static void updateLabels(WalletModel *, QDialog *)
Definition: coincontroldialog.cpp:480
CAmount getAnonymizedBalance(const CCoinControl *coinControl=nullptr) const
Definition: walletmodel.cpp:92
Definition: fees.h:125
Definition: ui_interface.h:72
void coinControlUpdateLabels()
Definition: sendcoinsdialog.cpp:967
Definition: sendcoinsdialog.h:110
bool getCoinControlFeatures() const
Definition: optionsmodel.h:85
void checkSubtractFeeFromAmount()
Definition: sendcoinsentry.cpp:122
bool isClear()
Return whether the entry is still empty and unedited.
Definition: sendcoinsentry.cpp:253
void minimizeFeeSection(bool fMinimize)
Definition: sendcoinsdialog.cpp:698
void coinControlClipboardLowOutput()
Definition: sendcoinsdialog.cpp:866
void updateFeeSectionControls()
Definition: sendcoinsdialog.cpp:755
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
Definition: bitcoinunits.cpp:19
static bool fSubtractFeeFromAmount
Definition: coincontroldialog.h:55
SendConfirmationDialog(const QString &title, const QString &text, int secDelay=0, QWidget *parent=0)
Definition: sendcoinsdialog.cpp:1008
UnlockContext requestUnlock(bool fForMixingOnly=false)
Definition: walletmodel.cpp:640
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:947
CAmount getUnconfirmedBalance() const
Definition: walletmodel.cpp:112
QString getThemedStyleQString(ThemedStyle style)
Helper to get css style strings which are injected into rich text through qt.
Definition: guiutil.cpp:210
void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg=QString())
Definition: sendcoinsdialog.cpp:648
Data model for a walletmodel transaction.
Definition: walletmodeltransaction.h:21
void coinControlClipboardBytes()
Definition: sendcoinsdialog.cpp:860
Definition: walletmodel.h:182
CAmount getWatchImmatureBalance() const
Definition: walletmodel.cpp:137
CAmount getTotalTransactionAmount() const
Definition: walletmodeltransaction.cpp:86
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
Definition: bitcoinunits.cpp:162
void coinControlClipboardAmount()
Definition: sendcoinsdialog.cpp:842
void on_buttonMinimizeFee_clicked()
Definition: sendcoinsdialog.cpp:713
Definition: coincontroldialog.h:40
void pasteEntry(const SendCoinsRecipient &rv)
Definition: sendcoinsdialog.cpp:583
void message(const QString &title, const QString &message, unsigned int style)
void setBalance(const CAmount &balance, const CAmount &unconfirmedBalance, const CAmount &immatureBalance, const CAmount &anonymizedBalance, const CAmount &watchOnlyBalance, const CAmount &watchUnconfBalance, const CAmount &watchImmatureBalance)
Definition: sendcoinsdialog.cpp:615
Definition: walletmodel.h:115
Definition: walletmodel.h:125
Definition: walletmodel.h:118
CAmount GetMinimumFee(unsigned int nTxBytes, const CCoinControl &coin_control, const CTxMemPool &pool, const CBlockPolicyEstimator &estimator, FeeCalculation *feeCalc)
Estimate the minimum fee considering user set parameters and the required fee.
Definition: fees.cpp:21
CAmount GetFeePerK() const
Return the fee in satoshis for a size of 1000 bytes.
Definition: feerate.h:41
void coinControlButtonClicked()
Definition: sendcoinsdialog.cpp:889
unsigned int getTransactionSize()
Definition: walletmodeltransaction.cpp:32
void coinControlClipboardFee()
Definition: sendcoinsdialog.cpp:848
bool IsSpendable(const CTxDestination &dest) const
Definition: walletmodel.cpp:699
void coinControlChangeChecked(int)
Definition: sendcoinsdialog.cpp:898
static CCoinControl * coinControl()
Definition: coincontroldialog.cpp:679