diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-25 02:41:11 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-25 02:41:11 +0800 |
commit | b8b1453392aa6a4a801b935621cb8405e6581f8a (patch) | |
tree | 1331dac4c445733c05c7061fcee173e62da53e97 /mist/gui.go | |
parent | 70db149494db983f24cb23e5eda03fef0265fc1b (diff) | |
parent | 1cb12296f6a0107acd0ed18b28c1d5e414c10bcf (diff) | |
download | dexon-b8b1453392aa6a4a801b935621cb8405e6581f8a.tar dexon-b8b1453392aa6a4a801b935621cb8405e6581f8a.tar.gz dexon-b8b1453392aa6a4a801b935621cb8405e6581f8a.tar.bz2 dexon-b8b1453392aa6a4a801b935621cb8405e6581f8a.tar.lz dexon-b8b1453392aa6a4a801b935621cb8405e6581f8a.tar.xz dexon-b8b1453392aa6a4a801b935621cb8405e6581f8a.tar.zst dexon-b8b1453392aa6a4a801b935621cb8405e6581f8a.zip |
Merge branch 'release/0.6.6'
Diffstat (limited to 'mist/gui.go')
-rw-r--r-- | mist/gui.go | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/mist/gui.go b/mist/gui.go index f80e46761..299a441c0 100644 --- a/mist/gui.go +++ b/mist/gui.go @@ -385,14 +385,13 @@ func (gui *Gui) update() { ) peerUpdateTicker := time.NewTicker(5 * time.Second) - generalUpdateTicker := time.NewTicker(1 * time.Second) + generalUpdateTicker := time.NewTicker(500 * time.Millisecond) statsUpdateTicker := time.NewTicker(5 * time.Second) state := gui.eth.StateManager().TransState() unconfirmedFunds := new(big.Int) gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetAccount(gui.address()).Balance))) - gui.getObjectByName("syncProgressIndicator").Set("visible", !gui.eth.IsUpToDate()) lastBlockLabel := gui.getObjectByName("lastBlockLabel") miningLabel := gui.getObjectByName("miningLabel") @@ -439,9 +438,6 @@ func (gui *Gui) update() { state.UpdateStateObject(object) } - case msg := <-chainSyncChan: - sync := msg.Resource.(bool) - gui.win.Root().ObjectByName("syncProgressIndicator").Set("visible", sync) case <-objectChan: gui.loadAddressBook() @@ -464,9 +460,22 @@ func (gui *Gui) update() { miningLabel.Set("text", "Mining @ "+strconv.FormatInt(pow.GetHashrate(), 10)+"Khash") } + blockLength := gui.eth.BlockPool().BlocksProcessed + chainLength := gui.eth.BlockPool().ChainLength + + var ( + pct float64 = 1.0 / float64(chainLength) * float64(blockLength) + dlWidget = gui.win.Root().ObjectByName("downloadIndicator") + ) + if pct < 1.0 { + dlWidget.Set("visible", true) + dlWidget.Set("value", pct) + } else { + dlWidget.Set("visible", false) + } + case <-statsUpdateTicker.C: gui.setStatsPane() - } } }() |