diff options
| author | chromatic <[email protected]> | 2021-04-21 16:35:06 -0700 |
|---|---|---|
| committer | chromatic <[email protected]> | 2021-05-23 19:37:09 -0700 |
| commit | 0565a85c7cd8df3ea3cfee2a5a9f252b870408ad (patch) | |
| tree | 4006f4d38b76df9d9f5c49e3563c730478889db5 /src/qt/walletview.cpp | |
| parent | Merge pull request #1976 from langerhans/1.14.4-travis-pgsql (diff) | |
| download | discoin-0565a85c7cd8df3ea3cfee2a5a9f252b870408ad.tar.xz discoin-0565a85c7cd8df3ea3cfee2a5a9f252b870408ad.zip | |
Add GUI to import private keys
Addresses GH #1808.
There are several possible future improvements:
* add a new icon for key import
* reduce duplication of code between the RPC private key importer and
the GUI private key importer
* improving error messages for various error states
Diffstat (limited to 'src/qt/walletview.cpp')
| -rw-r--r-- | src/qt/walletview.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index e7a1753ef..7474b7dc3 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -9,6 +9,7 @@ #include "bitcoingui.h" #include "clientmodel.h" #include "guiutil.h" +#include "importkeysdialog.h" #include "optionsmodel.h" #include "overviewpage.h" #include "platformstyle.h" @@ -65,6 +66,8 @@ WalletView::WalletView(const PlatformStyle *_platformStyle, QWidget *parent): addWidget(receiveCoinsPage); addWidget(sendCoinsPage); + importKeysDialog = new ImportKeysDialog(platformStyle); + // Clicking on a transaction on the overview pre-selects the transaction on the transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); connect(overviewPage, SIGNAL(outOfSyncWarningClicked()), this, SLOT(requestedSyncWarningInfo())); @@ -217,6 +220,11 @@ void WalletView::gotoVerifyMessageTab(QString addr) signVerifyMessageDialog->setAddress_VM(addr); } +void WalletView::gotoImportKeysDialog() +{ + setCurrentWidget(importKeysDialog); +} + bool WalletView::handlePaymentRequest(const SendCoinsRecipient& recipient) { return sendCoinsPage->handlePaymentRequest(recipient); @@ -302,6 +310,16 @@ void WalletView::usedReceivingAddresses() usedReceivingAddressesPage->activateWindow(); } +void WalletView::importPrivateKey() +{ + if(!walletModel) + return; + + importKeysDialog->show(); + importKeysDialog->raise(); + importKeysDialog->activateWindow(); +} + void WalletView::showProgress(const QString &title, int nProgress) { if (nProgress == 0) |