Add a menu option to verify a signed message

(Also move 'setAttribute(Qt::WA_DeleteOnClose)' out of QRCodeDialog)
This commit is contained in:
sje397
2012-02-27 22:55:04 +11:00
parent 97521b5257
commit 0c587936c7
8 changed files with 283 additions and 4 deletions

View File

@@ -9,6 +9,7 @@
#include "addressbookpage.h"
#include "sendcoinsdialog.h"
#include "messagepage.h"
#include "verifymessagedialog.h"
#include "optionsdialog.h"
#include "aboutdialog.h"
#include "clientmodel.h"
@@ -255,6 +256,8 @@ void BitcoinGUI::createActions()
changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption"));
openRPCConsoleAction = new QAction(tr("&Debug window"), this);
openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console"));
verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this);
verifyMessageAction->setToolTip(tr("Verify a message signature"));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
@@ -264,6 +267,7 @@ void BitcoinGUI::createActions()
connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool)));
connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet()));
connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase()));
connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(verifyMessage()));
}
void BitcoinGUI::createMenuBar()
@@ -283,6 +287,7 @@ void BitcoinGUI::createMenuBar()
#ifndef FIRST_CLASS_MESSAGING
file->addAction(messageAction);
#endif
file->addAction(verifyMessageAction);
file->addSeparator();
file->addAction(quitAction);
@@ -405,6 +410,7 @@ void BitcoinGUI::createTrayIcon()
trayIconMenu->addAction(openRPCConsoleAction);
trayIconMenu->addSeparator();
trayIconMenu->addAction(messageAction);
trayIconMenu->addAction(verifyMessageAction);
#ifndef FIRST_CLASS_MESSAGING
trayIconMenu->addSeparator();
#endif
@@ -836,6 +842,13 @@ void BitcoinGUI::changePassphrase()
dlg.exec();
}
void BitcoinGUI::verifyMessage()
{
VerifyMessageDialog *dlg = new VerifyMessageDialog(walletModel->getAddressTableModel(), this);
dlg->setAttribute(Qt::WA_DeleteOnClose);
dlg->show();
}
void BitcoinGUI::unlockWallet()
{
if(!walletModel)