mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Simplify the inclusion of the Common config settings into each module
Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
@@ -13,7 +13,7 @@ const (
|
||||
)
|
||||
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
*cfg.Common
|
||||
|
||||
callbackPort string
|
||||
clientID string
|
||||
@@ -23,7 +23,7 @@ type Settings struct {
|
||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||
|
||||
settings := Settings{
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||
Common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||
|
||||
callbackPort: ymlConfig.UString("callbackPort", "8080"),
|
||||
clientID: ymlConfig.UString("clientID", os.Getenv("SPOTIFY_ID")),
|
||||
|
||||
@@ -71,7 +71,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
||||
var playerState *spotify.PlayerState
|
||||
|
||||
widget := Widget{
|
||||
TextWidget: view.NewTextWidget(app, pages, settings.common),
|
||||
TextWidget: view.NewTextWidget(app, pages, settings.Common),
|
||||
|
||||
Info: Info{},
|
||||
|
||||
@@ -119,7 +119,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
||||
// If inconvenient, I'll remove this option and save the URL in a file or some other method.
|
||||
utils.OpenFile(`"` + authURL + `"`)
|
||||
|
||||
widget.settings.common.RefreshInterval = 5
|
||||
widget.settings.RefreshInterval = 5
|
||||
|
||||
widget.initializeKeyboardControls()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user