aboutsummaryrefslogtreecommitdiff
path: root/src/qt/sendcoinsdialog.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-01-25 18:46:53 +0100
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2013-03-18 07:44:22 +0100
commit311993ab106c250a1779bfdb649cf4f8c2416fb5 (patch)
tree5a103deacc3066bf1733b843dbfe60186995e0cc /src/qt/sendcoinsdialog.cpp
parent74e4d80068f9c29d4891439332b4027328c8584b (diff)
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.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index 56392f96dd..2133a5e729 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)