improve network status display and states of items when no wallet loaded
This commit is contained in:
@@ -49,10 +49,12 @@ Pane {
|
|||||||
Layout.preferredWidth: constants.iconSizeSmall
|
Layout.preferredWidth: constants.iconSizeSmall
|
||||||
Layout.preferredHeight: constants.iconSizeSmall
|
Layout.preferredHeight: constants.iconSizeSmall
|
||||||
source: Network.status == 'connecting' || Network.status == 'disconnected'
|
source: Network.status == 'connecting' || Network.status == 'disconnected'
|
||||||
? '../../icons/status_disconnected.png' :
|
? '../../icons/status_disconnected.png'
|
||||||
Daemon.currentWallet.isUptodate
|
: Network.status == 'connected'
|
||||||
? '../../icons/status_connected.png'
|
? Daemon.currentWallet && !Daemon.currentWallet.isUptodate
|
||||||
: '../../icons/status_lagging.png'
|
? '../../icons/status_lagging.png'
|
||||||
|
: '../../icons/status_connected.png'
|
||||||
|
: '../../icons/status_connected.png'
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
text: Network.status
|
text: Network.status
|
||||||
|
|||||||
@@ -108,14 +108,13 @@ Pane {
|
|||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr('Lightning Routing')
|
text: qsTr('Lightning Routing')
|
||||||
enabled: Daemon.currentWallet.isLightning
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: lnRoutingType
|
id: lnRoutingType
|
||||||
valueRole: 'key'
|
valueRole: 'key'
|
||||||
textRole: 'label'
|
textRole: 'label'
|
||||||
enabled: Daemon.currentWallet.isLightning && false
|
enabled: Daemon.currentWallet != null && Daemon.currentWallet.isLightning && false
|
||||||
model: ListModel {
|
model: ListModel {
|
||||||
ListElement { key: 'gossip'; label: qsTr('Gossip') }
|
ListElement { key: 'gossip'; label: qsTr('Gossip') }
|
||||||
ListElement { key: 'trampoline'; label: qsTr('Trampoline') }
|
ListElement { key: 'trampoline'; label: qsTr('Trampoline') }
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ Item {
|
|||||||
icon.color: 'transparent'
|
icon.color: 'transparent'
|
||||||
action: Action {
|
action: Action {
|
||||||
text: qsTr('Channels');
|
text: qsTr('Channels');
|
||||||
enabled: Daemon.currentWallet.isLightning
|
enabled: Daemon.currentWallet != null && Daemon.currentWallet.isLightning
|
||||||
onTriggered: menu.openPage(Qt.resolvedUrl('Channels.qml'))
|
onTriggered: menu.openPage(Qt.resolvedUrl('Channels.qml'))
|
||||||
icon.source: '../../icons/lightning.png'
|
icon.source: '../../icons/lightning.png'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,16 +53,6 @@ ApplicationWindow
|
|||||||
visible: Network.isTestNet
|
visible: Network.isTestNet
|
||||||
width: column.width
|
width: column.width
|
||||||
height: column.height
|
height: column.height
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
|
||||||
var dialog = app.messageDialog.createObject(app, {'text':
|
|
||||||
'Electrum is currently on ' + Network.networkName + ''
|
|
||||||
})
|
|
||||||
dialog.open()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: column
|
id: column
|
||||||
@@ -96,9 +86,11 @@ ApplicationWindow
|
|||||||
Layout.preferredHeight: constants.iconSizeSmall
|
Layout.preferredHeight: constants.iconSizeSmall
|
||||||
source: Network.status == 'connecting' || Network.status == 'disconnected'
|
source: Network.status == 'connecting' || Network.status == 'disconnected'
|
||||||
? '../../icons/status_disconnected.png'
|
? '../../icons/status_disconnected.png'
|
||||||
: Daemon.currentWallet.isUptodate
|
: Network.status == 'connected'
|
||||||
? '../../icons/status_connected.png'
|
? Daemon.currentWallet && !Daemon.currentWallet.isUptodate
|
||||||
: '../../icons/status_lagging.png'
|
? '../../icons/status_lagging.png'
|
||||||
|
: '../../icons/status_connected.png'
|
||||||
|
: '../../icons/status_connected.png'
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ class QENetwork(QObject):
|
|||||||
self._logger.debug('fee histogram updated')
|
self._logger.debug('fee histogram updated')
|
||||||
self.feeHistogramUpdated.emit()
|
self.feeHistogramUpdated.emit()
|
||||||
|
|
||||||
@pyqtProperty(int,notify=heightChanged)
|
@pyqtProperty(int, notify=heightChanged)
|
||||||
def height(self):
|
def height(self):
|
||||||
return self._height
|
return self._height
|
||||||
|
|
||||||
@pyqtProperty('QString',notify=defaultServerChanged)
|
@pyqtProperty('QString', notify=defaultServerChanged)
|
||||||
def server(self):
|
def server(self):
|
||||||
return str(self.network.get_parameters().server)
|
return str(self.network.get_parameters().server)
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ class QENetwork(QObject):
|
|||||||
net_params = net_params._replace(server=server)
|
net_params = net_params._replace(server=server)
|
||||||
self.network.run_from_another_thread(self.network.set_parameters(net_params))
|
self.network.run_from_another_thread(self.network.set_parameters(net_params))
|
||||||
|
|
||||||
@pyqtProperty('QString',notify=statusChanged)
|
@pyqtProperty('QString', notify=statusChanged)
|
||||||
def status(self):
|
def status(self):
|
||||||
return self._status
|
return self._status
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ class QENetwork(QObject):
|
|||||||
self.network.run_from_another_thread(self.network.set_parameters(net_params))
|
self.network.run_from_another_thread(self.network.set_parameters(net_params))
|
||||||
self.proxyChanged.emit()
|
self.proxyChanged.emit()
|
||||||
|
|
||||||
@pyqtProperty('QVariant',notify=feeHistogramUpdated)
|
@pyqtProperty('QVariant', notify=feeHistogramUpdated)
|
||||||
def feeHistogram(self):
|
def feeHistogram(self):
|
||||||
return self.network.get_status_value('fee_histogram')
|
return self.network.get_status_value('fee_histogram')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user