qml: show Tor status in NetworkOverview
This commit is contained in:
@@ -61,6 +61,24 @@ Pane {
|
|||||||
text: Network.proxy['host'] ? Network.proxy['host'] + ':' + Network.proxy['port'] : ''
|
text: Network.proxy['host'] ? Network.proxy['host'] + ':' + Network.proxy['port'] : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: 'mode' in Network.proxy
|
||||||
|
text: qsTr('Proxy type:');
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
Image {
|
||||||
|
visible: Network.isProxyTor
|
||||||
|
Layout.preferredWidth: constants.iconSizeSmall
|
||||||
|
Layout.preferredHeight: constants.iconSizeSmall
|
||||||
|
source: '../../icons/tor_logo.png'
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
visible: 'mode' in Network.proxy
|
||||||
|
text: Network.isProxyTor ? 'TOR' : Network.proxy['mode']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
Layout.columnSpan: 2
|
Layout.columnSpan: 2
|
||||||
text: qsTr('On-chain')
|
text: qsTr('On-chain')
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ class QENetwork(QObject, QtEventListener):
|
|||||||
def on_event_proxy_set(self, *args):
|
def on_event_proxy_set(self, *args):
|
||||||
self._logger.debug('proxy set')
|
self._logger.debug('proxy set')
|
||||||
self.proxySet.emit()
|
self.proxySet.emit()
|
||||||
|
self.proxyTorChanged.emit()
|
||||||
|
|
||||||
@event_listener
|
@event_listener
|
||||||
def on_event_status(self, *args):
|
def on_event_status(self, *args):
|
||||||
@@ -174,6 +175,11 @@ class QENetwork(QObject, QtEventListener):
|
|||||||
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()
|
||||||
|
|
||||||
|
proxyTorChanged = pyqtSignal()
|
||||||
|
@pyqtProperty(bool, notify=proxyTorChanged)
|
||||||
|
def isProxyTor(self):
|
||||||
|
return self.network.tor_proxy
|
||||||
|
|
||||||
@pyqtProperty('QVariant', notify=feeHistogramUpdated)
|
@pyqtProperty('QVariant', notify=feeHistogramUpdated)
|
||||||
def feeHistogram(self):
|
def feeHistogram(self):
|
||||||
return self._fee_histogram
|
return self._fee_histogram
|
||||||
|
|||||||
Reference in New Issue
Block a user