1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Close #205. cmdrunner will now respect title attribute

This commit is contained in:
Chris Cummer 2018-06-13 15:41:01 -07:00
parent d751821c34
commit 154cb3ea4f

View File

@ -36,14 +36,16 @@ func NewWidget() *Widget {
func (widget *Widget) Refresh() { func (widget *Widget) Refresh() {
widget.UpdateRefreshedAt() widget.UpdateRefreshedAt()
widget.execute() widget.execute()
widget.View.SetTitle(fmt.Sprintf(" %s ", widget))
title := Config.UString("wtf.mods.cmdrunner.title", widget.String())
widget.View.SetTitle(fmt.Sprintf("%s", title))
widget.View.SetText(fmt.Sprintf("%s", widget.result)) widget.View.SetText(fmt.Sprintf("%s", widget.result))
} }
func (widget *Widget) String() string { func (widget *Widget) String() string {
args := strings.Join(widget.args, " ") args := strings.Join(widget.args, " ")
return fmt.Sprintf("%s %s", widget.cmd, args) return fmt.Sprintf(" %s %s ", widget.cmd, args)
} }
func (widget *Widget) execute() { func (widget *Widget) execute() {