diff options
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 { |