diff options
| author | Riccardo Spagni <ric@spagni.net> | 2017-05-05 11:48:03 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2017-05-05 11:48:03 +0200 |
| commit | 58f24efd3978f78863dc4402783c1d2b751ad87c (patch) | |
| tree | f11f50c5ae007e98b18522dc390c2501748e75d4 | |
| parent | 24bd3010bf41bce7a5a89e8cae5b74d55c2d5d6c (diff) | |
| parent | f31b27d3fd02c4d87c4cfdea87ae84685d04f430 (diff) | |
| download | monzero-gui-58f24efd3978f78863dc4402783c1d2b751ad87c.tar.gz monzero-gui-58f24efd3978f78863dc4402783c1d2b751ad87c.tar.xz monzero-gui-58f24efd3978f78863dc4402783c1d2b751ad87c.zip | |
Merge pull request #702
f31b27d add wallet view/spend keys to seed dialog requires #2012 (Jaquee)
| -rw-r--r-- | pages/Settings.qml | 33 | ||||
| -rw-r--r-- | src/libwalletqt/Wallet.h | 10 |
2 files changed, 37 insertions, 6 deletions
diff --git a/pages/Settings.qml b/pages/Settings.qml index 9301a92e..d4f0ce23 100644 --- a/pages/Settings.qml +++ b/pages/Settings.qml @@ -116,7 +116,7 @@ Rectangle { shadowPressedColor: "#B32D00" releasedColor: "#FF6C3C" pressedColor: "#FF4304" - text: qsTr("Show seed") + translationManager.emptyString + text: qsTr("Show seed & keys") + translationManager.emptyString onClicked: { settingsPasswordDialog.open(); } @@ -413,11 +413,17 @@ Rectangle { onAccepted: { if(appWindow.password === settingsPasswordDialog.password){ - informationPopup.title = qsTr("Wallet mnemonic seed") + translationManager.emptyString; - informationPopup.text = currentWallet.seed - informationPopup.open() - informationPopup.onCloseCallback = function() { - informationPopup.text = "" + seedPopup.title = qsTr("Wallet seed & keys") + translationManager.emptyString; + seedPopup.text = "<b>Wallet Mnemonic seed</b> <br>" + currentWallet.seed + + "<br><br> <b>" + qsTr("Secret view key") + ":</b> " + currentWallet.secretViewKey + + "<br><b>" + qsTr("Public view key") + ":</b> " + currentWallet.publicViewKey + + "<br><b>" + qsTr("Secret spend key") + ":</b> " + currentWallet.secretSpendKey + + "<br><b>" + qsTr("Public spend key") + ":</b> " + currentWallet.publicSpendKey + seedPopup.open() + seedPopup.width = 600 + seedPopup.height = 300 + seedPopup.onCloseCallback = function() { + seedPopup.text = "" } } else { @@ -437,6 +443,21 @@ Rectangle { } + StandardDialog { + id: seedPopup + cancelVisible: false + okVisible: true + width:600 + height:400 + + property var onCloseCallback + onAccepted: { + if (onCloseCallback) { + onCloseCallback() + } + } + } + // fires on every page load function onPageCompleted() { console.log("Settings page loaded"); diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index 9477f896..1224b24d 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -41,6 +41,10 @@ class Wallet : public QObject Q_PROPERTY(AddressBookModel * addressBookModel READ addressBookModel) Q_PROPERTY(AddressBook * addressBook READ addressBook) Q_PROPERTY(bool viewOnly READ viewOnly) + Q_PROPERTY(QString secretViewKey READ getSecretViewKey) + Q_PROPERTY(QString publicViewKey READ getPublicViewKey) + Q_PROPERTY(QString secretSpendKey READ getSecretSpendKey) + Q_PROPERTY(QString publicSpendKey READ getPublicSpendKey) public: @@ -231,6 +235,12 @@ public: // check if fork rules should be used Q_INVOKABLE bool useForkRules(quint8 version, quint64 earlyBlocks = 0) const; + //! Get wallet keys + QString getSecretViewKey() const {return QString::fromStdString(m_walletImpl->secretViewKey());} + QString getPublicViewKey() const {return QString::fromStdString(m_walletImpl->publicViewKey());} + QString getSecretSpendKey() const {return QString::fromStdString(m_walletImpl->secretSpendKey());} + QString getPublicSpendKey() const {return QString::fromStdString(m_walletImpl->publicSpendKey());} + // TODO: setListenter() when it implemented in API signals: // emitted on every event happened with wallet |
