diff options
Diffstat (limited to 'commands/account')
-rw-r--r-- | commands/account/clear.go | 4 | ||||
-rw-r--r-- | commands/account/connection.go | 12 | ||||
-rw-r--r-- | commands/account/search.go | 11 |
3 files changed, 17 insertions, 10 deletions
diff --git a/commands/account/clear.go b/commands/account/clear.go index 259a9de8..64e70122 100644 --- a/commands/account/clear.go +++ b/commands/account/clear.go @@ -3,6 +3,7 @@ package account import ( "errors" + "git.sr.ht/~rjarry/aerc/lib/statusline" "git.sr.ht/~rjarry/aerc/widgets" ) @@ -30,6 +31,7 @@ func (Clear) Execute(aerc *widgets.Aerc, args []string) error { return errors.New("Cannot perform action. Messages still loading") } store.ApplyClear() - aerc.ClearExtraStatus() + acct.SetStatus(statusline.SearchFilterClear()) + return nil } diff --git a/commands/account/connection.go b/commands/account/connection.go index a87993b6..52b569c4 100644 --- a/commands/account/connection.go +++ b/commands/account/connection.go @@ -3,6 +3,7 @@ package account import ( "errors" + "git.sr.ht/~rjarry/aerc/lib/statusline" "git.sr.ht/~rjarry/aerc/widgets" "git.sr.ht/~rjarry/aerc/worker/types" ) @@ -26,12 +27,15 @@ func (Connection) Execute(aerc *widgets.Aerc, args []string) error { if acct == nil { return errors.New("No account selected") } + cb := func(msg types.WorkerMessage) { + acct.SetStatus(statusline.ConnectionActivity("")) + } if args[0] == "connect" { - acct.Worker().PostAction(&types.Connect{}, nil) - acct.SetStatus("Connecting...") + acct.Worker().PostAction(&types.Connect{}, cb) + acct.SetStatus(statusline.ConnectionActivity("Connecting...")) } else { - acct.Worker().PostAction(&types.Disconnect{}, nil) - acct.SetStatus("Disconnecting...") + acct.Worker().PostAction(&types.Disconnect{}, cb) + acct.SetStatus(statusline.ConnectionActivity("Disconnecting...")) } return nil } diff --git a/commands/account/search.go b/commands/account/search.go index 86d9deac..eeee7bdb 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -2,8 +2,9 @@ package account import ( "errors" - "fmt" + "strings" + "git.sr.ht/~rjarry/aerc/lib/statusline" "git.sr.ht/~rjarry/aerc/widgets" ) @@ -33,16 +34,16 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { var cb func([]uint32) if args[0] == "filter" { - aerc.SetExtraStatus("Filtering...") + acct.SetStatus(statusline.FilterActivity("Filtering..."), statusline.Search("")) cb = func(uids []uint32) { - aerc.SetExtraStatus(fmt.Sprintf("%s", args)) + acct.SetStatus(statusline.FilterResult(strings.Join(args, " "))) acct.Logger().Printf("Filter results: %v", uids) store.ApplyFilter(uids) } } else { - aerc.SetExtraStatus("Searching...") + acct.SetStatus(statusline.Search("Searching...")) cb = func(uids []uint32) { - aerc.SetExtraStatus(fmt.Sprintf("%s", args)) + acct.SetStatus(statusline.Search(strings.Join(args, " "))) acct.Logger().Printf("Search results: %v", uids) store.ApplySearch(uids) // TODO: Remove when stores have multiple OnUpdate handlers |