cleaning up

mine
derailed 2020-02-27 21:54:45 -07:00
parent c896598e84
commit 43f4cacbcd
2 changed files with 22 additions and 19 deletions

View File

@ -172,7 +172,7 @@ func (l *Log) bindKeys() {
ui.KeyC: ui.NewKeyAction("Clear", l.clearCmd, true), ui.KeyC: ui.NewKeyAction("Clear", l.clearCmd, true),
ui.KeyS: ui.NewKeyAction("Toggle AutoScroll", l.ToggleAutoScrollCmd, true), ui.KeyS: ui.NewKeyAction("Toggle AutoScroll", l.ToggleAutoScrollCmd, true),
// BOZO!! Log timestamps // BOZO!! Log timestamps
// ui.KeyT: ui.NewKeyAction("Toggle Timestamp", l.ToggleTimestampCmd, true), // ui.KeyT: ui.NewKeyAction("Toggle Timestamp", l.toggleTimestampCmd, true),
ui.KeyF: ui.NewKeyAction("FullScreen", l.fullScreenCmd, true), ui.KeyF: ui.NewKeyAction("FullScreen", l.fullScreenCmd, true),
ui.KeyW: ui.NewKeyAction("Toggle Wrap", l.textWrapCmd, true), ui.KeyW: ui.NewKeyAction("Toggle Wrap", l.textWrapCmd, true),
tcell.KeyCtrlS: ui.NewKeyAction("Save", l.SaveCmd, true), tcell.KeyCtrlS: ui.NewKeyAction("Save", l.SaveCmd, true),
@ -355,16 +355,16 @@ func (l *Log) textWrapCmd(*tcell.EventKey) *tcell.EventKey {
return nil return nil
} }
// ToggleTimeStampCmd toggles timestamp field. // BOZO! Log timestamps.
func (l *Log) ToggleTimestampCmd(evt *tcell.EventKey) *tcell.EventKey { // func (l *Log) toggleTimestampCmd(evt *tcell.EventKey) *tcell.EventKey {
l.model.Clear() // l.model.Clear()
l.indicator.ToggleTimestamp() // l.indicator.ToggleTimestamp()
l.model.ShowTimestamp(l.indicator.Timestamp()) // l.model.ShowTimestamp(l.indicator.Timestamp())
l.model.Stop() // l.model.Stop()
l.model.Start() // l.model.Start()
return nil // return nil
} // }
// ToggleAutoScrollCmd toggles autoscroll status. // ToggleAutoScrollCmd toggles autoscroll status.
func (l *Log) ToggleAutoScrollCmd(evt *tcell.EventKey) *tcell.EventKey { func (l *Log) ToggleAutoScrollCmd(evt *tcell.EventKey) *tcell.EventKey {

View File

@ -16,7 +16,8 @@ type LogIndicator struct {
scrollStatus int32 scrollStatus int32
fullScreen bool fullScreen bool
textWrap bool textWrap bool
showTime bool // BOZO!! timestamp
// showTime bool
} }
// NewLogIndicator returns a new indicator. // NewLogIndicator returns a new indicator.
@ -39,10 +40,11 @@ func (l *LogIndicator) AutoScroll() bool {
return atomic.LoadInt32(&l.scrollStatus) == 1 return atomic.LoadInt32(&l.scrollStatus) == 1
} }
// TextWrap reports the current wrap mode. // BOZO!! Timestamp
func (l *LogIndicator) Timestamp() bool { // // Timestamp reports the current timestamp mode.
return l.showTime // func (l *LogIndicator) Timestamp() bool {
} // return l.showTime
// }
// TextWrap reports the current wrap mode. // TextWrap reports the current wrap mode.
func (l *LogIndicator) TextWrap() bool { func (l *LogIndicator) TextWrap() bool {
@ -54,10 +56,11 @@ func (l *LogIndicator) FullScreen() bool {
return l.fullScreen return l.fullScreen
} }
// TextWrap reports the current wrap mode. // BOZO!! Timestamp
func (l *LogIndicator) ToggleTimestamp() { // // TextWrap reports the current wrap mode.
l.showTime = !l.showTime // func (l *LogIndicator) ToggleTimestamp() {
} // l.showTime = !l.showTime
// }
// ToggleFullScreen toggles the screen mode. // ToggleFullScreen toggles the screen mode.
func (l *LogIndicator) ToggleFullScreen() { func (l *LogIndicator) ToggleFullScreen() {