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()
connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase())); connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase()));
connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab()));
connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); 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() void BitcoinGUI::createMenuBar()
@ -276,6 +283,10 @@ void BitcoinGUI::createMenuBar()
file->addAction(signMessageAction); file->addAction(signMessageAction);
file->addAction(verifyMessageAction); file->addAction(verifyMessageAction);
file->addSeparator(); file->addSeparator();
#ifdef USE_QRCODE
file->addAction(printPaperWalletAction);
file->addSeparator();
#endif
file->addAction(quitAction); file->addAction(quitAction);
QMenu *settings = appMenuBar->addMenu(tr("&Settings")); QMenu *settings = appMenuBar->addMenu(tr("&Settings"));

4
src/qt/bitcoingui.h

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

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

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

7
src/qt/walletframe.cpp

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

5
src/qt/walletframe.h

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

11
src/qt/walletview.cpp

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

7
src/qt/walletview.h

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

Loading…
Cancel
Save