mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-22 06:26:43 +02:00
Merge bitcoin-core/gui#612: refactor: Drop unused QFrame
s in SendCoinsEntry
7ab72b9d2a500420a1103221c3cbfac4cda1c43a qt: Fix `BitcoinAmountField`'s base widget (Hennadii Stepanov)
32625421047951b9c9fad195be3aa40d6075d469 qt, refactor: Fix `sendcoinsentry.ui` indentation (Hennadii Stepanov)
f3c76033295b8007c61eab7fcb23cf119d72b8b8 qt, refactor: Convert `SendCoinsEntry` to a sub-`QWidget` (Hennadii Stepanov)
6420fb2005db1490d77c6df45d0b97d7389ff609 qt, refactor: Drop unused `QFrame`s in `SendCoinsEntry` (Hennadii Stepanov)
Pull request description:
The `SendCoins_UnauthenticatedPaymentRequest` and `SendCoins_AuthenticatedPaymentRequest` sub-`QFrame`'s of the `SendCoinsEntry` widget have been unused since bitcoin/bitcoin#17165.
Removed all dead code. The resulted `SendCoinsEntry` widget has been simplified.
ACKs for top commit:
w0xlt:
Tested ACK 7ab72b9d2a
shaavan:
reACK 7ab72b9d2a500420a1103221c3cbfac4cda1c43a
Tree-SHA512: a46db90d60fae584b52cc7edae910c295351cb3627e04d225708c50c04f7fdd81d2755e055115612a12a3c841e78c31bdcd57bed9feb1d3909f7a2f6e76bd356
This commit is contained in:
commit
18d9189cc9
File diff suppressed because it is too large
Load Diff
@ -20,7 +20,7 @@
|
||||
#include <QClipboard>
|
||||
|
||||
SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *parent) :
|
||||
QStackedWidget(parent),
|
||||
QWidget(parent),
|
||||
ui(new Ui::SendCoinsEntry),
|
||||
model(nullptr),
|
||||
platformStyle(_platformStyle)
|
||||
@ -30,25 +30,16 @@ SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *par
|
||||
ui->addressBookButton->setIcon(platformStyle->SingleColorIcon(":/icons/address-book"));
|
||||
ui->pasteButton->setIcon(platformStyle->SingleColorIcon(":/icons/editpaste"));
|
||||
ui->deleteButton->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
|
||||
ui->deleteButton_is->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
|
||||
ui->deleteButton_s->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
|
||||
|
||||
setCurrentWidget(ui->SendCoins);
|
||||
|
||||
if (platformStyle->getUseExtraSpacing())
|
||||
ui->payToLayout->setSpacing(4);
|
||||
|
||||
// normal bitcoin address field
|
||||
GUIUtil::setupAddressWidget(ui->payTo, this);
|
||||
// just a label for displaying bitcoin address(es)
|
||||
ui->payTo_is->setFont(GUIUtil::fixedPitchFont());
|
||||
|
||||
// Connect signals
|
||||
connect(ui->payAmount, &BitcoinAmountField::valueChanged, this, &SendCoinsEntry::payAmountChanged);
|
||||
connect(ui->checkboxSubtractFeeFromAmount, &QCheckBox::toggled, this, &SendCoinsEntry::subtractFeeFromAmountChanged);
|
||||
connect(ui->deleteButton, &QPushButton::clicked, this, &SendCoinsEntry::deleteClicked);
|
||||
connect(ui->deleteButton_is, &QPushButton::clicked, this, &SendCoinsEntry::deleteClicked);
|
||||
connect(ui->deleteButton_s, &QPushButton::clicked, this, &SendCoinsEntry::deleteClicked);
|
||||
connect(ui->useAvailableBalanceButton, &QPushButton::clicked, this, &SendCoinsEntry::useAvailableBalanceClicked);
|
||||
}
|
||||
|
||||
@ -103,14 +94,6 @@ void SendCoinsEntry::clear()
|
||||
ui->messageTextLabel->clear();
|
||||
ui->messageTextLabel->hide();
|
||||
ui->messageLabel->hide();
|
||||
// clear UI elements for unauthenticated payment request
|
||||
ui->payTo_is->clear();
|
||||
ui->memoTextLabel_is->clear();
|
||||
ui->payAmount_is->clear();
|
||||
// clear UI elements for authenticated payment request
|
||||
ui->payTo_s->clear();
|
||||
ui->memoTextLabel_s->clear();
|
||||
ui->payAmount_s->clear();
|
||||
|
||||
// update the display unit, to not use the default ("BTC")
|
||||
updateDisplayUnit();
|
||||
@ -219,7 +202,7 @@ void SendCoinsEntry::setAmount(const CAmount &amount)
|
||||
|
||||
bool SendCoinsEntry::isClear()
|
||||
{
|
||||
return ui->payTo->text().isEmpty() && ui->payTo_is->text().isEmpty() && ui->payTo_s->text().isEmpty();
|
||||
return ui->payTo->text().isEmpty();
|
||||
}
|
||||
|
||||
void SendCoinsEntry::setFocus()
|
||||
@ -229,12 +212,8 @@ void SendCoinsEntry::setFocus()
|
||||
|
||||
void SendCoinsEntry::updateDisplayUnit()
|
||||
{
|
||||
if(model && model->getOptionsModel())
|
||||
{
|
||||
// Update payAmount with the current unit
|
||||
if (model && model->getOptionsModel()) {
|
||||
ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
|
||||
ui->payAmount_is->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
|
||||
ui->payAmount_s->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
|
||||
}
|
||||
}
|
||||
|
||||
@ -244,11 +223,9 @@ void SendCoinsEntry::changeEvent(QEvent* e)
|
||||
ui->addressBookButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/address-book")));
|
||||
ui->pasteButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/editpaste")));
|
||||
ui->deleteButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove")));
|
||||
ui->deleteButton_is->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove")));
|
||||
ui->deleteButton_s->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove")));
|
||||
}
|
||||
|
||||
QStackedWidget::changeEvent(e);
|
||||
QWidget::changeEvent(e);
|
||||
}
|
||||
|
||||
bool SendCoinsEntry::updateLabel(const QString &address)
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include <qt/sendcoinsrecipient.h>
|
||||
|
||||
#include <QStackedWidget>
|
||||
#include <QWidget>
|
||||
|
||||
class WalletModel;
|
||||
class PlatformStyle;
|
||||
@ -22,10 +22,8 @@ namespace Ui {
|
||||
|
||||
/**
|
||||
* A single entry in the dialog for sending bitcoins.
|
||||
* Stacked widget, with different UIs for payment requests
|
||||
* with a strong payee identity.
|
||||
*/
|
||||
class SendCoinsEntry : public QStackedWidget
|
||||
class SendCoinsEntry : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user