diff options
| author | Philip Kaufmann <[email protected]> | 2013-01-25 18:46:53 +0100 |
|---|---|---|
| committer | Philip Kaufmann <[email protected]> | 2013-03-18 07:44:22 +0100 |
| commit | 311993ab106c250a1779bfdb649cf4f8c2416fb5 (patch) | |
| tree | 5a103deacc3066bf1733b843dbfe60186995e0cc /src/qt/sendcoinsdialog.cpp | |
| parent | Merge pull request #2210 from Diapolo/Qt_header_cpp_cleanup (diff) | |
| download | discoin-311993ab106c250a1779bfdb649cf4f8c2416fb5.tar.xz discoin-311993ab106c250a1779bfdb649cf4f8c2416fb5.zip | |
Bitcoin-Qt: add "send coins" to context menu in addressbook
- allows to directly select an address from the addressbook, chose "send
coins" from the context menu, which sends you to sendcoins tab and fills
in the selected address
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
| -rw-r--r-- | src/qt/sendcoinsdialog.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 56392f96d..2133a5e72 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -245,6 +245,26 @@ QWidget *SendCoinsDialog::setupTabChain(QWidget *prev) return ui->sendButton; } +void SendCoinsDialog::setAddress(const QString &address) +{ + SendCoinsEntry *entry = 0; + // Replace the first entry if it is still unused + if(ui->entries->count() == 1) + { + SendCoinsEntry *first = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(0)->widget()); + if(first->isClear()) + { + entry = first; + } + } + if(!entry) + { + entry = addEntry(); + } + + entry->setAddress(address); +} + void SendCoinsDialog::pasteEntry(const SendCoinsRecipient &rv) { if(!fNewRecipientAllowed) |