qml: more robust keystore properties builder, support imported type
This commit is contained in:
@@ -404,6 +404,30 @@ Pane {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
columns: 2
|
columns: 2
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr('Keystore type')
|
||||||
|
visible: modelData.keystore_type
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: modelData.keystore_type
|
||||||
|
visible: modelData.keystore_type
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: modelData.watch_only
|
||||||
|
? qsTr('Imported addresses')
|
||||||
|
: qsTr('Imported keys')
|
||||||
|
visible: modelData.num_imported
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: modelData.num_imported
|
||||||
|
visible: modelData.num_imported
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr('Derivation prefix')
|
text: qsTr('Derivation prefix')
|
||||||
visible: modelData.derivation_prefix
|
visible: modelData.derivation_prefix
|
||||||
@@ -438,6 +462,7 @@ Pane {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.columnSpan: 2
|
Layout.columnSpan: 2
|
||||||
Layout.leftMargin: constants.paddingLarge
|
Layout.leftMargin: constants.paddingLarge
|
||||||
|
visible: modelData.master_pubkey
|
||||||
Label {
|
Label {
|
||||||
text: modelData.master_pubkey
|
text: modelData.master_pubkey
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
|
|||||||
@@ -362,10 +362,12 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
|
|||||||
result = []
|
result = []
|
||||||
for k in self.wallet.get_keystores():
|
for k in self.wallet.get_keystores():
|
||||||
result.append({
|
result.append({
|
||||||
'derivation_prefix': k.get_derivation_prefix() or '',
|
'keystore_type': k.type,
|
||||||
'master_pubkey': k.get_master_public_key() or '',
|
'watch_only': k.is_watching_only(),
|
||||||
'fingerprint': k.get_root_fingerprint() or '',
|
'derivation_prefix': (k.get_derivation_prefix() if k.is_deterministic() else '') or '',
|
||||||
'watch_only': k.is_watching_only()
|
'master_pubkey': (k.get_master_public_key() if k.is_deterministic() else '') or '',
|
||||||
|
'fingerprint': (k.get_root_fingerprint() if k.is_deterministic() else '') or '',
|
||||||
|
'num_imported': len(k.keypairs) if k.can_import() else 0,
|
||||||
})
|
})
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user