|
|
@ -466,12 +466,17 @@ func (gui *Gui) update() { |
|
|
|
var ( |
|
|
|
var ( |
|
|
|
pct float64 = 1.0 / float64(chainLength) * float64(blockLength) |
|
|
|
pct float64 = 1.0 / float64(chainLength) * float64(blockLength) |
|
|
|
dlWidget = gui.win.Root().ObjectByName("downloadIndicator") |
|
|
|
dlWidget = gui.win.Root().ObjectByName("downloadIndicator") |
|
|
|
|
|
|
|
dlLabel = gui.win.Root().ObjectByName("downloadLabel") |
|
|
|
) |
|
|
|
) |
|
|
|
if pct < 1.0 { |
|
|
|
if pct < 1.0 { |
|
|
|
dlWidget.Set("visible", true) |
|
|
|
dlWidget.Set("visible", true) |
|
|
|
dlWidget.Set("value", pct) |
|
|
|
dlWidget.Set("value", pct) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dlLabel.Set("visible", true) |
|
|
|
|
|
|
|
dlLabel.Set("text", fmt.Sprintf("%d / %d", blockLength, chainLength)) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
dlWidget.Set("visible", false) |
|
|
|
dlWidget.Set("visible", false) |
|
|
|
|
|
|
|
dlLabel.Set("visible", false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case <-statsUpdateTicker.C: |
|
|
|
case <-statsUpdateTicker.C: |
|
|
|