1
0

keep all models and various UI items updated on new transactions

This commit is contained in:
Sander van Grieken
2022-04-01 16:17:50 +02:00
parent cb203dfe50
commit d88cd75460
7 changed files with 110 additions and 21 deletions

View File

@@ -45,6 +45,8 @@ Frame {
}
}
// instead of all these explicit connections, we should expose
// formatted balances directly as a property
Connections {
target: Config
function onBaseUnitChanged() { setBalances() }
@@ -56,5 +58,12 @@ Frame {
function onWalletLoaded() { setBalances() }
}
Connections {
target: Daemon.currentWallet
function onBalanceChanged() {
setBalances()
}
}
Component.onCompleted: setBalances()
}

View File

@@ -133,4 +133,10 @@ Pane {
}
Connections {
target: Network
function onHeightChanged(height) {
Daemon.currentWallet.historyModel.updateBlockchainHeight(height)
}
}
}

View File

@@ -347,4 +347,11 @@ Pane {
}
}
Connections {
target: Daemon.currentWallet
function onRequestStatusChanged(key, status) {
Daemon.currentWallet.requestModel.updateRequest(key, status)
}
}
}

View File

@@ -13,11 +13,10 @@ Dialog {
parent: Overlay.overlay
modal: true
standardButtons: Dialog.Ok
width: parent.width - constants.paddingXLarge
height: parent.height - constants.paddingXLarge
x: (parent.width - width) / 2
y: (parent.height - height) / 2
width: parent.width
height: parent.height
Overlay.modal: Rectangle {
color: "#aa000000"
@@ -42,6 +41,7 @@ Dialog {
icon.width: 32
icon.height: 32
onClicked: dialog.close()
visible: false
}
}
GridLayout {
@@ -122,13 +122,19 @@ Dialog {
text: qsTr('Address')
}
Label {
Layout.columnSpan: 2
Layout.fillWidth: true
font.family: FixedFont
font.pixelSize: constants.fontSizeLarge
wrapMode: Text.WrapAnywhere
text: modelItem.address
}
ToolButton {
icon.source: '../../icons/copy.png'
icon.color: 'transparent'
onClicked: {
AppController.textToClipboard(modelItem.address)
}
}
Label {
text: qsTr('Status')
@@ -162,4 +168,12 @@ Dialog {
}
}
Connections {
target: Daemon.currentWallet
function onRequestStatusChanged(key, code) {
if (key != modelItem.key)
return
modelItem = Daemon.currentWallet.get_request(key)
}
}
}