Files
pallectrum/electrum/gui/qml/components/WalletMainView.qml
Sander van Grieken 17820b9346 add QEAddressListModel and initial Addresses.qml page.
show sane main view when no wallet loaded.
show error dialog when wallet could not be loaded.
show wallet up_to_date indicator in title bar.
refactor QETransactionListModel to be more self-contained.
2022-07-07 18:28:00 +02:00

102 lines
2.4 KiB
QML

import QtQuick 2.6
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.0
import QtQml 2.6
Item {
id: rootItem
property string title: Daemon.walletName
property QtObject menu: Menu {
MenuItem { text: qsTr('Addresses'); onTriggered: stack.push(Qt.resolvedUrl('Addresses.qml')); visible: Daemon.currentWallet != null }
MenuItem { text: qsTr('Wallets'); onTriggered: stack.push(Qt.resolvedUrl('Wallets.qml')) }
MenuItem { text: qsTr('Network'); onTriggered: stack.push(Qt.resolvedUrl('NetworkStats.qml')) }
}
ColumnLayout {
anchors.centerIn: parent
width: parent.width
spacing: 40
visible: Daemon.currentWallet == null
Label {
text: qsTr('No wallet loaded')
font.pixelSize: 24
Layout.alignment: Qt.AlignHCenter
}
Button {
text: qsTr('Open/Create Wallet')
Layout.alignment: Qt.AlignHCenter
onClicked: {
stack.push(Qt.resolvedUrl('Wallets.qml'))
}
}
}
ColumnLayout {
anchors.fill: parent
visible: Daemon.currentWallet != null
TabBar {
id: tabbar
Layout.fillWidth: true
currentIndex: swipeview.currentIndex
TabButton {
text: qsTr('Receive')
}
TabButton {
text: qsTr('History')
}
TabButton {
enabled: !Daemon.currentWallet.isWatchOnly
text: qsTr('Send')
}
}
SwipeView {
id: swipeview
Layout.fillHeight: true
Layout.fillWidth: true
currentIndex: tabbar.currentIndex
Item {
ColumnLayout {
width: parent.width
y: 20
spacing: 20
}
}
Item {
History {
id: history
anchors.fill: parent
}
}
Item {
enabled: !Daemon.currentWallet.isWatchOnly
Send {
anchors.fill: parent
}
}
}
}
Connections {
target: Daemon
function onWalletLoaded() {
tabbar.setCurrentIndex(1)
}
}
}