Changeset View
Changeset View
Standalone View
Standalone View
src/qt/sendcoinsdialog.cpp
Show All 23 Lines | |||||
#include <QMessageBox> | #include <QMessageBox> | ||||
#include <QScrollBar> | #include <QScrollBar> | ||||
#include <QSettings> | #include <QSettings> | ||||
#include <QTextDocument> | #include <QTextDocument> | ||||
#include <QTimer> | #include <QTimer> | ||||
SendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, | SendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, | ||||
QWidget *parent) | WalletModel *_model, QWidget *parent) | ||||
: QDialog(parent), ui(new Ui::SendCoinsDialog), clientModel(nullptr), | : QDialog(parent), ui(new Ui::SendCoinsDialog), clientModel(nullptr), | ||||
model(nullptr), fNewRecipientAllowed(true), fFeeMinimized(true), | model(_model), fNewRecipientAllowed(true), fFeeMinimized(true), | ||||
platformStyle(_platformStyle) { | platformStyle(_platformStyle) { | ||||
ui->setupUi(this); | ui->setupUi(this); | ||||
if (!_platformStyle->getImagesOnButtons()) { | if (!_platformStyle->getImagesOnButtons()) { | ||||
ui->addButton->setIcon(QIcon()); | ui->addButton->setIcon(QIcon()); | ||||
ui->clearButton->setIcon(QIcon()); | ui->clearButton->setIcon(QIcon()); | ||||
ui->sendButton->setIcon(QIcon()); | ui->sendButton->setIcon(QIcon()); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | ui->groupFee | ||||
->setChecked(true); | ->setChecked(true); | ||||
ui->groupCustomFee->setId(ui->radioCustomPerKilobyte, 0); | ui->groupCustomFee->setId(ui->radioCustomPerKilobyte, 0); | ||||
ui->groupCustomFee->button(0)->setChecked(true); | ui->groupCustomFee->button(0)->setChecked(true); | ||||
ui->customFee->setValue( | ui->customFee->setValue( | ||||
int64_t(settings.value("nTransactionFee").toLongLong()) * SATOSHI); | int64_t(settings.value("nTransactionFee").toLongLong()) * SATOSHI); | ||||
ui->checkBoxMinimumFee->setChecked( | ui->checkBoxMinimumFee->setChecked( | ||||
settings.value("fPayOnlyMinFee").toBool()); | settings.value("fPayOnlyMinFee").toBool()); | ||||
minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool()); | minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool()); | ||||
// Set the model properly. | |||||
setModel(model); | |||||
} | } | ||||
void SendCoinsDialog::setClientModel(ClientModel *_clientModel) { | void SendCoinsDialog::setClientModel(ClientModel *_clientModel) { | ||||
this->clientModel = _clientModel; | this->clientModel = _clientModel; | ||||
if (_clientModel) { | if (_clientModel) { | ||||
connect(_clientModel, | connect(_clientModel, | ||||
SIGNAL(numBlocksChanged(int, QDateTime, double, bool)), this, | SIGNAL(numBlocksChanged(int, QDateTime, double, bool)), this, | ||||
▲ Show 20 Lines • Show All 262 Lines • ▼ Show 20 Lines | void SendCoinsDialog::reject() { | ||||
clear(); | clear(); | ||||
} | } | ||||
void SendCoinsDialog::accept() { | void SendCoinsDialog::accept() { | ||||
clear(); | clear(); | ||||
} | } | ||||
SendCoinsEntry *SendCoinsDialog::addEntry() { | SendCoinsEntry *SendCoinsDialog::addEntry() { | ||||
SendCoinsEntry *entry = new SendCoinsEntry(platformStyle, this); | SendCoinsEntry *entry = new SendCoinsEntry(platformStyle, model, this); | ||||
entry->setModel(model); | |||||
ui->entries->addWidget(entry); | ui->entries->addWidget(entry); | ||||
connect(entry, SIGNAL(removeEntry(SendCoinsEntry *)), this, | connect(entry, SIGNAL(removeEntry(SendCoinsEntry *)), this, | ||||
SLOT(removeEntry(SendCoinsEntry *))); | SLOT(removeEntry(SendCoinsEntry *))); | ||||
connect(entry, SIGNAL(useAvailableBalance(SendCoinsEntry *)), this, | connect(entry, SIGNAL(useAvailableBalance(SendCoinsEntry *)), this, | ||||
SLOT(useAvailableBalance(SendCoinsEntry *))); | SLOT(useAvailableBalance(SendCoinsEntry *))); | ||||
connect(entry, SIGNAL(payAmountChanged()), this, | connect(entry, SIGNAL(payAmountChanged()), this, | ||||
SLOT(coinControlUpdateLabels())); | SLOT(coinControlUpdateLabels())); | ||||
connect(entry, SIGNAL(subtractFeeFromAmountChanged()), this, | connect(entry, SIGNAL(subtractFeeFromAmountChanged()), this, | ||||
▲ Show 20 Lines • Show All 509 Lines • Show Last 20 Lines |