Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
coincontroldialog.cpp
Go to the documentation of this file.
41 if (column == CoinControlDialog::COLUMN_AMOUNT || column == CoinControlDialog::COLUMN_DATE || column == CoinControlDialog::COLUMN_CONFIRMATIONS || column == CoinControlDialog::COLUMN_PRIVATESEND_ROUNDS)
70 copyTransactionHashAction = new QAction(tr("Copy transaction ID"), this); // we need to enable/disable this
85 connect(ui->treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showMenu(QPoint)));
123 connect(ui->treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(viewItemChanged(QTreeWidgetItem*, int)));
131 connect(ui->treeWidget->header(), SIGNAL(sectionClicked(int)), this, SLOT(headerSectionClicked(int)));
134 connect(ui->buttonBox, SIGNAL(clicked( QAbstractButton*)), this, SLOT(buttonBoxClicked(QAbstractButton*)));
164 sortView(settings.value("nCoinControlSortColumn").toInt(), ((Qt::SortOrder)settings.value("nCoinControlSortOrder").toInt()));
227 COutPoint outpt(uint256S(item->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), item->data(COLUMN_ADDRESS, VOutRole).toUInt());
228 // Don't toggle the lock state of partially mixed coins if they are not hidden in PrivateSend mode
232 if (model->isLockedCoin(uint256S(item->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), item->data(COLUMN_ADDRESS, VOutRole).toUInt())){
264 if (item->data(COLUMN_ADDRESS, TxHashRole).toString().length() == 64) // transaction hash is 64 characters (this means its a child node, so its not a parent node in tree mode)
267 if (model->isLockedCoin(uint256S(item->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), item->data(COLUMN_ADDRESS, VOutRole).toUInt()))
299 if (ui->radioTreeMode->isChecked() && contextMenuItem->text(COLUMN_LABEL).length() == 0 && contextMenuItem->parent())
308 if (ui->radioTreeMode->isChecked() && contextMenuItem->text(COLUMN_ADDRESS).length() == 0 && contextMenuItem->parent())
326 COutPoint outpt(uint256S(contextMenuItem->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), contextMenuItem->data(COLUMN_ADDRESS, VOutRole).toUInt());
329 contextMenuItem->setIcon(COLUMN_CHECKBOX, GUIUtil::getIcon("lock_closed", GUIUtil::ThemedColor::RED));
336 COutPoint outpt(uint256S(contextMenuItem->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), contextMenuItem->data(COLUMN_ADDRESS, VOutRole).toUInt());
352 GUIUtil::setClipboard(ui->labelCoinControlAmount->text().left(ui->labelCoinControlAmount->text().indexOf(" ")));
358 GUIUtil::setClipboard(ui->labelCoinControlFee->text().left(ui->labelCoinControlFee->text().indexOf(" ")).replace(ASYMP_UTF8, ""));
364 GUIUtil::setClipboard(ui->labelCoinControlAfterFee->text().left(ui->labelCoinControlAfterFee->text().indexOf(" ")).replace(ASYMP_UTF8, ""));
382 GUIUtil::setClipboard(ui->labelCoinControlChange->text().left(ui->labelCoinControlChange->text().indexOf(" ")).replace(ASYMP_UTF8, ""));
408 sortOrder = ((sortColumn == COLUMN_LABEL || sortColumn == COLUMN_ADDRESS) ? Qt::AscendingOrder : Qt::DescendingOrder); // if label or address then default => asc, else default => desc
432 if (column == COLUMN_CHECKBOX && item->data(COLUMN_ADDRESS, TxHashRole).toString().length() == 64) // transaction hash is 64 characters (this means its a child node, so its not a parent node in tree mode)
434 COutPoint outpt(uint256S(item->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), item->data(COLUMN_ADDRESS, VOutRole).toUInt());
454 if (item->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked && item->child(0)->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked)
555 nBytes = nBytesInputs + ((CoinControlDialog::payAmounts.size() > 0 ? CoinControlDialog::payAmounts.size() + 1 : 2) * 34) + 10; // always assume +1 output for change here
557 // in the subtract fee from amount case, we can tell if zero change already and subtract the bytes, so that fee calculation afterwards is accurate
563 nPayFee = GetMinimumFee(nBytes, *coinControl(), ::mempool, ::feeEstimator, nullptr /* FeeCalculation */);
637 l7->setStyleSheet((fDust) ? GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_ERROR) : "");
640 QString toolTipDust = tr("This label turns red if any recipient receives an amount smaller than the current dust threshold.");
676 CoinControlDialog::mode = fUsePrivateSend ? CoinControlDialog::Mode::PRIVATESEND : CoinControlDialog::Mode::NORMAL;
730 ui->treeWidget->setEnabled(false); // performance, otherwise updateLabels would be called for every checked checkbox
732 QFlags<Qt::ItemFlag> flgCheckbox = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
733 QFlags<Qt::ItemFlag> flgTristate = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate;
772 bool fPrivateSendAmount = CPrivateSend::IsDenominatedAmount(nAmount) || CPrivateSend::IsCollateralAmount(nAmount);
805 // if listMode or change => show dash address. In tree mode, address is not shown again for direct wallet address outputs
816 itemOutput->setToolTip(COLUMN_LABEL, tr("change from %1 (%2)").arg(sWalletLabel).arg(sWalletAddress));
827 itemOutput->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, out.tx->tx->vout[out.i].nValue));
828 itemOutput->setToolTip(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, out.tx->tx->vout[out.i].nValue));
829 itemOutput->setData(COLUMN_AMOUNT, Qt::UserRole, QVariant((qlonglong)out.tx->tx->vout[out.i].nValue)); // padding so that sorting works correctly
861 itemOutput->setIcon(COLUMN_CHECKBOX, GUIUtil::getIcon("lock_closed", GUIUtil::ThemedColor::RED));
bool isLockedCoin(uint256 hash, unsigned int n) const
Definition: walletmodel.cpp:746
void listCoins(std::map< QString, std::vector< COutput > > &mapCoins) const
Definition: walletmodel.cpp:736
void viewItemChanged(QTreeWidgetItem *, int)
Definition: coincontroldialog.cpp:430
CTxMemPool mempool
void getOutputs(const std::vector< COutPoint > &vOutpoints, std::vector< COutput > &vOutputs)
Definition: walletmodel.cpp:715
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:80
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address.
Definition: standard.cpp:158
void buttonSelectAllClicked()
Definition: coincontroldialog.cpp:197
static bool IsDenominatedAmount(CAmount nInputAmount)
Definition: privatesend.cpp:469
void headerSectionClicked(int)
Definition: coincontroldialog.cpp:395
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
void copyTransactionHash()
Definition: coincontroldialog.cpp:315
Definition: addressbookpage.h:12
void ListSelected(std::vector< COutPoint > &vOutpoints) const
Definition: coincontrol.h:96
void on_hideButton_clicked()
Definition: coincontroldialog.cpp:473
static void usePrivateSend(bool fUsePrivateSend)
Definition: coincontroldialog.cpp:674
Definition: bitcoinunits.h:60
AddressTableModel * getAddressTableModel()
Definition: walletmodel.cpp:464
void updateFonts()
Update the font of all widgets where a custom font has been set with GUIUtil::setFont.
Definition: guiutil.cpp:1563
bool operator<(const QTreeWidgetItem &other) const
Definition: coincontroldialog.cpp:39
bool getPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const
Definition: walletmodel.cpp:694
QAction * copyTransactionHashAction
Definition: coincontroldialog.h:66
Definition: util.h:142
QString labelForAddress(const QString &address) const
Definition: addresstablemodel.cpp:423
CoinControlDialog(QWidget *parent=0)
Definition: coincontroldialog.cpp:46
QIcon getIcon(const QString &strIcon, const ThemedColor color, const ThemedColor colorAlternative, const QString &strIconPath)
Helper to get an icon colorized with the given color (replaces black) and colorAlternative (replaces ...
Definition: guiutil.cpp:216
Definition: coincontroldialog.h:29
static void updateLabels(WalletModel *, QDialog *)
Definition: coincontroldialog.cpp:480
friend class CCoinControlWidgetItem
Definition: coincontroldialog.h:92
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:26
void disableMacFocusRect(const QWidget *w)
Disable the OS default focus rect for macOS because we have custom focus rects set in the css files...
Definition: guiutil.cpp:1789
bool fEnablePrivateSend
Definition: privatesend-client.h:213
void buttonToggleLockClicked()
Definition: coincontroldialog.cpp:219
static bool fSubtractFeeFromAmount
Definition: coincontroldialog.h:55
QTreeWidgetItem * contextMenuItem
Definition: coincontroldialog.h:65
std::string EncodeDestination(const CTxDestination &dest)
Definition: base58.cpp:329
void listLockedCoins(std::vector< COutPoint > &vOutpts)
Definition: walletmodel.cpp:764
Definition: wallet.h:566
int getRealOutpointPrivateSendRounds(const COutPoint &outpoint) const
Definition: walletmodel.cpp:232
QString getThemedStyleQString(ThemedStyle style)
Helper to get css style strings which are injected into rich text through qt.
Definition: guiutil.cpp:210
static bool IsCollateralAmount(CAmount nInputAmount)
Definition: privatesend.cpp:393
void buttonBoxClicked(QAbstractButton *)
Definition: coincontroldialog.cpp:190
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
Definition: bitcoinunits.cpp:162
Definition: coincontroldialog.h:40
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
bool operator<(const vote_time_pair_t &p1, const vote_time_pair_t &p2)
Definition: governance-object.h:52
bool isFullyMixed(const COutPoint &outpoint) const
Definition: walletmodel.cpp:237
static QString format(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string.
Definition: bitcoinunits.cpp:119
static CCoinControl * coinControl()
Definition: coincontroldialog.cpp:679