Merge pull request #1467

abccad8 Keys: allow keys to be copied separately (stoffu)
This commit is contained in:
luigi1111 2018-08-02 13:58:49 -05:00
commit 06bbda0c99
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -148,27 +148,40 @@ Rectangle {
opacity: Style.dividerOpacity opacity: Style.dividerOpacity
Layout.bottomMargin: 10 * scaleRatio Layout.bottomMargin: 10 * scaleRatio
} }
TextEdit { LineEdit {
id: keysText Layout.fillWidth: true
wrapMode: TextEdit.Wrap id: secretViewKey
Layout.fillWidth: true;
font.pixelSize: 14 * scaleRatio
textFormat: TextEdit.RichText
readOnly: true readOnly: true
color: Style.defaultFontColor copyButton: true
MouseArea { labelText: qsTr("Secret view key") + translationManager.emptyString
anchors.fill: parent fontSize: 16 * scaleRatio
onClicked: {
appWindow.showStatusMessage(qsTr("Double tap to copy"),3)
} }
onDoubleClicked: { LineEdit {
parent.selectAll() Layout.fillWidth: true
parent.copy() Layout.topMargin: 25 * scaleRatio
parent.deselect() id: publicViewKey
console.log("copied to clipboard"); readOnly: true
appWindow.showStatusMessage(qsTr("Keys copied to clipboard"),3) copyButton: true
labelText: qsTr("Public view key") + translationManager.emptyString
fontSize: 16 * scaleRatio
} }
LineEdit {
Layout.fillWidth: true
Layout.topMargin: 25 * scaleRatio
id: secretSpendKey
readOnly: true
copyButton: true
labelText: qsTr("Secret spend key") + translationManager.emptyString
fontSize: 16 * scaleRatio
} }
LineEdit {
Layout.fillWidth: true
Layout.topMargin: 25 * scaleRatio
id: publicSpendKey
readOnly: true
copyButton: true
labelText: qsTr("Public spend key") + translationManager.emptyString
fontSize: 16 * scaleRatio
} }
} }
@ -246,10 +259,10 @@ Rectangle {
function onPageCompleted() { function onPageCompleted() {
console.log("keys page loaded"); console.log("keys page loaded");
keysText.text = "<b>" + qsTr("Secret view key") + ":</b> " + currentWallet.secretViewKey secretViewKey.text = currentWallet.secretViewKey
keysText.text += "<br><br><b>" + qsTr("Public view key") + ":</b> " + currentWallet.publicViewKey publicViewKey.text = currentWallet.publicViewKey
keysText.text += (!currentWallet.viewOnly) ? "<br><br><b>" + qsTr("Secret spend key") + ":</b> " + currentWallet.secretSpendKey : "" secretSpendKey.text = (!currentWallet.viewOnly) ? currentWallet.secretSpendKey : ""
keysText.text += "<br><br><b>" + qsTr("Public spend key") + ":</b> " + currentWallet.publicSpendKey publicSpendKey.text = currentWallet.publicSpendKey
seedText.text = currentWallet.seed seedText.text = currentWallet.seed