mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Reimpliments the module configuration validation
Now supports displaying errors from multiple widgets.
This commit is contained in:
@@ -8,12 +8,12 @@ import (
|
||||
|
||||
func (widget *Widget) display() {
|
||||
if ok == false {
|
||||
widget.Redraw(widget.CommonSettings.Title, errorText, true)
|
||||
widget.Redraw(widget.CommonSettings().Title, errorText, true)
|
||||
return
|
||||
}
|
||||
|
||||
summaryText := widget.summaryText(&widget.summaryList)
|
||||
widget.Redraw(widget.CommonSettings.Title, summaryText, false)
|
||||
widget.Redraw(widget.CommonSettings().Title, summaryText, false)
|
||||
}
|
||||
|
||||
func (widget *Widget) summaryText(list *summaryList) string {
|
||||
|
||||
@@ -34,13 +34,13 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
func (widget *Widget) Refresh() {
|
||||
positions, err := Fetch(widget.device_token)
|
||||
if err != nil {
|
||||
widget.Redraw(widget.CommonSettings.Title, err.Error(), true)
|
||||
widget.Redraw(widget.CommonSettings().Title, err.Error(), true)
|
||||
return
|
||||
}
|
||||
|
||||
content := widget.contentFrom(positions)
|
||||
|
||||
widget.Redraw(widget.CommonSettings.Title, content, false)
|
||||
widget.Redraw(widget.CommonSettings().Title, content, false)
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
@@ -56,5 +56,5 @@ func (widget *Widget) display() {
|
||||
str += widget.priceWidget.Result
|
||||
str += widget.toplistWidget.Result
|
||||
|
||||
widget.Redraw(widget.CommonSettings.Title, fmt.Sprintf("\n%s", str), false)
|
||||
widget.Redraw(widget.CommonSettings().Title, fmt.Sprintf("\n%s", str), false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user