1
0
mirror of https://github.com/taigrr/wtf synced 2026-03-30 17:25:21 -07:00

Move the scheduler up into /app

This commit is contained in:
Chris Cummer
2019-07-27 06:45:14 -07:00
parent a6d18e286a
commit cfd3c731ba
4 changed files with 40 additions and 41 deletions

View File

@@ -47,8 +47,6 @@ func NewWtfApp(app *tview.Application, config *config.Config, configFilePath str
wtf.ValidateWidgets(wtfApp.Widgets)
wtfApp.scheduleWidgets()
return &wtfApp
}
@@ -56,13 +54,12 @@ func NewWtfApp(app *tview.Application, config *config.Config, configFilePath str
// Start initializes the app
func (wtfApp *WtfApp) Start() {
wtfApp.scheduleWidgets()
go wtfApp.watchForConfigChanges()
}
// Stop kills all the currently-running widgets in this app
func (wtfApp *WtfApp) Stop() {
// TODO: Pretty sure we should kill their go routines that run them as well
// otherwise....?
wtfApp.disableAllWidgets()
}
@@ -115,7 +112,7 @@ func (wtfApp *WtfApp) refreshAllWidgets() {
func (wtfApp *WtfApp) scheduleWidgets() {
for _, widget := range wtfApp.Widgets {
go wtf.Schedule(widget)
go Schedule(widget)
}
}