qml: add show seed on WalletDetails.qml
This commit is contained in:
@@ -174,6 +174,46 @@ Pane {
|
|||||||
visible: Daemon.currentWallet
|
visible: Daemon.currentWallet
|
||||||
columns: 2
|
columns: 2
|
||||||
|
|
||||||
|
Label {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
visible: Daemon.currentWallet.hasSeed
|
||||||
|
text: qsTr('Seed')
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
|
||||||
|
TextHighlightPane {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
visible: Daemon.currentWallet.hasSeed
|
||||||
|
RowLayout {
|
||||||
|
width: parent.width
|
||||||
|
Label {
|
||||||
|
id: seedText
|
||||||
|
visible: false
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: Daemon.currentWallet.seed
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
font.family: FixedFont
|
||||||
|
font.pixelSize: constants.fontSizeMedium
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
id: showSeedText
|
||||||
|
Layout.fillWidth: true
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
text: qsTr('Tap to show seed')
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
font.pixelSize: constants.fontSizeLarge
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
seedText.visible = true
|
||||||
|
showSeedText.visible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
Layout.columnSpan: 2
|
Layout.columnSpan: 2
|
||||||
visible: Daemon.currentWallet.isLightning
|
visible: Daemon.currentWallet.isLightning
|
||||||
|
|||||||
@@ -316,6 +316,13 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
|
|||||||
def hasSeed(self):
|
def hasSeed(self):
|
||||||
return self.wallet.has_seed()
|
return self.wallet.has_seed()
|
||||||
|
|
||||||
|
@pyqtProperty(str, notify=dataChanged)
|
||||||
|
def seed(self):
|
||||||
|
try:
|
||||||
|
return self.wallet.get_seed(self.password)
|
||||||
|
except:
|
||||||
|
return ''
|
||||||
|
|
||||||
@pyqtProperty(str, notify=dataChanged)
|
@pyqtProperty(str, notify=dataChanged)
|
||||||
def txinType(self):
|
def txinType(self):
|
||||||
if self.wallet.wallet_type == 'imported':
|
if self.wallet.wallet_type == 'imported':
|
||||||
|
|||||||
Reference in New Issue
Block a user