Browse Source

qml: add show seed on WalletDetails.qml

master
Sander van Grieken 3 years ago
parent
commit
becd46fbf6
  1. 40
      electrum/gui/qml/components/WalletDetails.qml
  2. 7
      electrum/gui/qml/qewallet.py

40
electrum/gui/qml/components/WalletDetails.qml

@ -174,6 +174,46 @@ Pane {
visible: Daemon.currentWallet
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 {
Layout.columnSpan: 2
visible: Daemon.currentWallet.isLightning

7
electrum/gui/qml/qewallet.py

@ -316,6 +316,13 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
def hasSeed(self):
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)
def txinType(self):
if self.wallet.wallet_type == 'imported':

Loading…
Cancel
Save