diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2011-12-23 10:14:57 -0500 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-01-27 08:41:55 +0100 |
commit | 2bc4fd609ca00d5a5cb0b6b3eba5f35cb334b967 (patch) | |
tree | 79eb64f0322a6b6fadaa72cbce3b3fc369a2a007 /src/qt/addressbookpage.cpp | |
parent | 70f55355e29c8e45b607e782c5d76609d23cc858 (diff) |
Bitcoin-Qt signmessage GUI (pull request #582)
Diffstat (limited to 'src/qt/addressbookpage.cpp')
-rw-r--r-- | src/qt/addressbookpage.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 91412fcc18..b5a798ca31 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -2,6 +2,7 @@ #include "ui_addressbookpage.h" #include "addresstablemodel.h" +#include "bitcoingui.h" #include "editaddressdialog.h" #include "csvmodelwriter.h" #include "guiutil.h" @@ -156,6 +157,24 @@ void AddressBookPage::onEditAction() dlg.exec(); } +void AddressBookPage::on_signMessage_clicked() +{ + QTableView *table = ui->tableView; + QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address); + QString addr; + + foreach (QModelIndex index, indexes) + { + QVariant address = index.data(); + addr = address.toString(); + } + + QObject *qoGUI = parent()->parent(); + BitcoinGUI *gui = qobject_cast<BitcoinGUI *>(qoGUI); + if (gui) + gui->gotoMessagePage(addr); +} + void AddressBookPage::on_newAddressButton_clicked() { if(!model) @@ -207,11 +226,13 @@ void AddressBookPage::selectionChanged() // In sending tab, allow deletion of selection ui->deleteButton->setEnabled(true); deleteAction->setEnabled(true); + ui->signMessage->setEnabled(false); break; case ReceivingTab: // Deleting receiving addresses, however, is not allowed ui->deleteButton->setEnabled(false); deleteAction->setEnabled(false); + ui->signMessage->setEnabled(true); break; } ui->copyToClipboard->setEnabled(true); @@ -222,6 +243,7 @@ void AddressBookPage::selectionChanged() ui->deleteButton->setEnabled(false); ui->showQRCode->setEnabled(false); ui->copyToClipboard->setEnabled(false); + ui->signMessage->setEnabled(false); } } |