aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/aerc.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-03-18 22:35:33 +0100
committerRobin Jarry <robin@jarry.cc>2022-03-18 23:42:07 +0100
commit2512c0403fa42b19c3e87fed44240da045ec902f (patch)
treea258d6a9c70e79cf316985363efcdc9529c91924 /widgets/aerc.go
parent807870ea3542f2fcb00e7e0451af37c224041dfe (diff)
downloadaerc-2512c0403fa42b19c3e87fed44240da045ec902f.tar.gz
statusline: implement per-account status
Implement a statusline state for each account. Keep the ex line and the push notifications global. Add account name prefix to push notifications. Prefix status line with account name when multiple accounts are available. Use account-specific status line for each tab where an account is defined. Handle threading, filter/search, viewer passthrough and connection status. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets/aerc.go')
-rw-r--r--widgets/aerc.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index 3a8f47fd..a8b23fe7 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -337,6 +337,7 @@ func (aerc *Aerc) NumTabs() int {
func (aerc *Aerc) NewTab(clickable ui.Drawable, name string) *ui.Tab {
tab := aerc.tabs.Add(clickable, name)
aerc.tabs.Select(len(aerc.tabs.Tabs) - 1)
+ aerc.UpdateStatus()
return tab
}
@@ -400,17 +401,20 @@ func (aerc *Aerc) SelectPreviousTab() bool {
return aerc.tabs.SelectPrevious()
}
-// TODO: Use per-account status lines, but a global ex line
func (aerc *Aerc) SetStatus(status string) *StatusMessage {
return aerc.statusline.Set(status)
}
-func (aerc *Aerc) SetExtraStatus(status string) {
- aerc.statusline.SetExtra(status)
+func (aerc *Aerc) UpdateStatus() {
+ if acct := aerc.SelectedAccount(); acct != nil {
+ acct.UpdateStatus()
+ } else {
+ aerc.ClearStatus()
+ }
}
-func (aerc *Aerc) ClearExtraStatus() {
- aerc.statusline.ClearExtra()
+func (aerc *Aerc) ClearStatus() {
+ aerc.statusline.Set("")
}
func (aerc *Aerc) SetError(status string) *StatusMessage {