qml: also show proxy in networkstatusindicator and a little gimmick when a fork is detected
This commit is contained in:
@@ -10,6 +10,7 @@ Image {
|
|||||||
property bool lagging: connected && Network.isLagging
|
property bool lagging: connected && Network.isLagging
|
||||||
property bool fork: connected && Network.chaintips > 1
|
property bool fork: connected && Network.chaintips > 1
|
||||||
property bool syncing: connected && Daemon.currentWallet && Daemon.currentWallet.synchronizing
|
property bool syncing: connected && Daemon.currentWallet && Daemon.currentWallet.synchronizing
|
||||||
|
property bool proxy: connected && Network.proxy
|
||||||
|
|
||||||
// ?: in order to keep this a binding..
|
// ?: in order to keep this a binding..
|
||||||
source: !connected
|
source: !connected
|
||||||
@@ -21,29 +22,38 @@ Image {
|
|||||||
? '../../../icons/status_lagging_fork.png'
|
? '../../../icons/status_lagging_fork.png'
|
||||||
: '../../../icons/status_lagging.png'
|
: '../../../icons/status_lagging.png'
|
||||||
: fork
|
: fork
|
||||||
? '../../../icons/status_connected_fork.png'
|
? proxy
|
||||||
: '../../../icons/status_connected.png'
|
? '../../../icons/status_connected_proxy_fork.png'
|
||||||
|
: '../../../icons/status_connected_fork.png'
|
||||||
|
: proxy
|
||||||
|
? '../../../icons/status_connected_proxy.png'
|
||||||
|
: '../../../icons/status_connected.png'
|
||||||
|
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
name: 'disconnected'
|
name: 'disconnected'
|
||||||
when: !connected
|
when: !connected
|
||||||
PropertyChanges { target: root; rotation: 0 }
|
PropertyChanges { target: root; rotation: 0 }
|
||||||
|
PropertyChanges { target: root; scale: 1.0 }
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: 'normal'
|
name: 'normal'
|
||||||
when: !(syncing || fork)
|
when: !(syncing || fork)
|
||||||
PropertyChanges { target: root; rotation: 0 }
|
PropertyChanges { target: root; rotation: 0 }
|
||||||
|
PropertyChanges { target: root; scale: 1.0 }
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: 'syncing'
|
name: 'syncing'
|
||||||
when: syncing
|
when: syncing
|
||||||
PropertyChanges { target: spin; running: true }
|
PropertyChanges { target: spin; running: true }
|
||||||
|
PropertyChanges { target: root; scale: 1.0 }
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: 'forked'
|
name: 'forked'
|
||||||
when: fork
|
when: fork
|
||||||
PropertyChanges { target: root; rotation: 0 }
|
PropertyChanges { target: root; rotation: 0 }
|
||||||
|
PropertyChanges { target: pulse; running: true }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -55,4 +65,13 @@ Image {
|
|||||||
duration: 1000
|
duration: 1000
|
||||||
loops: Animation.Infinite
|
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 }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ class QENetwork(QObject, QtEventListener):
|
|||||||
@pyqtProperty('QVariantMap', notify=proxyChanged)
|
@pyqtProperty('QVariantMap', notify=proxyChanged)
|
||||||
def proxy(self):
|
def proxy(self):
|
||||||
net_params = self.network.get_parameters()
|
net_params = self.network.get_parameters()
|
||||||
return net_params
|
return net_params.proxy if net_params.proxy else {}
|
||||||
|
|
||||||
@proxy.setter
|
@proxy.setter
|
||||||
def proxy(self, proxy_settings):
|
def proxy(self, proxy_settings):
|
||||||
|
|||||||
Reference in New Issue
Block a user