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),
|
||||
)
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
||||
|
||||
widget.View.SetText(widget.contentFrom(todayItems))
|
||||
|
@ -58,7 +58,6 @@ func (widget *Widget) Refresh() {
|
||||
return
|
||||
}
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.Clear()
|
||||
|
||||
display(widget)
|
||||
|
@ -28,8 +28,6 @@ func (widget *Widget) Refresh() {
|
||||
|
||||
builds, err := BuildsFor()
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
|
||||
widget.View.SetTitle(fmt.Sprintf("%s - Builds", widget.Name))
|
||||
|
||||
var content string
|
||||
|
@ -32,7 +32,6 @@ func NewWidget(app *tview.Application) *Widget {
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.display(widget.clockColl.Sorted(), widget.dateFormat, widget.timeFormat)
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,6 @@ func NewWidget(app *tview.Application) *Widget {
|
||||
}
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.execute()
|
||||
|
||||
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
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.updateSummary()
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.display()
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,6 @@ func NewWidget(app *tview.Application) *Widget {
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(" Blockfolio ")
|
||||
|
||||
positions, err := Fetch(widget.device_token)
|
||||
|
@ -42,8 +42,6 @@ func (widget *Widget) Refresh() {
|
||||
widget.toplistWidget.Refresh(&wg)
|
||||
wg.Wait()
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
|
||||
display(widget)
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,6 @@ func NewWidget(app *tview.Application) *Widget {
|
||||
func (widget *Widget) Refresh() {
|
||||
monitors, monitorErr := Monitors()
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s", widget.Name)))
|
||||
widget.View.Clear()
|
||||
|
||||
|
@ -37,7 +37,6 @@ func (widget *Widget) Disable() {
|
||||
}
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
defer widget.UpdateRefreshedAt()
|
||||
if isAuthenticated() {
|
||||
widget.fetchAndDisplayEvents()
|
||||
return
|
||||
|
@ -104,7 +104,6 @@ func (widget *Widget) Refresh() {
|
||||
project.Refresh()
|
||||
}
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.display()
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,6 @@ func (widget *Widget) Pull() {
|
||||
func (widget *Widget) Refresh() {
|
||||
repoPaths := wtf.ToStrs(wtf.Config.UList("wtf.mods.git.repositories"))
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.Data = widget.gitRepos(repoPaths)
|
||||
widget.display()
|
||||
}
|
||||
|
@ -51,7 +51,6 @@ func (widget *Widget) Refresh() {
|
||||
repo.Refresh()
|
||||
}
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.display()
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,6 @@ func (widget *Widget) Refresh() {
|
||||
project.Refresh()
|
||||
}
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.display()
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,6 @@ func (widget *Widget) Refresh() {
|
||||
}
|
||||
|
||||
messages, err := GetMessages(room.ID, wtf.Config.UInt("wtf.mods.gitter.numberOfMessages", 10))
|
||||
widget.UpdateRefreshedAt()
|
||||
|
||||
if err != nil {
|
||||
widget.View.SetWrap(true)
|
||||
|
@ -25,8 +25,6 @@ func NewWidget(app *tview.Application) *Widget {
|
||||
func (widget *Widget) Refresh() {
|
||||
cells, _ := Fetch()
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
|
||||
widget.View.SetText(widget.contentFrom(cells))
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,6 @@ func (widget *Widget) Refresh() {
|
||||
widget.stories = stories
|
||||
}
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.display()
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,6 @@ func NewWidget(app *tview.Application) *Widget {
|
||||
|
||||
// Refresh refresh the module
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.ipinfo()
|
||||
widget.View.SetText(widget.result)
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ func NewWidget(app *tview.Application) *Widget {
|
||||
}
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.ipinfo()
|
||||
widget.View.Clear()
|
||||
|
||||
|
@ -61,8 +61,6 @@ func (widget *Widget) Refresh() {
|
||||
)
|
||||
widget.view = view
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
|
||||
if err != nil {
|
||||
widget.View.SetWrap(true)
|
||||
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
||||
|
@ -54,8 +54,6 @@ func (widget *Widget) Refresh() {
|
||||
wtf.Config.UString("wtf.mods.jira.jql", ""),
|
||||
)
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
|
||||
if err != nil {
|
||||
widget.result = nil
|
||||
widget.View.SetWrap(true)
|
||||
|
@ -52,7 +52,6 @@ func (widget *Widget) Refresh() {
|
||||
return
|
||||
}
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(widget.Name)
|
||||
|
||||
logLines := widget.tailFile()
|
||||
|
@ -81,7 +81,6 @@ func (widget *Widget) Pull() {
|
||||
func (widget *Widget) Refresh() {
|
||||
repoPaths := wtf.ToStrs(wtf.Config.UList("wtf.mods.mercurial.repositories"))
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.Data = widget.mercurialRepos(repoPaths)
|
||||
widget.display()
|
||||
}
|
||||
@ -141,7 +140,7 @@ func (widget *Widget) modalFrame(form *tview.Form) *tview.Frame {
|
||||
return frame
|
||||
}
|
||||
|
||||
func (widget *Widget) currentData() *MercurialRepo{
|
||||
func (widget *Widget) currentData() *MercurialRepo {
|
||||
if len(widget.Data) == 0 {
|
||||
return nil
|
||||
}
|
||||
@ -153,7 +152,7 @@ func (widget *Widget) currentData() *MercurialRepo{
|
||||
return widget.Data[widget.Idx]
|
||||
}
|
||||
|
||||
func (widget *Widget) mercurialRepos(repoPaths []string) []*MercurialRepo{
|
||||
func (widget *Widget) mercurialRepos(repoPaths []string) []*MercurialRepo {
|
||||
repos := []*MercurialRepo{}
|
||||
|
||||
for _, repoPath := range repoPaths {
|
||||
|
@ -31,7 +31,6 @@ func (widget *Widget) Refresh() {
|
||||
appName = app.Name
|
||||
}
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - [green]%s[white]", widget.Name, appName)))
|
||||
widget.View.Clear()
|
||||
|
||||
|
@ -25,7 +25,6 @@ func NewWidget(app *tview.Application) *Widget {
|
||||
func (widget *Widget) Refresh() {
|
||||
data, err := Fetch()
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
||||
|
||||
var content string
|
||||
|
@ -25,7 +25,6 @@ func NewWidget(app *tview.Application) *Widget {
|
||||
}
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.Battery.Refresh()
|
||||
|
||||
content := ""
|
||||
|
@ -28,7 +28,6 @@ func (widget *Widget) Refresh() {
|
||||
data := NewSecurityData()
|
||||
data.Fetch()
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetText(widget.contentFrom(data))
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,6 @@ func (widget *Widget) Refresh() {
|
||||
data := NewSecurityData()
|
||||
data.Fetch()
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetText(widget.contentFrom(data))
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,6 @@ func (w *Widget) refreshSpotifyInfos() error {
|
||||
|
||||
func (w *Widget) Refresh() {
|
||||
w.render()
|
||||
w.UpdateRefreshedAt()
|
||||
}
|
||||
|
||||
func (w *Widget) render() {
|
||||
|
@ -23,7 +23,6 @@ func NewWidget(app *tview.Application) *Widget {
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetText(widget.animation())
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,6 @@ func NewWidget(app *tview.Application, date, version string) *Widget {
|
||||
}
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.UpdateRefreshedAt()
|
||||
|
||||
widget.View.SetText(
|
||||
fmt.Sprintf(
|
||||
"%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 -------------------- */
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.load()
|
||||
widget.display()
|
||||
|
||||
|
@ -87,7 +87,6 @@ func (w *Widget) Refresh() {
|
||||
return
|
||||
}
|
||||
|
||||
w.UpdateRefreshedAt()
|
||||
w.display()
|
||||
}
|
||||
|
||||
|
@ -53,8 +53,6 @@ func (widget *Widget) Refresh() {
|
||||
|
||||
builds, err := BuildsFor()
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
|
||||
if err != nil {
|
||||
widget.View.SetWrap(true)
|
||||
widget.View.SetTitle(widget.Name)
|
||||
|
@ -31,7 +31,6 @@ func (widget *Widget) Refresh() {
|
||||
|
||||
// Get the cards
|
||||
searchResult, err := GetCards(client, getLists())
|
||||
widget.UpdateRefreshedAt()
|
||||
|
||||
var content string
|
||||
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
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.display()
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,6 @@ func NewWidget(app *tview.Application) *Widget {
|
||||
}
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.prettyWeather()
|
||||
|
||||
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.UpdateRefreshedAt()
|
||||
widget.display()
|
||||
}
|
||||
|
||||
|
@ -11,14 +11,13 @@ import (
|
||||
|
||||
//BarGraph lets make graphs
|
||||
type BarGraph struct {
|
||||
enabled bool
|
||||
focusable bool
|
||||
starChar string
|
||||
maxStars int
|
||||
Name string
|
||||
RefreshedAt time.Time
|
||||
RefreshInt int
|
||||
View *tview.TextView
|
||||
enabled bool
|
||||
focusable bool
|
||||
starChar string
|
||||
maxStars int
|
||||
Name string
|
||||
RefreshInt int
|
||||
View *tview.TextView
|
||||
|
||||
Position
|
||||
|
||||
@ -90,10 +89,6 @@ func (widget *BarGraph) TextView() *tview.TextView {
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (widget *BarGraph) UpdateRefreshedAt() {
|
||||
widget.RefreshedAt = time.Now()
|
||||
}
|
||||
|
||||
func (widget *BarGraph) addView() {
|
||||
view := tview.NewTextView()
|
||||
|
||||
|
@ -2,7 +2,6 @@ package wtf
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/olebedev/config"
|
||||
"github.com/rivo/tview"
|
||||
@ -15,10 +14,9 @@ type TextWidget struct {
|
||||
focusable bool
|
||||
focusChar string
|
||||
|
||||
Name string
|
||||
RefreshedAt time.Time
|
||||
RefreshInt int
|
||||
View *tview.TextView
|
||||
Name string
|
||||
RefreshInt int
|
||||
View *tview.TextView
|
||||
|
||||
Position
|
||||
}
|
||||
@ -130,7 +128,3 @@ func (widget *TextWidget) addView(app *tview.Application, configKey string) {
|
||||
|
||||
widget.View = view
|
||||
}
|
||||
|
||||
func (widget *TextWidget) UpdateRefreshedAt() {
|
||||
widget.RefreshedAt = time.Now()
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ func (widget *Widget) Refresh() {
|
||||
} else {
|
||||
widget.result = ticketArray
|
||||
}
|
||||
widget.UpdateRefreshedAt()
|
||||
|
||||
widget.display()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user