aboutsummaryrefslogtreecommitdiff
path: root/src/qt/addressbookpage.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <[email protected]>2013-01-25 18:46:53 +0100
committerPhilip Kaufmann <[email protected]>2013-03-18 07:44:22 +0100
commit311993ab106c250a1779bfdb649cf4f8c2416fb5 (patch)
tree5a103deacc3066bf1733b843dbfe60186995e0cc /src/qt/addressbookpage.cpp
parentMerge pull request #2210 from Diapolo/Qt_header_cpp_cleanup (diff)
downloaddiscoin-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/addressbookpage.cpp')
-rw-r--r--src/qt/addressbookpage.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp
index b53a37fc2..9e35e51bb 100644
--- a/src/qt/addressbookpage.cpp
+++ b/src/qt/addressbookpage.cpp
@@ -65,6 +65,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
QAction *copyAddressAction = new QAction(ui->copyToClipboard->text(), this);
QAction *copyLabelAction = new QAction(tr("Copy &Label"), this);
QAction *editAction = new QAction(tr("&Edit"), this);
+ QAction *sendCoinsAction = new QAction(tr("Send &Coins"), this);
QAction *showQRCodeAction = new QAction(ui->showQRCode->text(), this);
QAction *signMessageAction = new QAction(ui->signMessage->text(), this);
QAction *verifyMessageAction = new QAction(ui->verifyMessage->text(), this);
@@ -78,6 +79,8 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
if(tab == SendingTab)
contextMenu->addAction(deleteAction);
contextMenu->addSeparator();
+ if(tab == SendingTab)
+ contextMenu->addAction(sendCoinsAction);
#ifdef USE_QRCODE
contextMenu->addAction(showQRCodeAction);
#endif
@@ -91,6 +94,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(onCopyLabelAction()));
connect(editAction, SIGNAL(triggered()), this, SLOT(onEditAction()));
connect(deleteAction, SIGNAL(triggered()), this, SLOT(on_deleteButton_clicked()));
+ connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(onSendCoins_clicked()));
connect(showQRCodeAction, SIGNAL(triggered()), this, SLOT(on_showQRCode_clicked()));
connect(signMessageAction, SIGNAL(triggered()), this, SLOT(on_signMessage_clicked()));
connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(on_verifyMessage_clicked()));
@@ -206,6 +210,18 @@ void AddressBookPage::on_verifyMessage_clicked()
}
}
+void AddressBookPage::onSendCoins_clicked()
+{
+ QTableView *table = ui->tableView;
+ QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address);
+
+ foreach (QModelIndex index, indexes)
+ {
+ QString address = index.data().toString();
+ emit sendCoins(address);
+ }
+}
+
void AddressBookPage::on_newAddressButton_clicked()
{
if(!model)