diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-01-11 09:04:18 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-01-11 09:04:18 -0500 |
commit | 4074445cbb45dc6ec132e67b7eac9f32dcfd53de (patch) | |
tree | abb2348df84e12f0a781a4e0d29509962d01c756 /cmd | |
parent | ffba56133406027a6a740f9f4454b27134143f0a (diff) | |
download | aerc-4074445cbb45dc6ec132e67b7eac9f32dcfd53de.tar.gz |
Move worker into account tab
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/aerc/main.go | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/cmd/aerc/main.go b/cmd/aerc/main.go index 420d7a82..e33f158f 100644 --- a/cmd/aerc/main.go +++ b/cmd/aerc/main.go @@ -5,8 +5,6 @@ import ( "git.sr.ht/~sircmpwn/aerc2/config" "git.sr.ht/~sircmpwn/aerc2/ui" - "git.sr.ht/~sircmpwn/aerc2/worker" - "git.sr.ht/~sircmpwn/aerc2/worker/types" ) func main() { @@ -19,27 +17,15 @@ func main() { panic(err) } defer _ui.Close() - var workers []worker.Worker for _, account := range conf.Accounts { - work, err := worker.NewWorker(account.Source) + tab, err := ui.NewAccountTab(&account) if err != nil { panic(err) } - go work.Run() - work.PostAction(types.Configure{Config: account}) - workers = append(workers, work) - // TODO: Give tabs ownership over their workers - _ui.AddTab(ui.NewAccountTab(&account, &work)) + _ui.AddTab(tab) } for !_ui.Exit { - activity := false - for _, worker := range workers { - if msg := worker.GetMessage(); msg != nil { - activity = true - } - } - activity = _ui.Tick() || activity - if !activity { + if !_ui.Tick() { time.Sleep(100 * time.Millisecond) } } |