Skip to content

Commit 7446cb1

Browse files
committed
Merge bitcoin-core/gui#719: Remove confusing "Dust" label from coincontrol / sendcoins dialog
a582b41 gui: send, left alignment for "bytes" and "change" label (furszy) 210ef1e qt: remove confusing "Dust" label from coincontrol / sendcoins dialog (Sebastian Falbesoner) Pull request description: In contrast to to all other labels on the coin selection dialog, the displayed dust information has nothing to do with the selected coins. All that this label shows is whether at least one of the _outputs_ qualify as dust, but the outputs are set in a different dialog. (Even worse, the dust check is currently simply wrong because it only looks at an output's nValue and just assumes a P2PKH script size.) As the label clearly doesn't help the user and is, quite the contrary, rather increasing confusion/misguidance, it seems sensible to remove it. The label from the sendcoins dialog is also removed with the same rationale. Additionally, the "bytes" and "change" labels are aligned to the left (second commit). Closes bitcoin-core/gui#699. ACKs for top commit: furszy: ACK a582b41 hebasto: Looks good. ACK a582b41. Tree-SHA512: ebc00b68bdeab69f6ab643e4b89301a7e3d04a8a4027b50813314ddddb1387bc97a83313851e375dfbce97751c234686c82af7f4e55fa5ef29f4fed4e8fc11d9
2 parents f08d914 + a582b41 commit 7446cb1

File tree

6 files changed

+14
-107
lines changed

6 files changed

+14
-107
lines changed

src/qt/coincontroldialog.cpp

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,20 @@ CoinControlDialog::CoinControlDialog(CCoinControl& coin_control, WalletModel* _m
7070
QAction *clipboardFeeAction = new QAction(tr("Copy fee"), this);
7171
QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
7272
QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this);
73-
QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this);
7473
QAction *clipboardChangeAction = new QAction(tr("Copy change"), this);
7574

7675
connect(clipboardQuantityAction, &QAction::triggered, this, &CoinControlDialog::clipboardQuantity);
7776
connect(clipboardAmountAction, &QAction::triggered, this, &CoinControlDialog::clipboardAmount);
7877
connect(clipboardFeeAction, &QAction::triggered, this, &CoinControlDialog::clipboardFee);
7978
connect(clipboardAfterFeeAction, &QAction::triggered, this, &CoinControlDialog::clipboardAfterFee);
8079
connect(clipboardBytesAction, &QAction::triggered, this, &CoinControlDialog::clipboardBytes);
81-
connect(clipboardLowOutputAction, &QAction::triggered, this, &CoinControlDialog::clipboardLowOutput);
8280
connect(clipboardChangeAction, &QAction::triggered, this, &CoinControlDialog::clipboardChange);
8381

8482
ui->labelCoinControlQuantity->addAction(clipboardQuantityAction);
8583
ui->labelCoinControlAmount->addAction(clipboardAmountAction);
8684
ui->labelCoinControlFee->addAction(clipboardFeeAction);
8785
ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction);
8886
ui->labelCoinControlBytes->addAction(clipboardBytesAction);
89-
ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);
9087
ui->labelCoinControlChange->addAction(clipboardChangeAction);
9188

9289
// toggle tree/list mode
@@ -294,12 +291,6 @@ void CoinControlDialog::clipboardBytes()
294291
GUIUtil::setClipboard(ui->labelCoinControlBytes->text().replace(ASYMP_UTF8, ""));
295292
}
296293

297-
// copy label "Dust" to clipboard
298-
void CoinControlDialog::clipboardLowOutput()
299-
{
300-
GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());
301-
}
302-
303294
// copy label "Change" to clipboard
304295
void CoinControlDialog::clipboardChange()
305296
{
@@ -390,17 +381,8 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
390381

391382
// nPayAmount
392383
CAmount nPayAmount = 0;
393-
bool fDust = false;
394-
for (const CAmount &amount : CoinControlDialog::payAmounts)
395-
{
384+
for (const CAmount &amount : CoinControlDialog::payAmounts) {
396385
nPayAmount += amount;
397-
398-
if (amount > 0)
399-
{
400-
// Assumes a p2pkh script size
401-
CTxOut txout(amount, CScript() << std::vector<unsigned char>(24, 0));
402-
fDust |= IsDust(txout, model->node().getDustRelayFee());
403-
}
404386
}
405387

406388
CAmount nAmount = 0;
@@ -515,12 +497,9 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
515497
QLabel *l3 = dialog->findChild<QLabel *>("labelCoinControlFee");
516498
QLabel *l4 = dialog->findChild<QLabel *>("labelCoinControlAfterFee");
517499
QLabel *l5 = dialog->findChild<QLabel *>("labelCoinControlBytes");
518-
QLabel *l7 = dialog->findChild<QLabel *>("labelCoinControlLowOutput");
519500
QLabel *l8 = dialog->findChild<QLabel *>("labelCoinControlChange");
520501

521-
// enable/disable "dust" and "change"
522-
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setEnabled(nPayAmount > 0);
523-
dialog->findChild<QLabel *>("labelCoinControlLowOutput") ->setEnabled(nPayAmount > 0);
502+
// enable/disable "change"
524503
dialog->findChild<QLabel *>("labelCoinControlChangeText") ->setEnabled(nPayAmount > 0);
525504
dialog->findChild<QLabel *>("labelCoinControlChange") ->setEnabled(nPayAmount > 0);
526505

@@ -530,7 +509,6 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
530509
l3->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nPayFee)); // Fee
531510
l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee)); // After Fee
532511
l5->setText(((nBytes > 0) ? ASYMP_UTF8 : "") + QString::number(nBytes)); // Bytes
533-
l7->setText(fDust ? tr("yes") : tr("no")); // Dust
534512
l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change
535513
if (nPayFee > 0)
536514
{
@@ -540,25 +518,17 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
540518
l8->setText(ASYMP_UTF8 + l8->text());
541519
}
542520

543-
// turn label red when dust
544-
l7->setStyleSheet((fDust) ? "color:red;" : "");
545-
546-
// tool tips
547-
QString toolTipDust = tr("This label turns red if any recipient receives an amount smaller than the current dust threshold.");
548-
549521
// how many satoshis the estimated fee can vary per byte we guess wrong
550522
double dFeeVary = (nBytes != 0) ? (double)nPayFee / nBytes : 0;
551523

552524
QString toolTip4 = tr("Can vary +/- %1 satoshi(s) per input.").arg(dFeeVary);
553525

554526
l3->setToolTip(toolTip4);
555527
l4->setToolTip(toolTip4);
556-
l7->setToolTip(toolTipDust);
557528
l8->setToolTip(toolTip4);
558529
dialog->findChild<QLabel *>("labelCoinControlFeeText") ->setToolTip(l3->toolTip());
559530
dialog->findChild<QLabel *>("labelCoinControlAfterFeeText") ->setToolTip(l4->toolTip());
560531
dialog->findChild<QLabel *>("labelCoinControlBytesText") ->setToolTip(l5->toolTip());
561-
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setToolTip(l7->toolTip());
562532
dialog->findChild<QLabel *>("labelCoinControlChangeText") ->setToolTip(l8->toolTip());
563533

564534
// Insufficient funds

src/qt/coincontroldialog.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ private Q_SLOTS:
105105
void clipboardFee();
106106
void clipboardAfterFee();
107107
void clipboardBytes();
108-
void clipboardLowOutput();
109108
void clipboardChange();
110109
void radioTreeMode(bool);
111110
void radioListMode(bool);

src/qt/forms/coincontroldialog.ui

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
</property>
2525
<item>
2626
<layout class="QFormLayout" name="formLayoutCoinControl1">
27+
<property name="labelAlignment">
28+
<set>Qt::AlignLeft|Qt::AlignVCenter</set>
29+
</property>
2730
<property name="horizontalSpacing">
2831
<number>10</number>
2932
</property>
@@ -139,41 +142,6 @@
139142
</property>
140143
</widget>
141144
</item>
142-
<item row="1" column="0">
143-
<widget class="QLabel" name="labelCoinControlLowOutputText">
144-
<property name="enabled">
145-
<bool>false</bool>
146-
</property>
147-
<property name="font">
148-
<font>
149-
<weight>75</weight>
150-
<bold>true</bold>
151-
</font>
152-
</property>
153-
<property name="text">
154-
<string>Dust:</string>
155-
</property>
156-
</widget>
157-
</item>
158-
<item row="1" column="1">
159-
<widget class="QLabel" name="labelCoinControlLowOutput">
160-
<property name="enabled">
161-
<bool>false</bool>
162-
</property>
163-
<property name="cursor">
164-
<cursorShape>IBeamCursor</cursorShape>
165-
</property>
166-
<property name="contextMenuPolicy">
167-
<enum>Qt::ActionsContextMenu</enum>
168-
</property>
169-
<property name="text">
170-
<string notr="true">no</string>
171-
</property>
172-
<property name="textInteractionFlags">
173-
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
174-
</property>
175-
</widget>
176-
</item>
177145
</layout>
178146
</item>
179147
<item>
@@ -223,6 +191,9 @@
223191
</item>
224192
<item>
225193
<layout class="QFormLayout" name="formLayoutCoinControl4">
194+
<property name="labelAlignment">
195+
<set>Qt::AlignLeft|Qt::AlignVCenter</set>
196+
</property>
226197
<property name="horizontalSpacing">
227198
<number>10</number>
228199
</property>

src/qt/forms/sendcoinsdialog.ui

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@
201201
</property>
202202
<item>
203203
<layout class="QFormLayout" name="formLayoutCoinControl1">
204+
<property name="labelAlignment">
205+
<set>Qt::AlignLeft|Qt::AlignVCenter</set>
206+
</property>
204207
<property name="horizontalSpacing">
205208
<number>10</number>
206209
</property>
@@ -331,35 +334,6 @@
331334
</property>
332335
</widget>
333336
</item>
334-
<item row="1" column="0">
335-
<widget class="QLabel" name="labelCoinControlLowOutputText">
336-
<property name="font">
337-
<font>
338-
<weight>75</weight>
339-
<bold>true</bold>
340-
</font>
341-
</property>
342-
<property name="text">
343-
<string>Dust:</string>
344-
</property>
345-
</widget>
346-
</item>
347-
<item row="1" column="1">
348-
<widget class="QLabel" name="labelCoinControlLowOutput">
349-
<property name="cursor">
350-
<cursorShape>IBeamCursor</cursorShape>
351-
</property>
352-
<property name="contextMenuPolicy">
353-
<enum>Qt::ActionsContextMenu</enum>
354-
</property>
355-
<property name="text">
356-
<string notr="true">no</string>
357-
</property>
358-
<property name="textInteractionFlags">
359-
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
360-
</property>
361-
</widget>
362-
</item>
363337
</layout>
364338
</item>
365339
<item>
@@ -415,6 +389,9 @@
415389
</item>
416390
<item>
417391
<layout class="QFormLayout" name="formLayoutCoinControl4">
392+
<property name="labelAlignment">
393+
<set>Qt::AlignLeft|Qt::AlignVCenter</set>
394+
</property>
418395
<property name="horizontalSpacing">
419396
<number>10</number>
420397
</property>

src/qt/sendcoinsdialog.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,18 @@ SendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, QWidget *p
9797
QAction *clipboardFeeAction = new QAction(tr("Copy fee"), this);
9898
QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
9999
QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this);
100-
QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this);
101100
QAction *clipboardChangeAction = new QAction(tr("Copy change"), this);
102101
connect(clipboardQuantityAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardQuantity);
103102
connect(clipboardAmountAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardAmount);
104103
connect(clipboardFeeAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardFee);
105104
connect(clipboardAfterFeeAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardAfterFee);
106105
connect(clipboardBytesAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardBytes);
107-
connect(clipboardLowOutputAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardLowOutput);
108106
connect(clipboardChangeAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardChange);
109107
ui->labelCoinControlQuantity->addAction(clipboardQuantityAction);
110108
ui->labelCoinControlAmount->addAction(clipboardAmountAction);
111109
ui->labelCoinControlFee->addAction(clipboardFeeAction);
112110
ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction);
113111
ui->labelCoinControlBytes->addAction(clipboardBytesAction);
114-
ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);
115112
ui->labelCoinControlChange->addAction(clipboardChangeAction);
116113

117114
// init transaction fee section
@@ -919,12 +916,6 @@ void SendCoinsDialog::coinControlClipboardBytes()
919916
GUIUtil::setClipboard(ui->labelCoinControlBytes->text().replace(ASYMP_UTF8, ""));
920917
}
921918

922-
// Coin Control: copy label "Dust" to clipboard
923-
void SendCoinsDialog::coinControlClipboardLowOutput()
924-
{
925-
GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());
926-
}
927-
928919
// Coin Control: copy label "Change" to clipboard
929920
void SendCoinsDialog::coinControlClipboardChange()
930921
{

src/qt/sendcoinsdialog.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ private Q_SLOTS:
111111
void coinControlClipboardFee();
112112
void coinControlClipboardAfterFee();
113113
void coinControlClipboardBytes();
114-
void coinControlClipboardLowOutput();
115114
void coinControlClipboardChange();
116115
void updateFeeSectionControls();
117116
void updateNumberOfBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, SyncType synctype, SynchronizationState sync_state);

0 commit comments

Comments
 (0)