Browse Source

invoke paper wallet

pull/29/head
orignal 7 years ago
parent
commit
398171c2b9
  1. 11
      src/qt/bitcoingui.cpp
  2. 4
      src/qt/bitcoingui.h
  3. 2
      src/qt/res/html/paperwallet.html
  4. 7
      src/qt/walletframe.cpp
  5. 5
      src/qt/walletframe.h
  6. 11
      src/qt/walletview.cpp
  7. 7
      src/qt/walletview.h

11
src/qt/bitcoingui.cpp

@ -258,6 +258,13 @@ void BitcoinGUI::createActions() @@ -258,6 +258,13 @@ void BitcoinGUI::createActions()
connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase()));
connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab()));
connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab()));
#ifdef USE_QRCODE
printPaperWalletAction = new QAction(QIcon(":/icons/key"), tr("&Print paper wallet..."), this);
printPaperWalletAction->setIconVisibleInMenu(true);
printPaperWalletAction->setStatusTip(tr("Generate new address and print"));
connect(printPaperWalletAction, SIGNAL(triggered()), walletFrame, SLOT(printPaperWallet()));
#endif
}
void BitcoinGUI::createMenuBar()
@ -276,6 +283,10 @@ void BitcoinGUI::createMenuBar() @@ -276,6 +283,10 @@ void BitcoinGUI::createMenuBar()
file->addAction(signMessageAction);
file->addAction(verifyMessageAction);
file->addSeparator();
#ifdef USE_QRCODE
file->addAction(printPaperWalletAction);
file->addSeparator();
#endif
file->addAction(quitAction);
QMenu *settings = appMenuBar->addMenu(tr("&Settings"));

4
src/qt/bitcoingui.h

@ -105,7 +105,9 @@ private: @@ -105,7 +105,9 @@ private:
QAction *changePassphraseAction;
QAction *aboutQtAction;
QAction *openRPCConsoleAction;
#ifdef USE_QRCODE
QAction *printPaperWalletAction;
#endif
QSystemTrayIcon *trayIcon;
Notificator *notificator;
TransactionView *transactionView;

2
src/qt/res/html/paperwallet.html

@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
<tr>
<td width="200">
<div style="display: inline-block;">
<img src=":/icons/che_cash_print" width="160" height="107">
<img src=":/icons/gostcoin" width="107" height="107">
</div>
</td>
<td>

7
src/qt/walletframe.cpp

@ -147,6 +147,13 @@ void WalletFrame::unlockWallet() @@ -147,6 +147,13 @@ void WalletFrame::unlockWallet()
walletView->unlockWallet();
}
void WalletFrame::printPaperWallet()
{
WalletView *walletView = currentWalletView();
if (walletView)
walletView->printPaperWallet();
}
void WalletFrame::setEncryptionStatus()
{
WalletView *walletView = currentWalletView();

5
src/qt/walletframe.h

@ -67,6 +67,11 @@ public slots: @@ -67,6 +67,11 @@ public slots:
/** Ask for passphrase to unlock wallet temporarily */
void unlockWallet();
#ifdef USE_QRCODE
/** Print paper wallet addresses */
void printPaperWallet();
#endif
/** Set the encryption status as shown in the UI.
@param[in] status current encryption status
@see WalletModel::EncryptionStatus

11
src/qt/walletview.cpp

@ -18,6 +18,10 @@ @@ -18,6 +18,10 @@
#include "askpassphrasedialog.h"
#include "ui_interface.h"
#ifdef USE_QRCODE
#include "paperwallet.h"
#endif
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QAction>
@ -272,3 +276,10 @@ void WalletView::unlockWallet() @@ -272,3 +276,10 @@ void WalletView::unlockWallet()
dlg.exec();
}
}
#ifdef USE_QRCODE
void WalletView::printPaperWallet()
{
PrintPaperWallet (this);
}
#endif

7
src/qt/walletview.h

@ -82,7 +82,7 @@ public slots: @@ -82,7 +82,7 @@ public slots:
/** Show Sign/Verify Message dialog and switch to sign message tab */
void gotoSignMessageTab(QString addr = "");
/** Show Sign/Verify Message dialog and switch to verify message tab */
void gotoVerifyMessageTab(QString addr = "");
void gotoVerifyMessageTab(QString addr = "");
/** Show incoming transaction notification for new transactions.
@ -98,6 +98,11 @@ public slots: @@ -98,6 +98,11 @@ public slots:
/** Ask for passphrase to unlock wallet temporarily */
void unlockWallet();
#ifdef USE_QRCODE
/** Print paper wallet addresses */
void printPaperWallet();
#endif
void setEncryptionStatus();
};

Loading…
Cancel
Save