Browse Source

improve network status display and states of items when no wallet loaded

patch-4
Sander van Grieken 3 years ago
parent
commit
5889c92e81
  1. 10
      electrum/gui/qml/components/NetworkStats.qml
  2. 3
      electrum/gui/qml/components/Preferences.qml
  3. 2
      electrum/gui/qml/components/WalletMainView.qml
  4. 18
      electrum/gui/qml/components/main.qml

10
electrum/gui/qml/components/NetworkStats.qml

@ -49,10 +49,12 @@ Pane {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
source: Network.status == 'connecting' || Network.status == 'disconnected'
? '../../icons/status_disconnected.png' :
Daemon.currentWallet.isUptodate
? '../../icons/status_connected.png'
: '../../icons/status_lagging.png'
? '../../icons/status_disconnected.png'
: Network.status == 'connected'
? Daemon.currentWallet && !Daemon.currentWallet.isUptodate
? '../../icons/status_lagging.png'
: '../../icons/status_connected.png'
: '../../icons/status_connected.png'
}
Label {
text: Network.status

3
electrum/gui/qml/components/Preferences.qml

@ -108,14 +108,13 @@ Pane {
Label {
text: qsTr('Lightning Routing')
enabled: Daemon.currentWallet.isLightning
}
ComboBox {
id: lnRoutingType
valueRole: 'key'
textRole: 'label'
enabled: Daemon.currentWallet.isLightning && false
enabled: Daemon.currentWallet != null && Daemon.currentWallet.isLightning && false
model: ListModel {
ListElement { key: 'gossip'; label: qsTr('Gossip') }
ListElement { key: 'trampoline'; label: qsTr('Trampoline') }

2
electrum/gui/qml/components/WalletMainView.qml

@ -39,7 +39,7 @@ Item {
icon.color: 'transparent'
action: Action {
text: qsTr('Channels');
enabled: Daemon.currentWallet.isLightning
enabled: Daemon.currentWallet != null && Daemon.currentWallet.isLightning
onTriggered: menu.openPage(Qt.resolvedUrl('Channels.qml'))
icon.source: '../../icons/lightning.png'
}

18
electrum/gui/qml/components/main.qml

@ -53,16 +53,6 @@ ApplicationWindow
visible: Network.isTestNet
width: column.width
height: column.height
MouseArea {
anchors.fill: parent
onClicked: {
var dialog = app.messageDialog.createObject(app, {'text':
'Electrum is currently on ' + Network.networkName + ''
})
dialog.open()
}
}
ColumnLayout {
id: column
@ -96,9 +86,11 @@ ApplicationWindow
Layout.preferredHeight: constants.iconSizeSmall
source: Network.status == 'connecting' || Network.status == 'disconnected'
? '../../icons/status_disconnected.png'
: Daemon.currentWallet.isUptodate
? '../../icons/status_connected.png'
: '../../icons/status_lagging.png'
: Network.status == 'connected'
? Daemon.currentWallet && !Daemon.currentWallet.isUptodate
? '../../icons/status_lagging.png'
: '../../icons/status_connected.png'
: '../../icons/status_connected.png'
}
Rectangle {

Loading…
Cancel
Save