aboutsummaryrefslogtreecommitdiff
path: root/src/qt/addressbookpage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/addressbookpage.cpp')
-rw-r--r--src/qt/addressbookpage.cpp22
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);
}
}