Browse Source

qml: fix flickable margins TxDetails and WalletDetails

master
Sander van Grieken 3 years ago
parent
commit
3cb9ded1ca
  1. 439
      electrum/gui/qml/components/TxDetails.qml
  2. 687
      electrum/gui/qml/components/WalletDetails.qml

439
electrum/gui/qml/components/TxDetails.qml

@ -36,282 +36,283 @@ Pane {
Flickable { Flickable {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Layout.topMargin: constants.paddingLarge
Layout.leftMargin: constants.paddingLarge
Layout.rightMargin: constants.paddingLarge
contentHeight: contentLayout.height contentHeight: flickableRoot.height
clip: true clip: true
interactive: height < contentHeight interactive: height < contentHeight
GridLayout { Pane {
id: contentLayout id: flickableRoot
width: parent.width width: parent.width
columns: 2 padding: constants.paddingLarge
Heading { GridLayout {
Layout.columnSpan: 2 width: parent.width
text: qsTr('Transaction Details') columns: 2
}
RowLayout { Heading {
Layout.fillWidth: true Layout.columnSpan: 2
Layout.columnSpan: 2 text: qsTr('Transaction Details')
visible: txdetails.isUnrelated
Image {
source: '../../icons/warning.png'
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
} }
RowLayout {
Layout.fillWidth: true
Layout.columnSpan: 2
visible: txdetails.isUnrelated
Image {
source: '../../icons/warning.png'
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
}
Label {
text: qsTr('Transaction is unrelated to this wallet')
color: Material.accentColor
}
}
Label { Label {
text: qsTr('Transaction is unrelated to this wallet') visible: !txdetails.isUnrelated && txdetails.lnAmount.satsInt == 0
text: txdetails.amount.satsInt > 0
? qsTr('Amount received')
: qsTr('Amount sent')
color: Material.accentColor color: Material.accentColor
} }
}
Label {
visible: !txdetails.isUnrelated && txdetails.lnAmount.satsInt == 0
text: txdetails.amount.satsInt > 0
? qsTr('Amount received')
: qsTr('Amount sent')
color: Material.accentColor
}
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
visible: !txdetails.isUnrelated && txdetails.lnAmount.satsInt != 0 visible: !txdetails.isUnrelated && txdetails.lnAmount.satsInt != 0
text: txdetails.lnAmount.satsInt > 0 text: txdetails.lnAmount.satsInt > 0
? qsTr('Amount received in channels') ? qsTr('Amount received in channels')
: qsTr('Amount withdrawn from channels') : qsTr('Amount withdrawn from channels')
color: Material.accentColor color: Material.accentColor
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
FormattedAmount { FormattedAmount {
visible: !txdetails.isUnrelated visible: !txdetails.isUnrelated
Layout.fillWidth: true Layout.fillWidth: true
amount: txdetails.lnAmount.isEmpty ? txdetails.amount : txdetails.lnAmount amount: txdetails.lnAmount.isEmpty ? txdetails.amount : txdetails.lnAmount
} }
Label { Label {
visible: !txdetails.fee.isEmpty visible: !txdetails.fee.isEmpty
text: qsTr('Transaction fee') text: qsTr('Transaction fee')
color: Material.accentColor color: Material.accentColor
} }
RowLayout { RowLayout {
Layout.fillWidth: true
visible: !txdetails.fee.isEmpty
FormattedAmount {
Layout.fillWidth: true Layout.fillWidth: true
amount: txdetails.fee visible: !txdetails.fee.isEmpty
FormattedAmount {
Layout.fillWidth: true
amount: txdetails.fee
}
} }
}
Item { Item {
visible: feebumpButton.visible visible: feebumpButton.visible
Layout.preferredWidth: 1 ; Layout.preferredHeight: 1 Layout.preferredWidth: 1 ; Layout.preferredHeight: 1
} }
FlatButton { FlatButton {
id: feebumpButton id: feebumpButton
visible: txdetails.canBump || txdetails.canCpfp visible: txdetails.canBump || txdetails.canCpfp
textUnderIcon: false textUnderIcon: false
icon.source: '../../icons/warning.png' icon.source: '../../icons/warning.png'
icon.color: 'transparent' icon.color: 'transparent'
text: qsTr('Bump fee') text: qsTr('Bump fee')
onClicked: { onClicked: {
if (txdetails.canBump) { if (txdetails.canBump) {
var dialog = rbfBumpFeeDialog.createObject(root, { txid: root.txid }) var dialog = rbfBumpFeeDialog.createObject(root, { txid: root.txid })
} else { } else {
var dialog = cpfpBumpFeeDialog.createObject(root, { txid: root.txid }) var dialog = cpfpBumpFeeDialog.createObject(root, { txid: root.txid })
}
dialog.open()
} }
dialog.open()
} }
}
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr('Status') text: qsTr('Status')
color: Material.accentColor color: Material.accentColor
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: txdetails.status text: txdetails.status
} }
Label { Label {
text: qsTr('Mempool depth') text: qsTr('Mempool depth')
color: Material.accentColor color: Material.accentColor
visible: txdetails.mempoolDepth visible: txdetails.mempoolDepth
} }
Label { Label {
text: txdetails.mempoolDepth text: txdetails.mempoolDepth
visible: txdetails.mempoolDepth visible: txdetails.mempoolDepth
} }
Label { Label {
visible: txdetails.isMined visible: txdetails.isMined
text: qsTr('Date') text: qsTr('Date')
color: Material.accentColor color: Material.accentColor
} }
Label { Label {
visible: txdetails.isMined visible: txdetails.isMined
text: txdetails.date text: txdetails.date
} }
Label { Label {
visible: txdetails.isMined visible: txdetails.isMined
text: qsTr('Height') text: qsTr('Height')
color: Material.accentColor color: Material.accentColor
} }
Label { Label {
visible: txdetails.isMined visible: txdetails.isMined
text: txdetails.height text: txdetails.height
} }
Label { Label {
visible: txdetails.isMined visible: txdetails.isMined
text: qsTr('TX index') text: qsTr('TX index')
color: Material.accentColor color: Material.accentColor
} }
Label { Label {
visible: txdetails.isMined visible: txdetails.isMined
text: txdetails.txpos text: txdetails.txpos
} }
Label { Label {
text: qsTr('Label') text: qsTr('Label')
Layout.columnSpan: 2 Layout.columnSpan: 2
color: Material.accentColor color: Material.accentColor
} }
TextHighlightPane { TextHighlightPane {
id: labelContent id: labelContent
property bool editmode: false property bool editmode: false
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
RowLayout { RowLayout {
width: parent.width width: parent.width
Label { Label {
visible: !labelContent.editmode visible: !labelContent.editmode
text: txdetails.label text: txdetails.label
wrapMode: Text.Wrap wrapMode: Text.Wrap
Layout.fillWidth: true Layout.fillWidth: true
font.pixelSize: constants.fontSizeLarge font.pixelSize: constants.fontSizeLarge
}
ToolButton {
visible: !labelContent.editmode
icon.source: '../../icons/pen.png'
icon.color: 'transparent'
onClicked: {
labelEdit.text = txdetails.label
labelContent.editmode = true
labelEdit.focus = true
} }
} ToolButton {
TextField { visible: !labelContent.editmode
id: labelEdit icon.source: '../../icons/pen.png'
visible: labelContent.editmode icon.color: 'transparent'
text: txdetails.label onClicked: {
font.pixelSize: constants.fontSizeLarge labelEdit.text = txdetails.label
Layout.fillWidth: true labelContent.editmode = true
} labelEdit.focus = true
ToolButton { }
visible: labelContent.editmode
icon.source: '../../icons/confirmed.png'
icon.color: 'transparent'
onClicked: {
labelContent.editmode = false
txdetails.set_label(labelEdit.text)
} }
} TextField {
ToolButton { id: labelEdit
visible: labelContent.editmode visible: labelContent.editmode
icon.source: '../../icons/closebutton.png' text: txdetails.label
icon.color: 'transparent' font.pixelSize: constants.fontSizeLarge
onClicked: labelContent.editmode = false Layout.fillWidth: true
} }
} ToolButton {
} visible: labelContent.editmode
icon.source: '../../icons/confirmed.png'
Label { icon.color: 'transparent'
text: qsTr('Transaction ID') onClicked: {
Layout.columnSpan: 2 labelContent.editmode = false
color: Material.accentColor txdetails.set_label(labelEdit.text)
} }
}
TextHighlightPane { ToolButton {
Layout.columnSpan: 2 visible: labelContent.editmode
Layout.fillWidth: true icon.source: '../../icons/closebutton.png'
icon.color: 'transparent'
RowLayout { onClicked: labelContent.editmode = false
width: parent.width
Label {
text: txdetails.txid
font.pixelSize: constants.fontSizeLarge
font.family: FixedFont
Layout.fillWidth: true
wrapMode: Text.Wrap
}
ToolButton {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
enabled: txdetails.txid
onClicked: {
var dialog = app.genericShareDialog.createObject(root,
{ title: qsTr('Transaction ID'), text: txdetails.txid }
)
dialog.open()
} }
} }
} }
}
Label { Label {
text: qsTr('Outputs') text: qsTr('Transaction ID')
Layout.columnSpan: 2 Layout.columnSpan: 2
color: Material.accentColor color: Material.accentColor
} }
Repeater { TextHighlightPane {
model: txdetails.outputs
delegate: TextHighlightPane {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
RowLayout { RowLayout {
width: parent.width width: parent.width
Label { Label {
text: modelData.address text: txdetails.txid
Layout.fillWidth: true
wrapMode: Text.Wrap
font.pixelSize: constants.fontSizeLarge font.pixelSize: constants.fontSizeLarge
font.family: FixedFont font.family: FixedFont
color: modelData.is_mine ? constants.colorMine : Material.foreground Layout.fillWidth: true
wrapMode: Text.Wrap
} }
Label { ToolButton {
text: Config.formatSats(modelData.value) icon.source: '../../icons/share.png'
font.pixelSize: constants.fontSizeMedium icon.color: 'transparent'
font.family: FixedFont enabled: txdetails.txid
onClicked: {
var dialog = app.genericShareDialog.createObject(root,
{ title: qsTr('Transaction ID'), text: txdetails.txid }
)
dialog.open()
}
} }
Label { }
text: Config.baseUnit }
font.pixelSize: constants.fontSizeMedium
color: Material.accentColor Label {
text: qsTr('Outputs')
Layout.columnSpan: 2
color: Material.accentColor
}
Repeater {
model: txdetails.outputs
delegate: TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
RowLayout {
width: parent.width
Label {
text: modelData.address
Layout.fillWidth: true
wrapMode: Text.Wrap
font.pixelSize: constants.fontSizeLarge
font.family: FixedFont
color: modelData.is_mine ? constants.colorMine : Material.foreground
}
Label {
text: Config.formatSats(modelData.value)
font.pixelSize: constants.fontSizeMedium
font.family: FixedFont
}
Label {
text: Config.baseUnit
font.pixelSize: constants.fontSizeMedium
color: Material.accentColor
}
} }
} }
} }
} }
} }
} }
ButtonContainer { ButtonContainer {

687
electrum/gui/qml/components/WalletDetails.qml

@ -45,417 +45,420 @@ Pane {
ColumnLayout { ColumnLayout {
id: rootLayout id: rootLayout
width: parent.width anchors.fill: parent
height: parent.height
spacing: 0 spacing: 0
Flickable { Flickable {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Layout.margins: constants.paddingLarge
contentHeight: flickableLayout.height contentHeight: flickableRoot.height
clip:true clip:true
interactive: height < contentHeight interactive: height < contentHeight
ColumnLayout { Pane {
id: flickableLayout id: flickableRoot
width: parent.width width: parent.width
spacing: constants.paddingLarge padding: constants.paddingLarge
Heading { ColumnLayout {
text: qsTr('Wallet details') width: parent.width
} spacing: constants.paddingLarge
GridLayout {
columns: 3
Layout.alignment: Qt.AlignHCenter
Tag { Heading {
Layout.alignment: Qt.AlignHCenter text: qsTr('Wallet details')
text: Daemon.currentWallet.walletType
font.pixelSize: constants.fontSizeSmall
font.bold: true
iconSource: '../../../icons/wallet.png'
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: Daemon.currentWallet.txinType
font.pixelSize: constants.fontSizeSmall
font.bold: true
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: qsTr('HD')
visible: Daemon.currentWallet.isDeterministic
font.pixelSize: constants.fontSizeSmall
font.bold: true
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: qsTr('Watch only')
visible: Daemon.currentWallet.isWatchOnly
font.pixelSize: constants.fontSizeSmall
font.bold: true
iconSource: '../../../icons/eye1.png'
} }
Tag {
Layout.alignment: Qt.AlignHCenter GridLayout {
text: qsTr('Encrypted') columns: 3
visible: Daemon.currentWallet.isEncrypted
font.pixelSize: constants.fontSizeSmall
font.bold: true
iconSource: '../../../icons/key.png'
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: qsTr('HW')
visible: Daemon.currentWallet.isHardware
font.pixelSize: constants.fontSizeSmall
font.bold: true
iconSource: '../../../icons/seed.png'
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: qsTr('Lightning')
visible: Daemon.currentWallet.isLightning
font.pixelSize: constants.fontSizeSmall
font.bold: true
iconSource: '../../../icons/lightning.png'
}
Tag {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: qsTr('Seed')
visible: Daemon.currentWallet.hasSeed Tag {
font.pixelSize: constants.fontSizeSmall Layout.alignment: Qt.AlignHCenter
font.bold: true text: Daemon.currentWallet.walletType
iconSource: '../../../icons/seed.png' font.pixelSize: constants.fontSizeSmall
font.bold: true
iconSource: '../../../icons/wallet.png'
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: Daemon.currentWallet.txinType
font.pixelSize: constants.fontSizeSmall
font.bold: true
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: qsTr('HD')
visible: Daemon.currentWallet.isDeterministic
font.pixelSize: constants.fontSizeSmall
font.bold: true
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: qsTr('Watch only')
visible: Daemon.currentWallet.isWatchOnly
font.pixelSize: constants.fontSizeSmall
font.bold: true
iconSource: '../../../icons/eye1.png'
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: qsTr('Encrypted')
visible: Daemon.currentWallet.isEncrypted
font.pixelSize: constants.fontSizeSmall
font.bold: true
iconSource: '../../../icons/key.png'
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: qsTr('HW')
visible: Daemon.currentWallet.isHardware
font.pixelSize: constants.fontSizeSmall
font.bold: true
iconSource: '../../../icons/seed.png'
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: qsTr('Lightning')
visible: Daemon.currentWallet.isLightning
font.pixelSize: constants.fontSizeSmall
font.bold: true
iconSource: '../../../icons/lightning.png'
}
Tag {
Layout.alignment: Qt.AlignHCenter
text: qsTr('Seed')
visible: Daemon.currentWallet.hasSeed
font.pixelSize: constants.fontSizeSmall
font.bold: true
iconSource: '../../../icons/seed.png'
}
} }
}
Piechart { Piechart {
id: piechart id: piechart
visible: Daemon.currentWallet.totalBalance.satsInt > 0 visible: Daemon.currentWallet.totalBalance.satsInt > 0
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
implicitHeight: 220 // TODO: sane value dependent on screen implicitHeight: 220 // TODO: sane value dependent on screen
innerOffset: 6 innerOffset: 6
function updateSlices() { function updateSlices() {
var totalB = Daemon.currentWallet.totalBalance.satsInt var totalB = Daemon.currentWallet.totalBalance.satsInt
var onchainB = Daemon.currentWallet.confirmedBalance.satsInt var onchainB = Daemon.currentWallet.confirmedBalance.satsInt
var frozenB = Daemon.currentWallet.frozenBalance.satsInt var frozenB = Daemon.currentWallet.frozenBalance.satsInt
var lnB = Daemon.currentWallet.lightningBalance.satsInt var lnB = Daemon.currentWallet.lightningBalance.satsInt
piechart.slices = [ piechart.slices = [
{ v: lnB/totalB, color: constants.colorPiechartLightning, text: 'Lightning' }, { v: lnB/totalB, color: constants.colorPiechartLightning, text: 'Lightning' },
{ v: (onchainB-frozenB)/totalB, color: constants.colorPiechartOnchain, text: 'On-chain' }, { v: (onchainB-frozenB)/totalB, color: constants.colorPiechartOnchain, text: 'On-chain' },
{ v: frozenB/totalB, color: constants.colorPiechartFrozen, text: 'On-chain (frozen)' }, { v: frozenB/totalB, color: constants.colorPiechartFrozen, text: 'On-chain (frozen)' },
] ]
}
} }
}
GridLayout { GridLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
visible: Daemon.currentWallet visible: Daemon.currentWallet
columns: 3 columns: 3
Item { Item {
visible: !Daemon.currentWallet.totalBalance.isEmpty visible: !Daemon.currentWallet.totalBalance.isEmpty
Layout.preferredWidth: 1; Layout.preferredHeight: 1 Layout.preferredWidth: 1; Layout.preferredHeight: 1
} }
Label { Label {
visible: !Daemon.currentWallet.totalBalance.isEmpty visible: !Daemon.currentWallet.totalBalance.isEmpty
text: qsTr('Total') text: qsTr('Total')
} }
FormattedAmount { FormattedAmount {
visible: !Daemon.currentWallet.totalBalance.isEmpty visible: !Daemon.currentWallet.totalBalance.isEmpty
amount: Daemon.currentWallet.totalBalance amount: Daemon.currentWallet.totalBalance
} }
Rectangle { Rectangle {
visible: !Daemon.currentWallet.lightningBalance.isEmpty visible: !Daemon.currentWallet.lightningBalance.isEmpty
Layout.preferredWidth: constants.iconSizeXSmall Layout.preferredWidth: constants.iconSizeXSmall
Layout.preferredHeight: constants.iconSizeXSmall Layout.preferredHeight: constants.iconSizeXSmall
color: constants.colorPiechartLightning color: constants.colorPiechartLightning
} }
Label { Label {
visible: !Daemon.currentWallet.lightningBalance.isEmpty visible: !Daemon.currentWallet.lightningBalance.isEmpty
text: qsTr('Lightning') text: qsTr('Lightning')
} }
FormattedAmount { FormattedAmount {
amount: Daemon.currentWallet.lightningBalance amount: Daemon.currentWallet.lightningBalance
visible: !Daemon.currentWallet.lightningBalance.isEmpty visible: !Daemon.currentWallet.lightningBalance.isEmpty
} }
Rectangle { Rectangle {
visible: !Daemon.currentWallet.lightningBalance.isEmpty || !Daemon.currentWallet.frozenBalance.isEmpty visible: !Daemon.currentWallet.lightningBalance.isEmpty || !Daemon.currentWallet.frozenBalance.isEmpty
Layout.preferredWidth: constants.iconSizeXSmall Layout.preferredWidth: constants.iconSizeXSmall
Layout.preferredHeight: constants.iconSizeXSmall Layout.preferredHeight: constants.iconSizeXSmall
color: constants.colorPiechartOnchain color: constants.colorPiechartOnchain
} }
Label { Label {
visible: !Daemon.currentWallet.lightningBalance.isEmpty || !Daemon.currentWallet.frozenBalance.isEmpty visible: !Daemon.currentWallet.lightningBalance.isEmpty || !Daemon.currentWallet.frozenBalance.isEmpty
text: qsTr('On-chain') text: qsTr('On-chain')
} }
FormattedAmount { FormattedAmount {
amount: Daemon.currentWallet.confirmedBalance amount: Daemon.currentWallet.confirmedBalance
visible: !Daemon.currentWallet.lightningBalance.isEmpty || !Daemon.currentWallet.frozenBalance.isEmpty visible: !Daemon.currentWallet.lightningBalance.isEmpty || !Daemon.currentWallet.frozenBalance.isEmpty
} }
Rectangle { Rectangle {
visible: !Daemon.currentWallet.frozenBalance.isEmpty visible: !Daemon.currentWallet.frozenBalance.isEmpty
Layout.preferredWidth: constants.iconSizeXSmall Layout.preferredWidth: constants.iconSizeXSmall
Layout.preferredHeight: constants.iconSizeXSmall Layout.preferredHeight: constants.iconSizeXSmall
color: constants.colorPiechartFrozen color: constants.colorPiechartFrozen
} }
Label { Label {
visible: !Daemon.currentWallet.frozenBalance.isEmpty visible: !Daemon.currentWallet.frozenBalance.isEmpty
text: qsTr('Frozen') text: qsTr('Frozen')
} }
FormattedAmount { FormattedAmount {
amount: Daemon.currentWallet.frozenBalance amount: Daemon.currentWallet.frozenBalance
visible: !Daemon.currentWallet.frozenBalance.isEmpty visible: !Daemon.currentWallet.frozenBalance.isEmpty
}
} }
}
GridLayout { GridLayout {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
visible: Daemon.currentWallet visible: Daemon.currentWallet
columns: 2 columns: 2
Label { Label {
Layout.columnSpan: 2 Layout.columnSpan: 2
visible: Daemon.currentWallet.hasSeed visible: Daemon.currentWallet.hasSeed
text: qsTr('Seed') text: qsTr('Seed')
color: Material.accentColor color: Material.accentColor
} }
TextHighlightPane { TextHighlightPane {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
visible: Daemon.currentWallet.hasSeed visible: Daemon.currentWallet.hasSeed
RowLayout { RowLayout {
width: parent.width width: parent.width
Label { Label {
id: seedText id: seedText
visible: false visible: false
Layout.fillWidth: true Layout.fillWidth: true
text: Daemon.currentWallet.seed text: Daemon.currentWallet.seed
wrapMode: Text.Wrap wrapMode: Text.Wrap
font.family: FixedFont font.family: FixedFont
font.pixelSize: constants.fontSizeMedium font.pixelSize: constants.fontSizeMedium
} }
Label { Label {
id: showSeedText id: showSeedText
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: qsTr('Tap to show seed') text: qsTr('Tap to show seed')
wrapMode: Text.Wrap wrapMode: Text.Wrap
font.pixelSize: constants.fontSizeLarge font.pixelSize: constants.fontSizeLarge
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
seedText.visible = true seedText.visible = true
showSeedText.visible = false showSeedText.visible = false
}
} }
} }
} }
}
Label { Label {
Layout.columnSpan: 2 Layout.columnSpan: 2
visible: Daemon.currentWallet.isLightning visible: Daemon.currentWallet.isLightning
text: qsTr('Lightning Node ID') text: qsTr('Lightning Node ID')
color: Material.accentColor color: Material.accentColor
} }
TextHighlightPane { TextHighlightPane {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
visible: Daemon.currentWallet.isLightning visible: Daemon.currentWallet.isLightning
RowLayout { RowLayout {
width: parent.width width: parent.width
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: Daemon.currentWallet.lightningNodePubkey text: Daemon.currentWallet.lightningNodePubkey
wrapMode: Text.Wrap wrapMode: Text.Wrap
font.family: FixedFont font.family: FixedFont
font.pixelSize: constants.fontSizeMedium font.pixelSize: constants.fontSizeMedium
} }
ToolButton { ToolButton {
icon.source: '../../icons/share.png' icon.source: '../../icons/share.png'
icon.color: 'transparent' icon.color: 'transparent'
onClicked: { onClicked: {
var dialog = app.genericShareDialog.createObject(rootItem, { var dialog = app.genericShareDialog.createObject(rootItem, {
title: qsTr('Lightning Node ID'), title: qsTr('Lightning Node ID'),
text: Daemon.currentWallet.lightningNodePubkey text: Daemon.currentWallet.lightningNodePubkey
}) })
dialog.open() dialog.open()
}
} }
} }
} }
}
Label { Label {
visible: _is2fa visible: _is2fa
text: qsTr('2FA') text: qsTr('2FA')
color: Material.accentColor color: Material.accentColor
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
visible: _is2fa visible: _is2fa
text: Daemon.currentWallet.canSignWithoutServer text: Daemon.currentWallet.canSignWithoutServer
? qsTr('disabled (can sign without server)') ? qsTr('disabled (can sign without server)')
: qsTr('enabled') : qsTr('enabled')
} }
Label { Label {
visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer
text: qsTr('Remaining TX') text: qsTr('Remaining TX')
color: Material.accentColor color: Material.accentColor
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer
text: 'tx_remaining' in Daemon.currentWallet.billingInfo text: 'tx_remaining' in Daemon.currentWallet.billingInfo
? Daemon.currentWallet.billingInfo['tx_remaining'] ? Daemon.currentWallet.billingInfo['tx_remaining']
: qsTr('unknown') : qsTr('unknown')
} }
Label { Label {
Layout.columnSpan: 2 Layout.columnSpan: 2
visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer
text: qsTr('Billing') text: qsTr('Billing')
color: Material.accentColor color: Material.accentColor
} }
TextHighlightPane { TextHighlightPane {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer visible: _is2fa && !Daemon.currentWallet.canSignWithoutServer
ColumnLayout { ColumnLayout {
spacing: 0 spacing: 0
ButtonGroup { ButtonGroup {
id: billinggroup id: billinggroup
onCheckedButtonChanged: { onCheckedButtonChanged: {
Config.trustedcoinPrepay = checkedButton.value Config.trustedcoinPrepay = checkedButton.value
}
} }
}
Repeater { Repeater {
model: AppController.plugin('trustedcoin').billingModel model: AppController.plugin('trustedcoin').billingModel
delegate: RowLayout { delegate: RowLayout {
RadioButton { RadioButton {
ButtonGroup.group: billinggroup ButtonGroup.group: billinggroup
property string value: modelData.value property string value: modelData.value
text: modelData.text text: modelData.text
checked: modelData.value == Config.trustedcoinPrepay checked: modelData.value == Config.trustedcoinPrepay
} }
Label { Label {
text: Config.formatSats(modelData.sats_per_tx) text: Config.formatSats(modelData.sats_per_tx)
font.family: FixedFont font.family: FixedFont
} }
Label { Label {
text: Config.baseUnit + '/tx' text: Config.baseUnit + '/tx'
color: Material.accentColor color: Material.accentColor
}
} }
} }
} }
} }
}
Repeater {
id: keystores
model: Daemon.currentWallet.keystores
delegate: ColumnLayout {
Layout.columnSpan: 2
RowLayout {
Label {
text: qsTr('Keystore')
color: Material.accentColor
}
Label {
text: '#' + index
visible: keystores.count > 1
}
Image {
Layout.preferredWidth: constants.iconSizeXSmall
Layout.preferredHeight: constants.iconSizeXSmall
source: modelData.watch_only ? '../../icons/eye1.png' : '../../icons/key.png'
}
}
TextHighlightPane {
Layout.fillWidth: true
leftPadding: constants.paddingLarge
GridLayout {
width: parent.width
columns: 2
Repeater {
id: keystores
model: Daemon.currentWallet.keystores
delegate: ColumnLayout {
Layout.columnSpan: 2
RowLayout {
Label { Label {
text: qsTr('Derivation prefix') text: qsTr('Keystore')
visible: modelData.derivation_prefix
color: Material.accentColor color: Material.accentColor
} }
Label { Label {
Layout.fillWidth: true text: '#' + index
text: modelData.derivation_prefix visible: keystores.count > 1
visible: modelData.derivation_prefix
font.family: FixedFont
} }
Image {
Label { Layout.preferredWidth: constants.iconSizeXSmall
text: qsTr('BIP32 fingerprint') Layout.preferredHeight: constants.iconSizeXSmall
visible: modelData.fingerprint source: modelData.watch_only ? '../../icons/eye1.png' : '../../icons/key.png'
color: Material.accentColor
}
Label {
Layout.fillWidth: true
text: modelData.fingerprint
visible: modelData.fingerprint
font.family: FixedFont
} }
}
TextHighlightPane {
Layout.fillWidth: true
leftPadding: constants.paddingLarge
Label { GridLayout {
Layout.columnSpan: 2 width: parent.width
visible: modelData.master_pubkey columns: 2
text: qsTr('Master Public Key')
color: Material.accentColor Label {
} text: qsTr('Derivation prefix')
RowLayout { visible: modelData.derivation_prefix
Layout.fillWidth: true color: Material.accentColor
Layout.columnSpan: 2 }
Layout.leftMargin: constants.paddingLarge
Label { Label {
text: modelData.master_pubkey
wrapMode: Text.Wrap
Layout.fillWidth: true Layout.fillWidth: true
text: modelData.derivation_prefix
visible: modelData.derivation_prefix
font.family: FixedFont font.family: FixedFont
font.pixelSize: constants.fontSizeMedium
} }
ToolButton {
icon.source: '../../icons/share.png' Label {
icon.color: 'transparent' text: qsTr('BIP32 fingerprint')
onClicked: { visible: modelData.fingerprint
var dialog = app.genericShareDialog.createObject(rootItem, { color: Material.accentColor
title: qsTr('Master Public Key'), }
text: modelData.master_pubkey Label {
}) Layout.fillWidth: true
dialog.open() text: modelData.fingerprint
visible: modelData.fingerprint
font.family: FixedFont
}
Label {
Layout.columnSpan: 2
visible: modelData.master_pubkey
text: qsTr('Master Public Key')
color: Material.accentColor
}
RowLayout {
Layout.fillWidth: true
Layout.columnSpan: 2
Layout.leftMargin: constants.paddingLarge
Label {
text: modelData.master_pubkey
wrapMode: Text.Wrap
Layout.fillWidth: true
font.family: FixedFont
font.pixelSize: constants.fontSizeMedium
}
ToolButton {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
onClicked: {
var dialog = app.genericShareDialog.createObject(rootItem, {
title: qsTr('Master Public Key'),
text: modelData.master_pubkey
})
dialog.open()
}
} }
} }
} }
} }
} }
} }
}
}
} }
} }
} }

Loading…
Cancel
Save