diff options
author | Robin Jarry <robin@jarry.cc> | 2023-02-05 23:23:02 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-02-20 14:48:42 +0100 |
commit | 6af06c9dfec03e923589d34187ba8358e3423d5c (patch) | |
tree | 3722f17464ca651ebd12d7d6d55a0e97ae72c8ec /commands | |
parent | 34db5942bd7b642107002b75de9d5d5c7fe90e4c (diff) | |
download | aerc-6af06c9dfec03e923589d34187ba8358e3423d5c.tar.gz |
statusline: move files to lib/state
These modules will not handle statusline rendering after next commit.
Move them in lib/state to make next commit easier to review.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/account/cf.go | 4 | ||||
-rw-r--r-- | commands/account/clear.go | 4 | ||||
-rw-r--r-- | commands/account/connection.go | 8 | ||||
-rw-r--r-- | commands/account/search.go | 10 | ||||
-rw-r--r-- | commands/account/sort.go | 6 | ||||
-rw-r--r-- | commands/msg/toggle-threads.go | 4 | ||||
-rw-r--r-- | commands/msgview/toggle-key-passthrough.go | 4 |
7 files changed, 20 insertions, 20 deletions
diff --git a/commands/account/cf.go b/commands/account/cf.go index 39b0bb89..f0fa3b67 100644 --- a/commands/account/cf.go +++ b/commands/account/cf.go @@ -5,7 +5,7 @@ import ( "strings" "git.sr.ht/~rjarry/aerc/commands" - "git.sr.ht/~rjarry/aerc/lib/statusline" + "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/widgets" ) @@ -51,7 +51,7 @@ func (ChangeFolder) Execute(aerc *widgets.Aerc, args []string) error { store := acct.Store() if store != nil { store.ApplyClear() - acct.SetStatus(statusline.SearchFilterClear()) + acct.SetStatus(state.SearchFilterClear()) } return nil } diff --git a/commands/account/clear.go b/commands/account/clear.go index 6d1e7b0a..a383b621 100644 --- a/commands/account/clear.go +++ b/commands/account/clear.go @@ -3,7 +3,7 @@ package account import ( "errors" - "git.sr.ht/~rjarry/aerc/lib/statusline" + "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/widgets" "git.sr.ht/~sircmpwn/getopt" ) @@ -52,7 +52,7 @@ func (Clear) Execute(aerc *widgets.Aerc, args []string) error { defer store.Select(0) } store.ApplyClear() - acct.SetStatus(statusline.SearchFilterClear()) + acct.SetStatus(state.SearchFilterClear()) return nil } diff --git a/commands/account/connection.go b/commands/account/connection.go index 52b569c4..0a67b2fe 100644 --- a/commands/account/connection.go +++ b/commands/account/connection.go @@ -3,7 +3,7 @@ package account import ( "errors" - "git.sr.ht/~rjarry/aerc/lib/statusline" + "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/widgets" "git.sr.ht/~rjarry/aerc/worker/types" ) @@ -28,14 +28,14 @@ func (Connection) Execute(aerc *widgets.Aerc, args []string) error { return errors.New("No account selected") } cb := func(msg types.WorkerMessage) { - acct.SetStatus(statusline.ConnectionActivity("")) + acct.SetStatus(state.ConnectionActivity("")) } if args[0] == "connect" { acct.Worker().PostAction(&types.Connect{}, cb) - acct.SetStatus(statusline.ConnectionActivity("Connecting...")) + acct.SetStatus(state.ConnectionActivity("Connecting...")) } else { acct.Worker().PostAction(&types.Disconnect{}, cb) - acct.SetStatus(statusline.ConnectionActivity("Disconnecting...")) + acct.SetStatus(state.ConnectionActivity("Disconnecting...")) } return nil } diff --git a/commands/account/search.go b/commands/account/search.go index 1494f788..71833afd 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -4,7 +4,7 @@ import ( "errors" "strings" - "git.sr.ht/~rjarry/aerc/lib/statusline" + "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/lib/ui" "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/widgets" @@ -39,19 +39,19 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { if len(args[1:]) == 0 { return Clear{}.Execute(aerc, []string{"clear"}) } - acct.SetStatus(statusline.FilterActivity("Filtering..."), statusline.Search("")) + acct.SetStatus(state.FilterActivity("Filtering..."), state.Search("")) store.SetFilter(args[1:]) cb := func(msg types.WorkerMessage) { if _, ok := msg.(*types.Done); ok { - acct.SetStatus(statusline.FilterResult(strings.Join(args, " "))) + acct.SetStatus(state.FilterResult(strings.Join(args, " "))) log.Tracef("Filter results: %v", store.Uids()) } } store.Sort(store.GetCurrentSortCriteria(), cb) } else { - acct.SetStatus(statusline.Search("Searching...")) + acct.SetStatus(state.Search("Searching...")) cb := func(uids []uint32) { - acct.SetStatus(statusline.Search(strings.Join(args, " "))) + acct.SetStatus(state.Search(strings.Join(args, " "))) log.Tracef("Search results: %v", uids) store.ApplySearch(uids) // TODO: Remove when stores have multiple OnUpdate handlers diff --git a/commands/account/sort.go b/commands/account/sort.go index f8cb94c1..cabe10ec 100644 --- a/commands/account/sort.go +++ b/commands/account/sort.go @@ -6,7 +6,7 @@ import ( "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/lib/sort" - "git.sr.ht/~rjarry/aerc/lib/statusline" + "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/widgets" "git.sr.ht/~rjarry/aerc/worker/types" ) @@ -89,10 +89,10 @@ func (Sort) Execute(aerc *widgets.Aerc, args []string) error { } } - acct.SetStatus(statusline.Sorting(true)) + acct.SetStatus(state.Sorting(true)) store.Sort(sortCriteria, func(msg types.WorkerMessage) { if _, ok := msg.(*types.Done); ok { - acct.SetStatus(statusline.Sorting(false)) + acct.SetStatus(state.Sorting(false)) } }) return nil diff --git a/commands/msg/toggle-threads.go b/commands/msg/toggle-threads.go index babdc31c..9508da50 100644 --- a/commands/msg/toggle-threads.go +++ b/commands/msg/toggle-threads.go @@ -3,7 +3,7 @@ package msg import ( "errors" - "git.sr.ht/~rjarry/aerc/lib/statusline" + "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/lib/ui" "git.sr.ht/~rjarry/aerc/widgets" ) @@ -36,7 +36,7 @@ func (ToggleThreads) Execute(aerc *widgets.Aerc, args []string) error { return err } store.SetThreadedView(!store.ThreadedView()) - acct.SetStatus(statusline.Threading(store.ThreadedView())) + acct.SetStatus(state.Threading(store.ThreadedView())) ui.Invalidate() return nil } diff --git a/commands/msgview/toggle-key-passthrough.go b/commands/msgview/toggle-key-passthrough.go index cbc4565e..00a39559 100644 --- a/commands/msgview/toggle-key-passthrough.go +++ b/commands/msgview/toggle-key-passthrough.go @@ -3,7 +3,7 @@ package msgview import ( "errors" - "git.sr.ht/~rjarry/aerc/lib/statusline" + "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/widgets" ) @@ -28,7 +28,7 @@ func (ToggleKeyPassthrough) Execute(aerc *widgets.Aerc, args []string) error { mv, _ := aerc.SelectedTabContent().(*widgets.MessageViewer) keyPassthroughEnabled := mv.ToggleKeyPassthrough() if acct := mv.SelectedAccount(); acct != nil { - acct.SetStatus(statusline.Passthrough(keyPassthroughEnabled)) + acct.SetStatus(state.Passthrough(keyPassthroughEnabled)) } return nil } |