mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Merge 18d9189cc9 into merged_master (Bitcoin PR bitcoin-core/gui#612)
I think this is correct, please double check.
This commit is contained in:
commit
321cb9477b
3 changed files with 203 additions and 1271 deletions
1437
src/qt/forms/sendcoinsentry.ui
Normal file → Executable file
1437
src/qt/forms/sendcoinsentry.ui
Normal file → Executable file
File diff suppressed because it is too large
Load diff
|
|
@ -23,7 +23,7 @@
|
|||
#include <chainparams.h>
|
||||
|
||||
SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *parent) :
|
||||
QStackedWidget(parent),
|
||||
QWidget(parent),
|
||||
ui(new Ui::SendCoinsEntry),
|
||||
model(nullptr),
|
||||
platformStyle(_platformStyle)
|
||||
|
|
@ -33,26 +33,17 @@ 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->payAmount, &BitcoinAmountField::valueChanged, this, &SendCoinsEntry::payAmountChangedInternal);
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
@ -109,14 +100,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")
|
||||
updateAssetTypes();
|
||||
|
|
@ -238,7 +221,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()
|
||||
|
|
@ -255,12 +238,8 @@ void SendCoinsEntry::updateAssetTypes()
|
|||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -270,11 +249,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…
Add table
Add a link
Reference in a new issue