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
This commit is contained in:
Philip Kaufmann
2013-01-25 18:46:53 +01:00
parent 74e4d80068
commit 311993ab10
8 changed files with 56 additions and 4 deletions

View File

@@ -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)