Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions electrum/gui/qml/components/AddressDetails.qml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,17 @@ Pane {
color: Material.accentColor
}

Label {
text: addressdetails.numTx
RowLayout{
Label {
text: addressdetails.numTx
}

Label {
visible: addressdetails.numTx
text: '(<a href="#">' + qsTr("show...") + '</a>)'
textFormat: Text.StyledText
onLinkActivated: app.stack.push(Qt.resolvedUrl('AddressHistory.qml'), { address: root.address })
}
}

Label {
Expand Down
57 changes: 57 additions & 0 deletions electrum/gui/qml/components/AddressHistory.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Controls.Material

import org.electrum 1.0

import "controls"

Pane {
id: root
width: parent.width
height: parent.height
padding: 0

required property string address

ColumnLayout {
anchors.fill: parent
spacing: 10

ColumnLayout {
Layout.fillWidth: true
Layout.margins: 10
Label {
text: qsTr('Transaction history for address:')
color: Material.accentColor
Layout.fillWidth: true
wrapMode: Text.Wrap
}

TextHighlightPane {
Layout.fillWidth: true
Label {
text: address
width: parent.width
font.family: FixedFont
wrapMode: Text.Wrap
}
}
}

Frame {
Layout.fillWidth: true
Layout.fillHeight: true

verticalPadding: bg.lineWidth
horizontalPadding: 0
background: PaneInsetBackground { id: bg; vertical: false }

History {
anchors.fill: parent
forAddress: root.address
}
}
}
}
16 changes: 11 additions & 5 deletions electrum/gui/qml/components/History.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ Pane {
vertical: false
}

property string forAddress
property QtObject backingModel: forAddress
? Daemon.currentWallet.historyModelForAddress(forAddress)
: Daemon.currentWallet.historyModel

ElListView {
id: listview
width: parent.width
Expand All @@ -32,7 +37,8 @@ Pane {

header: Item {
width: parent.width
height: headerLayout.height
height: forAddress ? 0 : headerLayout.height
visible: !forAddress
ColumnLayout {
id: headerLayout
anchors.centerIn: parent
Expand Down Expand Up @@ -70,7 +76,7 @@ Pane {

DelegateModel {
id: visualModel
model: Daemon.currentWallet.historyModel
model: backingModel

groups: [
DelegateModelGroup { name: 'today'; includeByDefault: false },
Expand All @@ -86,7 +92,7 @@ Pane {
ScrollIndicator.vertical: ScrollIndicator { }

Label {
visible: Daemon.currentWallet.historyModel.count == 0 && !Daemon.currentWallet.synchronizing
visible: !forAddress && Daemon.currentWallet.historyModel.count == 0 && !Daemon.currentWallet.synchronizing
anchors.centerIn: parent
width: listview.width * 4/5
font.pixelSize: constants.fontSizeXXLarge
Expand Down Expand Up @@ -159,9 +165,9 @@ Pane {

StackView.onVisibleChanged: {
// refresh model if History becomes visible and the model is dirty.
if (StackView.visible) {
if (StackView.visible && backingModel) {
listview.reuseItems = false
Daemon.currentWallet.historyModel.initModel(false)
backingModel.initModel(false)
listview.reuseItems = true
}
}
Expand Down
5 changes: 5 additions & 0 deletions electrum/gui/qml/qewallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ def historyModel(self):
self._historyModel = QETransactionListModel(self.wallet)
return self._historyModel

@pyqtSlot(str, result=QETransactionListModel)
def historyModelForAddress(self, address):
self._hmfa = QETransactionListModel(self.wallet, onchain_domain=[address], include_lightning=False)
return self._hmfa

addressCoinModelChanged = pyqtSignal()
@pyqtProperty(QEAddressCoinListModel, notify=addressCoinModelChanged)
def addressCoinModel(self):
Expand Down