diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-30 19:28:31 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-30 19:28:31 +0800 |
commit | e7c9b86a5aba022afd812f1a4fb554ee17a74bbd (patch) | |
tree | e97e2f32ef93c330395b901e56688e6a232db06b /ethereal/ui/gui.go | |
parent | 0938b56829b9cbe8804a4ca85b14534908dbdfbc (diff) | |
download | go-tangerine-e7c9b86a5aba022afd812f1a4fb554ee17a74bbd.tar go-tangerine-e7c9b86a5aba022afd812f1a4fb554ee17a74bbd.tar.gz go-tangerine-e7c9b86a5aba022afd812f1a4fb554ee17a74bbd.tar.bz2 go-tangerine-e7c9b86a5aba022afd812f1a4fb554ee17a74bbd.tar.lz go-tangerine-e7c9b86a5aba022afd812f1a4fb554ee17a74bbd.tar.xz go-tangerine-e7c9b86a5aba022afd812f1a4fb554ee17a74bbd.tar.zst go-tangerine-e7c9b86a5aba022afd812f1a4fb554ee17a74bbd.zip |
Improved UI
* Added mining button
Diffstat (limited to 'ethereal/ui/gui.go')
-rw-r--r-- | ethereal/ui/gui.go | 14 |
1 files changed, 14 insertions, 0 deletions
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 { |