Commit c0a05fcf authored by zelig's avatar zelig

log slider

- only add the gui logger after window is shown otherwise slider wont be shown
- need to silence gui logger after window closed otherwise logsystem hangs
- gui.GetLogLevelInt() extra function needed to give correcty int typecast value to gui widget that sets initial loglevel to default
parent 2f96652b
......@@ -319,7 +319,7 @@ ApplicationWindow {
Slider {
id: logLevelSlider
value: eth.getLogLevel()
value: eth.getLogLevelInt()
anchors {
right: parent.right
top: parent.top
......
......@@ -90,11 +90,12 @@ func (gui *Gui) Start(assetPath string) {
var win *qml.Window
var err error
var addlog = false
if len(data) == 0 {
win, err = gui.showKeyImport(context)
} else {
win, err = gui.showWallet(context)
ethlog.AddLogSystem(gui)
addlog = true
}
if err != nil {
logger.Errorln("asset not found: you can set an alternative asset path on the command line using option 'asset_path'", err)
......@@ -105,8 +106,13 @@ func (gui *Gui) Start(assetPath string) {
logger.Infoln("Starting GUI")
win.Show()
// only add the gui logger after window is shown otherwise slider wont be shown
if addlog {
ethlog.AddLogSystem(gui)
}
win.Wait()
// need to silence gui logger after window closed otherwise logsystem hangs
gui.SetLogLevel(ethlog.Silence)
gui.eth.Stop()
}
......@@ -353,6 +359,12 @@ func (gui *Gui) GetLogLevel() ethlog.LogLevel {
return gui.logLevel
}
// this extra function needed to give int typecast value to gui widget
// that sets initial loglevel to default
func (gui *Gui) GetLogLevelInt() int {
return int(gui.logLevel)
}
func (gui *Gui) Println(v ...interface{}) {
gui.printLog(fmt.Sprintln(v...))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment