diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-07-07 04:59:04 -0700 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-07-07 04:59:04 -0700 |
commit | 249856d557d05aaf293aba80eab95c3dd312dd26 (patch) | |
tree | 6c32a0ddfa1df2839a2be574ef0af4e4c83b4d95 /src/qt/addressbookpage.cpp | |
parent | 520198138ae1591e61dc89b43e5b3f3a297473a9 (diff) | |
parent | 47894585aeaa4f5475c50bc4415ed6ced868fbf7 (diff) |
Merge pull request #1469 from Diapolo/signverifymessagedialog
GUI: merge sign/verify message into a single window with tabbed UI
Diffstat (limited to 'src/qt/addressbookpage.cpp')
-rw-r--r-- | src/qt/addressbookpage.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 663ff68669..e502d9bc31 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -67,6 +67,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : QAction *editAction = new QAction(tr("&Edit"), 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); deleteAction = new QAction(ui->deleteButton->text(), this); // Build context menu @@ -80,6 +81,8 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : contextMenu->addAction(showQRCodeAction); if(tab == ReceivingTab) contextMenu->addAction(signMessageAction); + else if(tab == SendingTab) + contextMenu->addAction(verifyMessageAction); // Connect signals for context menu actions connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(on_copyToClipboard_clicked())); @@ -88,6 +91,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : connect(deleteAction, SIGNAL(triggered()), this, SLOT(on_deleteButton_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())); connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); @@ -189,7 +193,25 @@ void AddressBookPage::on_signMessage_clicked() QObject *qoGUI = parent()->parent(); BitcoinGUI *gui = qobject_cast<BitcoinGUI *>(qoGUI); if (gui) - gui->gotoMessagePage(addr); + gui->gotoSignMessageTab(addr); +} + +void AddressBookPage::on_verifyMessage_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->gotoVerifyMessageTab(addr); } void AddressBookPage::on_newAddressButton_clicked() @@ -237,6 +259,8 @@ void AddressBookPage::selectionChanged() deleteAction->setEnabled(true); ui->signMessage->setEnabled(false); ui->signMessage->setVisible(false); + ui->verifyMessage->setEnabled(true); + ui->verifyMessage->setVisible(true); break; case ReceivingTab: // Deleting receiving addresses, however, is not allowed @@ -245,6 +269,8 @@ void AddressBookPage::selectionChanged() deleteAction->setEnabled(false); ui->signMessage->setEnabled(true); ui->signMessage->setVisible(true); + ui->verifyMessage->setEnabled(false); + ui->verifyMessage->setVisible(false); break; } ui->copyToClipboard->setEnabled(true); @@ -256,6 +282,7 @@ void AddressBookPage::selectionChanged() ui->showQRCode->setEnabled(false); ui->copyToClipboard->setEnabled(false); ui->signMessage->setEnabled(false); + ui->verifyMessage->setEnabled(false); } } |