Skip to content

Commit ba3fabd

Browse files
committed
Added a catch up indicator
1 parent edf10ef commit ba3fabd

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

ethereal/assets/qml/wallet.qml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,17 @@ ApplicationWindow {
419419
}
420420
}
421421

422+
ProgressBar {
423+
id: syncProgressIndicator
424+
visible: false
425+
objectName: "syncProgressIndicator"
426+
y: 3
427+
width: 140
428+
indeterminate: true
429+
anchors.right: peerLabel.left
430+
anchors.rightMargin: 5
431+
}
432+
422433
Label {
423434
y: 7
424435
anchors.right: peerImage.left
@@ -443,6 +454,7 @@ ApplicationWindow {
443454
Window {
444455
id: popup
445456
visible: false
457+
flags: Qt.CustomizeWindowHint | Qt.Tool | Qt.WindowCloseButtonHint
446458
property var block
447459
width: root.width
448460
height: 300
@@ -577,6 +589,7 @@ ApplicationWindow {
577589

578590
Window {
579591
id: addPeerWin
592+
flags: Qt.CustomizeWindowHint | Qt.Tool | Qt.WindowCloseButtonHint
580593
visible: false
581594
minimumWidth: 230
582595
maximumWidth: 230
@@ -743,6 +756,7 @@ ApplicationWindow {
743756
// ******************************************
744757
Window {
745758
id: peerWindow
759+
flags: Qt.CustomizeWindowHint | Qt.Tool | Qt.WindowCloseButtonHint
746760
height: 200
747761
width: 700
748762
Rectangle {

ethereal/gui.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,18 @@ func (gui *Gui) setWalletValue(amount, unconfirmedFunds *big.Int) {
266266
func (gui *Gui) update() {
267267
reactor := gui.eth.Reactor()
268268

269-
blockChan := make(chan ethutil.React, 1)
270-
txChan := make(chan ethutil.React, 1)
271-
objectChan := make(chan ethutil.React, 1)
272-
peerChan := make(chan ethutil.React, 1)
269+
var (
270+
blockChan = make(chan ethutil.React, 1)
271+
txChan = make(chan ethutil.React, 1)
272+
objectChan = make(chan ethutil.React, 1)
273+
peerChan = make(chan ethutil.React, 1)
274+
chainSyncChan = make(chan ethutil.React, 1)
275+
)
273276

274277
reactor.Subscribe("newBlock", blockChan)
275278
reactor.Subscribe("newTx:pre", txChan)
276279
reactor.Subscribe("newTx:post", txChan)
280+
reactor.Subscribe("chainSync", chainSyncChan)
277281

278282
nameReg := ethpub.EthereumConfig(gui.eth.StateManager()).NameReg()
279283
if nameReg != nil {
@@ -287,6 +291,7 @@ func (gui *Gui) update() {
287291

288292
unconfirmedFunds := new(big.Int)
289293
gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetAccount(gui.address()).Amount)))
294+
gui.win.Root().ObjectByName("syncProgressIndicator").Set("visible", !gui.eth.IsUpToDate())
290295

291296
for {
292297
select {
@@ -328,6 +333,10 @@ func (gui *Gui) update() {
328333

329334
state.UpdateStateObject(object)
330335
}
336+
case msg := <-chainSyncChan:
337+
sync := msg.Resource.(bool)
338+
gui.win.Root().ObjectByName("syncProgressIndicator").Set("visible", sync)
339+
331340
case <-objectChan:
332341
gui.loadAddressBook()
333342
case <-peerChan:

0 commit comments

Comments
 (0)