diff --git a/cfg/common_settings.go b/cfg/common_settings.go index 342fcd41..25ec723a 100644 --- a/cfg/common_settings.go +++ b/cfg/common_settings.go @@ -27,6 +27,7 @@ type Colors struct { type Module struct { Name string + Type string } type Position struct { @@ -82,6 +83,7 @@ func NewCommonSettingsFromModule(name, defaultTitle string, moduleConfig *config Module: Module{ Name: name, + Type: moduleConfig.UString("type", name), }, Position: Position{ diff --git a/maker/widget_maker.go b/maker/widget_maker.go index 723dc79f..521559a1 100644 --- a/maker/widget_maker.go +++ b/maker/widget_maker.go @@ -201,7 +201,7 @@ func MakeWidget( widget = zendesk.NewWidget(app, settings) default: settings := unknown.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig) - widget = unknown.NewWidget(app, widgetName, settings) + widget = unknown.NewWidget(app, settings) } return widget diff --git a/modules/unknown/widget.go b/modules/unknown/widget.go index 777e3b3c..6493c6c1 100644 --- a/modules/unknown/widget.go +++ b/modules/unknown/widget.go @@ -14,7 +14,7 @@ type Widget struct { settings *Settings } -func NewWidget(app *tview.Application, name string, settings *Settings) *Widget { +func NewWidget(app *tview.Application, settings *Settings) *Widget { widget := Widget{ TextWidget: wtf.NewTextWidget(app, settings.common, false), @@ -31,7 +31,7 @@ func (widget *Widget) Refresh() { widget.app.QueueUpdateDraw(func() { widget.View.Clear() - content := fmt.Sprintf("Widget %s does not exist", widget.CommonSettings.Title) + content := fmt.Sprintf("Widget %s and/or type %s does not exist", widget.Name(), widget.CommonSettings.Module.Type) widget.View.SetText(content) }) }