mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Remove RefreshedAt from TextWidget
This attribute is used for absolutely nothing. It doesn't need to exist.
This commit is contained in:
parent
76f96ecb00
commit
a48d15079a
@ -29,7 +29,6 @@ func (widget *Widget) Refresh() {
|
|||||||
wtf.Now().Format(wtf.DateFormat),
|
wtf.Now().Format(wtf.DateFormat),
|
||||||
)
|
)
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
||||||
|
|
||||||
widget.View.SetText(widget.contentFrom(todayItems))
|
widget.View.SetText(widget.contentFrom(todayItems))
|
||||||
|
@ -58,7 +58,6 @@ func (widget *Widget) Refresh() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.View.Clear()
|
widget.View.Clear()
|
||||||
|
|
||||||
display(widget)
|
display(widget)
|
||||||
|
@ -28,8 +28,6 @@ func (widget *Widget) Refresh() {
|
|||||||
|
|
||||||
builds, err := BuildsFor()
|
builds, err := BuildsFor()
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
|
|
||||||
widget.View.SetTitle(fmt.Sprintf("%s - Builds", widget.Name))
|
widget.View.SetTitle(fmt.Sprintf("%s - Builds", widget.Name))
|
||||||
|
|
||||||
var content string
|
var content string
|
||||||
|
@ -32,7 +32,6 @@ func NewWidget(app *tview.Application) *Widget {
|
|||||||
/* -------------------- Exported Functions -------------------- */
|
/* -------------------- Exported Functions -------------------- */
|
||||||
|
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.display(widget.clockColl.Sorted(), widget.dateFormat, widget.timeFormat)
|
widget.display(widget.clockColl.Sorted(), widget.dateFormat, widget.timeFormat)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ func NewWidget(app *tview.Application) *Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.execute()
|
widget.execute()
|
||||||
|
|
||||||
title := tview.TranslateANSI(wtf.Config.UString("wtf.mods.cmdrunner.title", widget.String()))
|
title := tview.TranslateANSI(wtf.Config.UString("wtf.mods.cmdrunner.title", widget.String()))
|
||||||
|
@ -98,7 +98,6 @@ func makeMarketCurrency(name string) *mCurrency {
|
|||||||
// Refresh & update after interval time
|
// Refresh & update after interval time
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.updateSummary()
|
widget.updateSummary()
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.display()
|
widget.display()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ func NewWidget(app *tview.Application) *Widget {
|
|||||||
/* -------------------- Exported Functions -------------------- */
|
/* -------------------- Exported Functions -------------------- */
|
||||||
|
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.View.SetTitle(" Blockfolio ")
|
widget.View.SetTitle(" Blockfolio ")
|
||||||
|
|
||||||
positions, err := Fetch(widget.device_token)
|
positions, err := Fetch(widget.device_token)
|
||||||
|
@ -42,8 +42,6 @@ func (widget *Widget) Refresh() {
|
|||||||
widget.toplistWidget.Refresh(&wg)
|
widget.toplistWidget.Refresh(&wg)
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
|
|
||||||
display(widget)
|
display(widget)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ func NewWidget(app *tview.Application) *Widget {
|
|||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
monitors, monitorErr := Monitors()
|
monitors, monitorErr := Monitors()
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s", widget.Name)))
|
widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s", widget.Name)))
|
||||||
widget.View.Clear()
|
widget.View.Clear()
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ func (widget *Widget) Disable() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
defer widget.UpdateRefreshedAt()
|
|
||||||
if isAuthenticated() {
|
if isAuthenticated() {
|
||||||
widget.fetchAndDisplayEvents()
|
widget.fetchAndDisplayEvents()
|
||||||
return
|
return
|
||||||
|
@ -104,7 +104,6 @@ func (widget *Widget) Refresh() {
|
|||||||
project.Refresh()
|
project.Refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.display()
|
widget.display()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,6 @@ func (widget *Widget) Pull() {
|
|||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
repoPaths := wtf.ToStrs(wtf.Config.UList("wtf.mods.git.repositories"))
|
repoPaths := wtf.ToStrs(wtf.Config.UList("wtf.mods.git.repositories"))
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.Data = widget.gitRepos(repoPaths)
|
widget.Data = widget.gitRepos(repoPaths)
|
||||||
widget.display()
|
widget.display()
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,6 @@ func (widget *Widget) Refresh() {
|
|||||||
repo.Refresh()
|
repo.Refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.display()
|
widget.display()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,6 @@ func (widget *Widget) Refresh() {
|
|||||||
project.Refresh()
|
project.Refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.display()
|
widget.display()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,6 @@ func (widget *Widget) Refresh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
messages, err := GetMessages(room.ID, wtf.Config.UInt("wtf.mods.gitter.numberOfMessages", 10))
|
messages, err := GetMessages(room.ID, wtf.Config.UInt("wtf.mods.gitter.numberOfMessages", 10))
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
widget.View.SetWrap(true)
|
widget.View.SetWrap(true)
|
||||||
|
@ -25,8 +25,6 @@ func NewWidget(app *tview.Application) *Widget {
|
|||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
cells, _ := Fetch()
|
cells, _ := Fetch()
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
|
|
||||||
widget.View.SetText(widget.contentFrom(cells))
|
widget.View.SetText(widget.contentFrom(cells))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,6 @@ func (widget *Widget) Refresh() {
|
|||||||
widget.stories = stories
|
widget.stories = stories
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.display()
|
widget.display()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ func NewWidget(app *tview.Application) *Widget {
|
|||||||
|
|
||||||
// Refresh refresh the module
|
// Refresh refresh the module
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.ipinfo()
|
widget.ipinfo()
|
||||||
widget.View.SetText(widget.result)
|
widget.View.SetText(widget.result)
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,6 @@ func NewWidget(app *tview.Application) *Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.ipinfo()
|
widget.ipinfo()
|
||||||
widget.View.Clear()
|
widget.View.Clear()
|
||||||
|
|
||||||
|
@ -61,8 +61,6 @@ func (widget *Widget) Refresh() {
|
|||||||
)
|
)
|
||||||
widget.view = view
|
widget.view = view
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
widget.View.SetWrap(true)
|
widget.View.SetWrap(true)
|
||||||
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
||||||
|
@ -54,8 +54,6 @@ func (widget *Widget) Refresh() {
|
|||||||
wtf.Config.UString("wtf.mods.jira.jql", ""),
|
wtf.Config.UString("wtf.mods.jira.jql", ""),
|
||||||
)
|
)
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
widget.result = nil
|
widget.result = nil
|
||||||
widget.View.SetWrap(true)
|
widget.View.SetWrap(true)
|
||||||
|
@ -52,7 +52,6 @@ func (widget *Widget) Refresh() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.View.SetTitle(widget.Name)
|
widget.View.SetTitle(widget.Name)
|
||||||
|
|
||||||
logLines := widget.tailFile()
|
logLines := widget.tailFile()
|
||||||
|
@ -81,7 +81,6 @@ func (widget *Widget) Pull() {
|
|||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
repoPaths := wtf.ToStrs(wtf.Config.UList("wtf.mods.mercurial.repositories"))
|
repoPaths := wtf.ToStrs(wtf.Config.UList("wtf.mods.mercurial.repositories"))
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.Data = widget.mercurialRepos(repoPaths)
|
widget.Data = widget.mercurialRepos(repoPaths)
|
||||||
widget.display()
|
widget.display()
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@ func (widget *Widget) Refresh() {
|
|||||||
appName = app.Name
|
appName = app.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - [green]%s[white]", widget.Name, appName)))
|
widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - [green]%s[white]", widget.Name, appName)))
|
||||||
widget.View.Clear()
|
widget.View.Clear()
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ func NewWidget(app *tview.Application) *Widget {
|
|||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
data, err := Fetch()
|
data, err := Fetch()
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
||||||
|
|
||||||
var content string
|
var content string
|
||||||
|
@ -25,7 +25,6 @@ func NewWidget(app *tview.Application) *Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.Battery.Refresh()
|
widget.Battery.Refresh()
|
||||||
|
|
||||||
content := ""
|
content := ""
|
||||||
|
@ -28,7 +28,6 @@ func (widget *Widget) Refresh() {
|
|||||||
data := NewSecurityData()
|
data := NewSecurityData()
|
||||||
data.Fetch()
|
data.Fetch()
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.View.SetText(widget.contentFrom(data))
|
widget.View.SetText(widget.contentFrom(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@ func (widget *Widget) Refresh() {
|
|||||||
data := NewSecurityData()
|
data := NewSecurityData()
|
||||||
data.Fetch()
|
data.Fetch()
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.View.SetText(widget.contentFrom(data))
|
widget.View.SetText(widget.contentFrom(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@ func (w *Widget) refreshSpotifyInfos() error {
|
|||||||
|
|
||||||
func (w *Widget) Refresh() {
|
func (w *Widget) Refresh() {
|
||||||
w.render()
|
w.render()
|
||||||
w.UpdateRefreshedAt()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Widget) render() {
|
func (w *Widget) render() {
|
||||||
|
@ -23,7 +23,6 @@ func NewWidget(app *tview.Application) *Widget {
|
|||||||
/* -------------------- Exported Functions -------------------- */
|
/* -------------------- Exported Functions -------------------- */
|
||||||
|
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.View.SetText(widget.animation())
|
widget.View.SetText(widget.animation())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,6 @@ func NewWidget(app *tview.Application, date, version string) *Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
|
|
||||||
widget.View.SetText(
|
widget.View.SetText(
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"%8s: %s\n%8s: %s\n\n%8s: %s\n%8s: %s",
|
"%8s: %s\n%8s: %s\n\n%8s: %s\n%8s: %s",
|
||||||
|
@ -69,7 +69,6 @@ func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
|
|||||||
/* -------------------- Exported Functions -------------------- */
|
/* -------------------- Exported Functions -------------------- */
|
||||||
|
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.load()
|
widget.load()
|
||||||
widget.display()
|
widget.display()
|
||||||
|
|
||||||
|
@ -87,7 +87,6 @@ func (w *Widget) Refresh() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
w.UpdateRefreshedAt()
|
|
||||||
w.display()
|
w.display()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,8 +53,6 @@ func (widget *Widget) Refresh() {
|
|||||||
|
|
||||||
builds, err := BuildsFor()
|
builds, err := BuildsFor()
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
widget.View.SetWrap(true)
|
widget.View.SetWrap(true)
|
||||||
widget.View.SetTitle(widget.Name)
|
widget.View.SetTitle(widget.Name)
|
||||||
|
@ -31,7 +31,6 @@ func (widget *Widget) Refresh() {
|
|||||||
|
|
||||||
// Get the cards
|
// Get the cards
|
||||||
searchResult, err := GetCards(client, getLists())
|
searchResult, err := GetCards(client, getLists())
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
|
|
||||||
var content string
|
var content string
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -60,7 +60,6 @@ func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
|
|||||||
|
|
||||||
// Refresh is called on the interval and refreshes the data
|
// Refresh is called on the interval and refreshes the data
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.display()
|
widget.display()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ func NewWidget(app *tview.Application) *Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.prettyWeather()
|
widget.prettyWeather()
|
||||||
|
|
||||||
widget.View.SetText(widget.result)
|
widget.View.SetText(widget.result)
|
||||||
|
@ -73,7 +73,6 @@ func (widget *Widget) Refresh() {
|
|||||||
widget.Data = widget.Fetch(wtf.ToInts(wtf.Config.UList("wtf.mods.weather.cityids", widget.defaultCityCodes())))
|
widget.Data = widget.Fetch(wtf.ToInts(wtf.Config.UList("wtf.mods.weather.cityids", widget.defaultCityCodes())))
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
widget.display()
|
widget.display()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ type BarGraph struct {
|
|||||||
starChar string
|
starChar string
|
||||||
maxStars int
|
maxStars int
|
||||||
Name string
|
Name string
|
||||||
RefreshedAt time.Time
|
|
||||||
RefreshInt int
|
RefreshInt int
|
||||||
View *tview.TextView
|
View *tview.TextView
|
||||||
|
|
||||||
@ -90,10 +89,6 @@ func (widget *BarGraph) TextView() *tview.TextView {
|
|||||||
|
|
||||||
/* -------------------- Unexported Functions -------------------- */
|
/* -------------------- Unexported Functions -------------------- */
|
||||||
|
|
||||||
func (widget *BarGraph) UpdateRefreshedAt() {
|
|
||||||
widget.RefreshedAt = time.Now()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (widget *BarGraph) addView() {
|
func (widget *BarGraph) addView() {
|
||||||
view := tview.NewTextView()
|
view := tview.NewTextView()
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ package wtf
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/olebedev/config"
|
"github.com/olebedev/config"
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
@ -16,7 +15,6 @@ type TextWidget struct {
|
|||||||
focusChar string
|
focusChar string
|
||||||
|
|
||||||
Name string
|
Name string
|
||||||
RefreshedAt time.Time
|
|
||||||
RefreshInt int
|
RefreshInt int
|
||||||
View *tview.TextView
|
View *tview.TextView
|
||||||
|
|
||||||
@ -130,7 +128,3 @@ func (widget *TextWidget) addView(app *tview.Application, configKey string) {
|
|||||||
|
|
||||||
widget.View = view
|
widget.View = view
|
||||||
}
|
}
|
||||||
|
|
||||||
func (widget *TextWidget) UpdateRefreshedAt() {
|
|
||||||
widget.RefreshedAt = time.Now()
|
|
||||||
}
|
|
||||||
|
@ -36,7 +36,6 @@ func (widget *Widget) Refresh() {
|
|||||||
} else {
|
} else {
|
||||||
widget.result = ticketArray
|
widget.result = ticketArray
|
||||||
}
|
}
|
||||||
widget.UpdateRefreshedAt()
|
|
||||||
|
|
||||||
widget.display()
|
widget.display()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user