Changeset View
Changeset View
Standalone View
Standalone View
src/qt/sendcoinsdialog.cpp
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | if (_model && _model->getOptionsModel()) { | ||||
SendCoinsEntry *entry = qobject_cast<SendCoinsEntry *>( | SendCoinsEntry *entry = qobject_cast<SendCoinsEntry *>( | ||||
ui->entries->itemAt(i)->widget()); | ui->entries->itemAt(i)->widget()); | ||||
if (entry) { | if (entry) { | ||||
entry->setModel(_model); | entry->setModel(_model); | ||||
} | } | ||||
} | } | ||||
interfaces::WalletBalances balances = _model->wallet().getBalances(); | interfaces::WalletBalances balances = _model->wallet().getBalances(); | ||||
setBalance(balances.balance, balances.unconfirmed_balance, | setBalance(balances); | ||||
balances.immature_balance, balances.watch_only_balance, | connect(_model, SIGNAL(balanceChanged(interfaces::WalletBalances)), | ||||
balances.unconfirmed_watch_only_balance, | this, SLOT(setBalance(interfaces::WalletBalances))); | ||||
balances.immature_watch_only_balance); | |||||
connect( | |||||
_model, | |||||
SIGNAL( | |||||
balanceChanged(Amount, Amount, Amount, Amount, Amount, Amount)), | |||||
this, | |||||
SLOT(setBalance(Amount, Amount, Amount, Amount, Amount, Amount))); | |||||
connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), | connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), | ||||
this, SLOT(updateDisplayUnit())); | this, SLOT(updateDisplayUnit())); | ||||
updateDisplayUnit(); | updateDisplayUnit(); | ||||
// Coin Control | // Coin Control | ||||
connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), | connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), | ||||
this, SLOT(coinControlUpdateLabels())); | this, SLOT(coinControlUpdateLabels())); | ||||
connect(_model->getOptionsModel(), | connect(_model->getOptionsModel(), | ||||
▲ Show 20 Lines • Show All 338 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
bool SendCoinsDialog::handlePaymentRequest(const SendCoinsRecipient &rv) { | bool SendCoinsDialog::handlePaymentRequest(const SendCoinsRecipient &rv) { | ||||
// Just paste the entry, all pre-checks are done in paymentserver.cpp. | // Just paste the entry, all pre-checks are done in paymentserver.cpp. | ||||
pasteEntry(rv); | pasteEntry(rv); | ||||
return true; | return true; | ||||
} | } | ||||
void SendCoinsDialog::setBalance(const Amount balance, | void SendCoinsDialog::setBalance(const interfaces::WalletBalances &balances) { | ||||
const Amount unconfirmedBalance, | |||||
const Amount immatureBalance, | |||||
const Amount watchBalance, | |||||
const Amount watchUnconfirmedBalance, | |||||
const Amount watchImmatureBalance) { | |||||
Q_UNUSED(unconfirmedBalance); | |||||
Q_UNUSED(immatureBalance); | |||||
Q_UNUSED(watchBalance); | |||||
Q_UNUSED(watchUnconfirmedBalance); | |||||
Q_UNUSED(watchImmatureBalance); | |||||
if (model && model->getOptionsModel()) { | if (model && model->getOptionsModel()) { | ||||
ui->labelBalance->setText(BitcoinUnits::formatWithUnit( | ui->labelBalance->setText(BitcoinUnits::formatWithUnit( | ||||
model->getOptionsModel()->getDisplayUnit(), balance)); | model->getOptionsModel()->getDisplayUnit(), balances.balance)); | ||||
} | } | ||||
} | } | ||||
void SendCoinsDialog::updateDisplayUnit() { | void SendCoinsDialog::updateDisplayUnit() { | ||||
setBalance(model->wallet().getBalance(), Amount::zero(), Amount::zero(), | setBalance(model->wallet().getBalances()); | ||||
Amount::zero(), Amount::zero(), Amount::zero()); | |||||
ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit()); | ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit()); | ||||
updateMinFeeLabel(); | updateMinFeeLabel(); | ||||
updateSmartFeeLabel(); | updateSmartFeeLabel(); | ||||
} | } | ||||
void SendCoinsDialog::processSendCoinsReturn( | void SendCoinsDialog::processSendCoinsReturn( | ||||
const WalletModel::SendCoinsReturn &sendCoinsReturn, | const WalletModel::SendCoinsReturn &sendCoinsReturn, | ||||
const QString &msgArg) { | const QString &msgArg) { | ||||
▲ Show 20 Lines • Show All 395 Lines • Show Last 20 Lines |