From 93392b8917cb04f5bad6d9b73dfba64240fac880 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 22 Jul 2022 13:17:05 +0200 Subject: [PATCH] qml: also show proxy in networkstatusindicator and a little gimmick when a fork is detected --- .../controls/NetworkStatusIndicator.qml | 23 +++++++++++++++++-- electrum/gui/qml/qenetwork.py | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/electrum/gui/qml/components/controls/NetworkStatusIndicator.qml b/electrum/gui/qml/components/controls/NetworkStatusIndicator.qml index cdfe41ca5..0b8044fb6 100644 --- a/electrum/gui/qml/components/controls/NetworkStatusIndicator.qml +++ b/electrum/gui/qml/components/controls/NetworkStatusIndicator.qml @@ -10,6 +10,7 @@ Image { property bool lagging: connected && Network.isLagging property bool fork: connected && Network.chaintips > 1 property bool syncing: connected && Daemon.currentWallet && Daemon.currentWallet.synchronizing + property bool proxy: connected && Network.proxy // ?: in order to keep this a binding.. source: !connected @@ -21,29 +22,38 @@ Image { ? '../../../icons/status_lagging_fork.png' : '../../../icons/status_lagging.png' : fork - ? '../../../icons/status_connected_fork.png' - : '../../../icons/status_connected.png' + ? proxy + ? '../../../icons/status_connected_proxy_fork.png' + : '../../../icons/status_connected_fork.png' + : proxy + ? '../../../icons/status_connected_proxy.png' + : '../../../icons/status_connected.png' + states: [ State { name: 'disconnected' when: !connected PropertyChanges { target: root; rotation: 0 } + PropertyChanges { target: root; scale: 1.0 } }, State { name: 'normal' when: !(syncing || fork) PropertyChanges { target: root; rotation: 0 } + PropertyChanges { target: root; scale: 1.0 } }, State { name: 'syncing' when: syncing PropertyChanges { target: spin; running: true } + PropertyChanges { target: root; scale: 1.0 } }, State { name: 'forked' when: fork PropertyChanges { target: root; rotation: 0 } + PropertyChanges { target: pulse; running: true } } ] @@ -55,4 +65,13 @@ Image { duration: 1000 loops: Animation.Infinite } + + SequentialAnimation { + id: pulse + loops: Animation.Infinite + PauseAnimation { duration: 1000 } + NumberAnimation { target: root; property: 'scale'; from: 1.0; to: 1.5; duration: 200; easing.type: Easing.InCubic } + NumberAnimation { target: root; property: 'scale'; to: 1.0; duration: 500; easing.type: Easing.OutCubic } + PauseAnimation { duration: 30000 } + } } diff --git a/electrum/gui/qml/qenetwork.py b/electrum/gui/qml/qenetwork.py index 792bf35f0..ced23673c 100644 --- a/electrum/gui/qml/qenetwork.py +++ b/electrum/gui/qml/qenetwork.py @@ -162,7 +162,7 @@ class QENetwork(QObject, QtEventListener): @pyqtProperty('QVariantMap', notify=proxyChanged) def proxy(self): net_params = self.network.get_parameters() - return net_params + return net_params.proxy if net_params.proxy else {} @proxy.setter def proxy(self, proxy_settings):