Browse Source

Merge pull request #4305

95a9383 [Qt] Remove CENT-fee-rule from coin control completely (Cozz Lovan)
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
588fb4e82f
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 24
      src/qt/coincontroldialog.cpp
  2. 2
      src/qt/forms/coincontroldialog.ui
  3. 2
      src/qt/forms/sendcoinsdialog.ui
  4. 4
      src/qt/sendcoinsdialog.cpp

24
src/qt/coincontroldialog.cpp

@ -71,7 +71,7 @@ CoinControlDialog::CoinControlDialog(QWidget *parent) :
QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this); QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this); QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this);
QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this); QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this);
QAction *clipboardLowOutputAction = new QAction(tr("Copy low output"), this); QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this);
QAction *clipboardChangeAction = new QAction(tr("Copy change"), this); QAction *clipboardChangeAction = new QAction(tr("Copy change"), this);
connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(clipboardQuantity())); connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(clipboardQuantity()));
@ -309,7 +309,7 @@ void CoinControlDialog::clipboardPriority()
GUIUtil::setClipboard(ui->labelCoinControlPriority->text()); GUIUtil::setClipboard(ui->labelCoinControlPriority->text());
} }
// copy label "Low output" to clipboard // copy label "Dust" to clipboard
void CoinControlDialog::clipboardLowOutput() void CoinControlDialog::clipboardLowOutput()
{ {
GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text()); GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());
@ -439,7 +439,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
// nPayAmount // nPayAmount
qint64 nPayAmount = 0; qint64 nPayAmount = 0;
bool fLowOutput = false;
bool fDust = false; bool fDust = false;
CTransaction txDummy; CTransaction txDummy;
foreach(const qint64 &amount, CoinControlDialog::payAmounts) foreach(const qint64 &amount, CoinControlDialog::payAmounts)
@ -448,9 +447,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
if (amount > 0) if (amount > 0)
{ {
if (amount < CENT)
fLowOutput = true;
CTxOut txout(amount, (CScript)vector<unsigned char>(24, 0)); CTxOut txout(amount, (CScript)vector<unsigned char>(24, 0));
txDummy.vout.push_back(txout); txDummy.vout.push_back(txout);
if (txout.IsDust(CTransaction::minRelayTxFee)) if (txout.IsDust(CTransaction::minRelayTxFee))
@ -571,7 +567,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
QLabel *l7 = dialog->findChild<QLabel *>("labelCoinControlLowOutput"); QLabel *l7 = dialog->findChild<QLabel *>("labelCoinControlLowOutput");
QLabel *l8 = dialog->findChild<QLabel *>("labelCoinControlChange"); QLabel *l8 = dialog->findChild<QLabel *>("labelCoinControlChange");
// enable/disable "low output" and "change" // enable/disable "dust" and "change"
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setEnabled(nPayAmount > 0); dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setEnabled(nPayAmount > 0);
dialog->findChild<QLabel *>("labelCoinControlLowOutput") ->setEnabled(nPayAmount > 0); dialog->findChild<QLabel *>("labelCoinControlLowOutput") ->setEnabled(nPayAmount > 0);
dialog->findChild<QLabel *>("labelCoinControlChangeText") ->setEnabled(nPayAmount > 0); dialog->findChild<QLabel *>("labelCoinControlChangeText") ->setEnabled(nPayAmount > 0);
@ -584,14 +580,13 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee)); // After Fee l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee)); // After Fee
l5->setText(((nBytes > 0) ? "~" : "") + QString::number(nBytes)); // Bytes l5->setText(((nBytes > 0) ? "~" : "") + QString::number(nBytes)); // Bytes
l6->setText(sPriorityLabel); // Priority l6->setText(sPriorityLabel); // Priority
l7->setText((fLowOutput ? (fDust ? tr("Dust") : tr("yes")) : tr("no"))); // Low Output / Dust l7->setText(fDust ? tr("yes") : tr("no")); // Dust
l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change
// turn labels "red" // turn labels "red"
l5->setStyleSheet((nBytes >= 1000) ? "color:red;" : ""); // Bytes >= 1000 l5->setStyleSheet((nBytes >= 1000) ? "color:red;" : ""); // Bytes >= 1000
l6->setStyleSheet((dPriority > 0 && !AllowFree(dPriority)) ? "color:red;" : ""); // Priority < "medium" l6->setStyleSheet((dPriority > 0 && !AllowFree(dPriority)) ? "color:red;" : ""); // Priority < "medium"
l7->setStyleSheet((fLowOutput) ? "color:red;" : ""); // Low Output = "yes" l7->setStyleSheet((fDust) ? "color:red;" : ""); // Dust = "yes"
l8->setStyleSheet((nChange > 0 && nChange < CENT) ? "color:red;" : ""); // Change < 0.01BTC
// tool tips // tool tips
QString toolTip1 = tr("This label turns red, if the transaction size is greater than 1000 bytes.") + "<br /><br />"; QString toolTip1 = tr("This label turns red, if the transaction size is greater than 1000 bytes.") + "<br /><br />";
@ -602,21 +597,14 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
toolTip2 += tr("This label turns red, if the priority is smaller than \"medium\".") + "<br /><br />"; toolTip2 += tr("This label turns red, if the priority is smaller than \"medium\".") + "<br /><br />";
toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())); toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK()));
QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "<br /><br />"; QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minRelayTxFee.GetFee(546)));
toolTip3 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())) + "<br /><br />";
toolTip3 += tr("Amounts below 0.546 times the minimum relay fee are shown as dust.");
QString toolTip4 = tr("This label turns red, if the change is smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "<br /><br />";
toolTip4 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK()));
l5->setToolTip(toolTip1); l5->setToolTip(toolTip1);
l6->setToolTip(toolTip2); l6->setToolTip(toolTip2);
l7->setToolTip(toolTip3); l7->setToolTip(toolTip3);
l8->setToolTip(toolTip4);
dialog->findChild<QLabel *>("labelCoinControlBytesText") ->setToolTip(l5->toolTip()); dialog->findChild<QLabel *>("labelCoinControlBytesText") ->setToolTip(l5->toolTip());
dialog->findChild<QLabel *>("labelCoinControlPriorityText") ->setToolTip(l6->toolTip()); dialog->findChild<QLabel *>("labelCoinControlPriorityText") ->setToolTip(l6->toolTip());
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setToolTip(l7->toolTip()); dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setToolTip(l7->toolTip());
dialog->findChild<QLabel *>("labelCoinControlChangeText") ->setToolTip(l8->toolTip());
// Insufficient funds // Insufficient funds
QLabel *label = dialog->findChild<QLabel *>("labelCoinControlInsuffFunds"); QLabel *label = dialog->findChild<QLabel *>("labelCoinControlInsuffFunds");

2
src/qt/forms/coincontroldialog.ui

@ -225,7 +225,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Low Output:</string> <string>Dust:</string>
</property> </property>
</widget> </widget>
</item> </item>

2
src/qt/forms/sendcoinsdialog.ui

@ -417,7 +417,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Low Output:</string> <string>Dust:</string>
</property> </property>
</widget> </widget>
</item> </item>

4
src/qt/sendcoinsdialog.cpp

@ -53,7 +53,7 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this); QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this); QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this);
QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this); QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this);
QAction *clipboardLowOutputAction = new QAction(tr("Copy low output"), this); QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this);
QAction *clipboardChangeAction = new QAction(tr("Copy change"), this); QAction *clipboardChangeAction = new QAction(tr("Copy change"), this);
connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardQuantity())); connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardQuantity()));
connect(clipboardAmountAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAmount())); connect(clipboardAmountAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAmount()));
@ -478,7 +478,7 @@ void SendCoinsDialog::coinControlClipboardPriority()
GUIUtil::setClipboard(ui->labelCoinControlPriority->text()); GUIUtil::setClipboard(ui->labelCoinControlPriority->text());
} }
// Coin Control: copy label "Low output" to clipboard // Coin Control: copy label "Dust" to clipboard
void SendCoinsDialog::coinControlClipboardLowOutput() void SendCoinsDialog::coinControlClipboardLowOutput()
{ {
GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text()); GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());

Loading…
Cancel
Save