diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-05-28 10:32:42 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-05-28 10:32:42 -0400 |
commit | caad1b2c06a0446059ee5ee916e3dce1794b159b (patch) | |
tree | ee81255485234137a5902d87d5960ac06618b341 /widgets/aerc.go | |
parent | 76a91813d8dc0f0011202f8120fc197097f022aa (diff) | |
download | aerc-caad1b2c06a0446059ee5ee916e3dce1794b159b.tar.gz |
Revert "Add Style configuration"
This reverts commit 0f78f06610c0e8887aba2ae50e99b86477a384b3.
Diffstat (limited to 'widgets/aerc.go')
-rw-r--r-- | widgets/aerc.go | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go index 57d6cef9..829873ad 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -51,8 +51,8 @@ func NewAerc(conf *config.AercConfig, logger *log.Logger, tabs := ui.NewTabs(&conf.Ui) - statusbar := ui.NewStack(conf.Ui) - statusline := NewStatusLine(conf.Ui) + statusbar := ui.NewStack() + statusline := NewStatusLine() statusbar.Push(statusline) grid := ui.NewGrid().Rows([]ui.GridSpec{ @@ -76,7 +76,7 @@ func NewAerc(conf *config.AercConfig, logger *log.Logger, logger: logger, statusbar: statusbar, statusline: statusline, - prompts: ui.NewStack(conf.Ui), + prompts: ui.NewStack(), tabs: tabs, } @@ -382,20 +382,12 @@ func (aerc *Aerc) SetStatus(status string) *StatusMessage { return aerc.statusline.Set(status) } -func (aerc *Aerc) SetError(status string) *StatusMessage { - return aerc.statusline.SetError(status) -} - func (aerc *Aerc) PushStatus(text string, expiry time.Duration) *StatusMessage { return aerc.statusline.Push(text, expiry) } -func (aerc *Aerc) PushError(text string, expiry time.Duration) *StatusMessage { - return aerc.statusline.PushError(text, expiry) -} - -func (aerc *Aerc) PushSuccess(text string, expiry time.Duration) *StatusMessage { - return aerc.statusline.PushSuccess(text, expiry) +func (aerc *Aerc) PushError(text string) { + aerc.PushStatus(text, 10*time.Second).Color(tcell.ColorDefault, tcell.ColorRed) } func (aerc *Aerc) focus(item ui.Interactive) { @@ -424,11 +416,11 @@ func (aerc *Aerc) BeginExCommand(cmd string) { exline := NewExLine(aerc.conf, cmd, func(cmd string) { parts, err := shlex.Split(cmd) if err != nil { - aerc.PushError(" "+err.Error(), 10*time.Second) + aerc.PushError(" " + err.Error()) } err = aerc.cmd(parts) if err != nil { - aerc.PushError(" "+err.Error(), 10*time.Second) + aerc.PushError(" " + err.Error()) } // only add to history if this is an unsimulated command, // ie one not executed from a keybinding @@ -452,7 +444,7 @@ func (aerc *Aerc) RegisterPrompt(prompt string, cmd []string) { } err := aerc.cmd(cmd) if err != nil { - aerc.PushError(" "+err.Error(), 10*time.Second) + aerc.PushError(" " + err.Error()) } }, func(cmd string) []string { return nil // TODO: completions @@ -479,7 +471,7 @@ func (aerc *Aerc) RegisterChoices(choices []Choice) { } err := aerc.cmd(cmd) if err != nil { - aerc.PushError(" "+err.Error(), 10*time.Second) + aerc.PushError(" " + err.Error()) } }, func(cmd string) []string { return nil // TODO: completions @@ -560,10 +552,11 @@ func (aerc *Aerc) CloseDialog() { return } + func (aerc *Aerc) GetPassword(title string, prompt string) (chText chan string, chErr chan error) { chText = make(chan string, 1) chErr = make(chan error, 1) - getPasswd := NewGetPasswd(title, prompt, aerc.conf, func(pw string, err error) { + getPasswd := NewGetPasswd(title, prompt, func(pw string, err error) { defer func() { close(chErr) close(chText) |