Changeset View
Changeset View
Standalone View
Standalone View
src/qt/sendcoinsdialog.cpp
Show First 20 Lines • Show All 563 Lines • ▼ Show 20 Lines | void SendCoinsDialog::processSendCoinsReturn( | ||||
const WalletModel::SendCoinsReturn &sendCoinsReturn, | const WalletModel::SendCoinsReturn &sendCoinsReturn, | ||||
const QString &msgArg) { | const QString &msgArg) { | ||||
QPair<QString, CClientUIInterface::MessageBoxFlags> msgParams; | QPair<QString, CClientUIInterface::MessageBoxFlags> msgParams; | ||||
// Default to a warning message, override if error message is needed | // Default to a warning message, override if error message is needed | ||||
msgParams.second = CClientUIInterface::MSG_WARNING; | msgParams.second = CClientUIInterface::MSG_WARNING; | ||||
// This comment is specific to SendCoinsDialog usage of | // This comment is specific to SendCoinsDialog usage of | ||||
// WalletModel::SendCoinsReturn. | // WalletModel::SendCoinsReturn. | ||||
// WalletModel::TransactionCommitFailed is used only in | // All status values are used only in WalletModel::prepareTransaction() | ||||
// WalletModel::sendCoins() all others are used only in | |||||
// WalletModel::prepareTransaction() | |||||
switch (sendCoinsReturn.status) { | switch (sendCoinsReturn.status) { | ||||
case WalletModel::InvalidAddress: | case WalletModel::InvalidAddress: | ||||
msgParams.first = | msgParams.first = | ||||
tr("The recipient address is not valid. Please recheck."); | tr("The recipient address is not valid. Please recheck."); | ||||
break; | break; | ||||
case WalletModel::InvalidAmount: | case WalletModel::InvalidAmount: | ||||
msgParams.first = tr("The amount to pay must be larger than 0."); | msgParams.first = tr("The amount to pay must be larger than 0."); | ||||
break; | break; | ||||
case WalletModel::AmountExceedsBalance: | case WalletModel::AmountExceedsBalance: | ||||
msgParams.first = tr("The amount exceeds your balance."); | msgParams.first = tr("The amount exceeds your balance."); | ||||
break; | break; | ||||
case WalletModel::AmountWithFeeExceedsBalance: | case WalletModel::AmountWithFeeExceedsBalance: | ||||
msgParams.first = tr("The total exceeds your balance when the %1 " | msgParams.first = tr("The total exceeds your balance when the %1 " | ||||
"transaction fee is included.") | "transaction fee is included.") | ||||
.arg(msgArg); | .arg(msgArg); | ||||
break; | break; | ||||
case WalletModel::DuplicateAddress: | case WalletModel::DuplicateAddress: | ||||
msgParams.first = tr("Duplicate address found: addresses should " | msgParams.first = tr("Duplicate address found: addresses should " | ||||
"only be used once each."); | "only be used once each."); | ||||
break; | break; | ||||
case WalletModel::TransactionCreationFailed: | case WalletModel::TransactionCreationFailed: | ||||
msgParams.first = tr("Transaction creation failed!"); | msgParams.first = tr("Transaction creation failed!"); | ||||
msgParams.second = CClientUIInterface::MSG_ERROR; | msgParams.second = CClientUIInterface::MSG_ERROR; | ||||
break; | break; | ||||
case WalletModel::TransactionCommitFailed: | |||||
msgParams.first = | |||||
tr("The transaction was rejected with the following reason: %1") | |||||
.arg(sendCoinsReturn.reasonCommitFailed); | |||||
msgParams.second = CClientUIInterface::MSG_ERROR; | |||||
break; | |||||
case WalletModel::AbsurdFee: | case WalletModel::AbsurdFee: | ||||
msgParams.first = | msgParams.first = | ||||
tr("A fee higher than %1 is considered an absurdly high fee.") | tr("A fee higher than %1 is considered an absurdly high fee.") | ||||
.arg(BitcoinUnits::formatWithUnit( | .arg(BitcoinUnits::formatWithUnit( | ||||
model->getOptionsModel()->getDisplayUnit(), | model->getOptionsModel()->getDisplayUnit(), | ||||
model->wallet().getDefaultMaxTxFee())); | model->wallet().getDefaultMaxTxFee())); | ||||
break; | break; | ||||
case WalletModel::PaymentRequestExpired: | case WalletModel::PaymentRequestExpired: | ||||
▲ Show 20 Lines • Show All 352 Lines • Show Last 20 Lines |