From e7c9b86a5aba022afd812f1a4fb554ee17a74bbd Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 30 May 2014 13:28:31 +0200 Subject: Improved UI * Added mining button --- ethereal/ui/gui.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ethereal/ui') diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index 7c37e2d62..d6430d1fe 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/eth-go/ethdb" "github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethutil" + "github.com/ethereum/go-ethereum/utils" "github.com/go-qml/qml" "math/big" "strings" @@ -101,6 +102,19 @@ func (gui *Gui) Start(assetPath string) { gui.eth.Stop() } +func (gui *Gui) ToggleMining() { + var txt string + if gui.eth.Mining { + utils.StopMining(gui.eth) + txt = "Start mining" + } else { + utils.StartMining(gui.eth) + txt = "Stop mining" + } + + gui.win.Root().Set("miningButtonText", txt) +} + func (gui *Gui) showWallet(context *qml.Context) (*qml.Window, error) { component, err := gui.engine.LoadFile(gui.uiLib.AssetPath("qml/wallet.qml")) if err != nil { -- cgit v1.2.3