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 /ui/types.go | |
parent | ffba56133406027a6a740f9f4454b27134143f0a (diff) | |
download | aerc-4074445cbb45dc6ec132e67b7eac9f32dcfd53de.tar.gz |
Move worker into account tab
Diffstat (limited to 'ui/types.go')
-rw-r--r-- | ui/types.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ui/types.go b/ui/types.go index 14a91c31..5437642c 100644 --- a/ui/types.go +++ b/ui/types.go @@ -4,20 +4,19 @@ import ( tb "github.com/nsf/termbox-go" "git.sr.ht/~sircmpwn/aerc2/config" + "git.sr.ht/~sircmpwn/aerc2/worker/types" ) const ( Valid = 0 InvalidateTabList = 1 << iota InvalidateTabView - InvalidateSidebar InvalidateStatusBar ) const ( InvalidateAll = InvalidateTabList | InvalidateTabView | - InvalidateSidebar | InvalidateStatusBar ) @@ -34,6 +33,16 @@ type AercTab interface { SetParent(parent *UIState) } +type WorkerListener interface { + GetChannel() chan types.WorkerMessage + HandleMessage(msg types.WorkerMessage) +} + +type wrappedMessage struct { + msg types.WorkerMessage + listener WorkerListener +} + type UIState struct { Config *config.AercConfig Exit bool @@ -57,4 +66,6 @@ type UIState struct { } tbEvents chan tb.Event + // Aggregate channel for all worker messages + workerEvents chan wrappedMessage } |