| 740 | } |
| 741 | |
| 742 | void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg) |
| 743 | { |
| 744 | QPair<QString, CClientUIInterface::MessageBoxFlags> msgParams; |
| 745 | // Default to a warning message, override if error message is needed |
| 746 | msgParams.second = CClientUIInterface::MSG_WARNING; |
| 747 | |
| 748 | // This comment is specific to SendCoinsDialog usage of WalletModel::SendCoinsReturn. |
| 749 | // All status values are used only in WalletModel::prepareTransaction() |
| 750 | switch(sendCoinsReturn.status) |
| 751 | { |
| 752 | case WalletModel::InvalidAddress: |
| 753 | msgParams.first = tr("The recipient address is not valid. Please recheck."); |
| 754 | break; |
| 755 | case WalletModel::InvalidAmount: |
| 756 | msgParams.first = tr("The amount to pay must be larger than 0."); |
| 757 | break; |
| 758 | case WalletModel::AmountExceedsBalance: |
| 759 | msgParams.first = tr("The amount exceeds your balance."); |
| 760 | break; |
| 761 | case WalletModel::AmountWithFeeExceedsBalance: |
| 762 | msgParams.first = tr("The total exceeds your balance when the %1 transaction fee is included.").arg(msgArg); |
| 763 | break; |
| 764 | case WalletModel::DuplicateAddress: |
| 765 | msgParams.first = tr("Duplicate address found: addresses should only be used once each."); |
| 766 | break; |
| 767 | case WalletModel::TransactionCreationFailed: |
| 768 | msgParams.first = tr("Transaction creation failed!"); |
| 769 | msgParams.second = CClientUIInterface::MSG_ERROR; |
| 770 | break; |
| 771 | case WalletModel::AbsurdFee: |
| 772 | msgParams.first = tr("A fee higher than %1 is considered an absurdly high fee.").arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), model->wallet().getDefaultMaxTxFee())); |
| 773 | break; |
| 774 | case WalletModel::PaymentRequestExpired: |
| 775 | msgParams.first = tr("Payment request expired."); |
| 776 | msgParams.second = CClientUIInterface::MSG_ERROR; |
| 777 | break; |
| 778 | // included to prevent a compiler warning. |
| 779 | case WalletModel::OK: |
| 780 | default: |
| 781 | return; |
| 782 | } |
| 783 | |
| 784 | Q_EMIT message(tr("Send Coins"), msgParams.first, msgParams.second); |
| 785 | } |
| 786 | |
| 787 | void SendCoinsDialog::minimizeFeeSection(bool fMinimize) |
| 788 | { |
nothing calls this directly
no test coverage detected