aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/account.go
Commit message (Collapse)AuthorAgeFilesLines
* Add MouseableJeffas2019-09-111-2/+9
| | | | | | | | | | | | | | | | | | | | | | This adds the Mouseable interface. When this is implemented for a component that item can accept and process mouseevents. At the top level when a mouse event is received it is passed to the grid's handler and then it trickles down until it reaches a component that can actually handle it, such as the tablist, dirlist or msglist. A mouse event is passed so that components can handle other things such as scrolling with the mousewheel. The components themselves then perform the necessary actions. Clicking emails in the messagelist opens them in a new tab. Textinputs can be clicked to position the cursor inside them. Mouseevents are not forwarded to the terminal at the moment. Elements which do not handle mouse events are not required to implement the Mouseable interface.
* Ignore scroll command when msgstore is nilJelle Besseling2019-08-121-0/+3
| | | | | | | | | Fixes ~sircmpwn/aerc2#205. Many functions do a nil check on the store, so this changes Store() so it returns nil when msglist is nil. It also places the Scroll() behind the nil check in the next-message command. https://todo.sr.ht/~sircmpwn/aerc2/205
* msglist: add initialization stateReto Brunner2019-08-021-0/+2
| | | | | | | | | Make the msglist aware of whether we are still initializing or not. We never stopped spinning the msglist if we didn't get any Directories back from types.ListDirectories. With this change, we can set the init state from the account and display the spinner only if we don't know whether we have directories or not and else the "no messages" string from the config.
* Ring bell when new messages arrive0.2.0Ben Burwell2019-07-291-0/+4
| | | | | | | | Add a "new-message-bell" option to the UI section of aerc.conf. A new hook into the message store allows the msglist widget to detect new messages being added to the displayed list. When new messages are delivered, and the new-message-bell option is enabled (as it is by default), the terminal will beep.
* Move msgstore map to dirstoreJeffas2019-07-261-25/+23
| | | | | | This map represents a mapping from directory names to their associated messagestores anyway so they should be under dirstore. This simply moves them there and adds some methods required to interact with them.
* Add new-email triggerJeffas2019-07-261-1/+5
| | | | | | | | | | | | | | | | | This patch sets up the trigger config section of aerc.conf. Each trigger has its own function which is called from the place where it is triggered. Currently only the new-email trigger is implemented. The triggers make use of format strings. For instance, in the new-email trigger this allows the user to select the trigger command and also the information extracted from the command and placed into their command. To actually execute the trigger commands the keypresses are simulated. Further triggers can be implemented in the future. Formatting of the command is moved to a new package.
* Implement :filter, :clearKevin Kuehler2019-07-191-1/+1
| | | | Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
* Fix crashes when operating on empty folder (#216)Daniel Bridges2019-07-101-2/+6
|
* Factor UI models out of the worker message packageBen Burwell2019-07-081-4/+5
| | | | | | | | Before, the information needed to display different parts of the UI was tightly coupled to the specific messages being sent back and forth to the backend worker. Separating out a models package allows us to be more specific about exactly what a backend is able to and required to provide for the UI.
* Make :pipe command more genericDrew DeVault2019-07-051-2/+6
|
* Set empty message in dirlist if no folder exist.Reto Brunner2019-06-141-2/+4
|
* imap: respect the folder config optionReto Brunner2019-06-141-1/+1
|
* Add archive commandRobert Günzler2019-06-091-0/+2
| | | | | | | | | | | | | | | Adds an archive command that moves the current message into the folder specified in the account config entry. Supports three layouts at this point: - flat: puts all messages next to each other - year: creates a folder per year - month: same as above, plus folders per month This also adds a "-p" argument to "cp" and "mv" that works like "--parents" on mkdir(1). We use this to auto-create the directories for the archive layout.
* Add binding to toggle headersDrew DeVault2019-06-071-1/+1
|
* Skip rendering dirlist if sidebar width is 0Lucas F. Souza2019-06-071-1/+3
|
* widget: Add ProvidesMessage interfaceKevin Kuehler2019-06-021-0/+12
| | | | | | | | | | | Consists of 3 functions * Store: Access to MessageStore type * SelectedAccount: Access to Account widget that the target widget belongs to * SelectedMessage: Current message (selected in msglist or the one we are viewing) Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
* Only add message to store if store existsKevin Kuehler2019-06-021-8/+12
| | | | | | | Prevents the program from panicing when changing folders too quickly. onMessage can race store creation for an AccountView. Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
* Load IMAP worker for imap+insecureDrew DeVault2019-05-201-1/+5
|
* Verify TLS certificatesDrew DeVault2019-05-201-7/+1
| | | | | | I was partway done implementing a UI for users to approve untrusted certs with, but let's just make them configure their servers right instead.
* Update internal state and draw from the same goroutineSimon Ser2019-05-191-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new Aerc.Tick function that should be called to refresh the internal state. This in turn makes each AccountView process worker events. The UI goroutine repeatedly refreshes the internal state before drawing a new frame. The reason for this is that many worker messages may need to be processed for a single frame, and drawing the UI is far slower than refreshing the internal state. This has been confirmed in my testing (calling Aerc.Tick only once per frame results in a slower display). Many synchronization code has been removed. We can now write widgets without having to care so much about races. The remaining sync users are: - widgets/spinner: the spinner value is updated from inside an internal goroutine - lib/ui/invalidatable: Invalidate may be called from any goroutine - lib/ui/grid: same - lib/ui/ui: an internal goroutine needs read access to UI.exit - worker/types/worker: Worker.callbacks is used for both worker and UI callbacks The exact goroutine requirements for Drawable have been documented.
* s/aerc2/aerc/gDrew DeVault2019-05-171-5/+5
|
* Remove unimplemented color configurationDrew DeVault2019-05-171-1/+1
| | | | Will probably end up doing this differently anyway
* Implement (basic form) of :replyDrew DeVault2019-05-161-4/+8
|
* Implement :copy (aka :cp)Drew DeVault2019-05-141-0/+4
|
* Handle incoming emails gracefullyDrew DeVault2019-05-131-6/+6
|
* Populate "From" header from config for new emailsDrew DeVault2019-05-131-0/+4
|
* lib/ui: introduce InvalidatableSimon Ser2019-04-271-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many Drawable implementations have their own Invalidate and OnInvalidate functions, with an unexported onInvalidate field. However OnInvalidate and Invalidate are usually not called in the same goroutine. This results in a race on this field, e.g.: Read at 0x00c000094748 by goroutine 7: git.sr.ht/~sircmpwn/aerc2/widgets.NewDirectoryList.func1() /home/simon/src/aerc2/widgets/dirlist.go:85 +0x56 git.sr.ht/~sircmpwn/aerc2/widgets.(*Spinner).Start.func1() /home/simon/src/aerc2/widgets/spinner.go:93 +0x1bb Previous write at 0x00c000094748 by main goroutine: [failed to restore the stack] Goroutine 7 (running) created at: git.sr.ht/~sircmpwn/aerc2/widgets.(*Spinner).Start() /home/simon/src/aerc2/widgets/spinner.go:46 +0x8f git.sr.ht/~sircmpwn/aerc2/widgets.NewDirectoryList() /home/simon/src/aerc2/widgets/dirlist.go:37 +0x286 git.sr.ht/~sircmpwn/aerc2/widgets.NewAccountView() /home/simon/src/aerc2/widgets/account.go:50 +0x5ca git.sr.ht/~sircmpwn/aerc2/widgets.NewAerc() /home/simon/src/aerc2/widgets/aerc.go:60 +0x800 main.main() /home/simon/src/aerc2/aerc.go:65 +0x33e To fix this, introduce a new type, Invalidatable, which protects the field. Unfortunately the Drawable must be passed to the callback function in Invalidate, so we still need to re-implement this in each Invalidatable user.
* Make message viewer real, part twoDrew DeVault2019-03-311-1/+1
|
* Correct color of error messagesDrew DeVault2019-03-301-1/+1
|
* Add body fetching support codeDrew DeVault2019-03-291-0/+3
|
* Implement :delete-messageDrew DeVault2019-03-201-0/+3
|
* Move exline handling up to aerc, add :termDrew DeVault2019-03-171-97/+23
|
* Add basic terminal widgetDrew DeVault2019-03-171-6/+21
|
* Move MessageStore into its own fileDrew DeVault2019-03-151-3/+4
|
* Implement default in accounts.confDrew DeVault2019-03-151-1/+1
|
* Implement sidebar-width config optionDrew DeVault2019-03-151-1/+1
|
* Rig up key bindingsDrew DeVault2019-03-151-27/+53
|
* Implement :{next,prev}-messageDrew DeVault2019-03-141-0/+4
|
* Use cached message store when re-opening dirsDrew DeVault2019-03-141-1/+9
|
* Implement :cd commandDrew DeVault2019-03-141-0/+5
|
* Implement message store side of message fetchingDrew DeVault2019-03-141-2/+2
|
* Lay out message list widget basic designDrew DeVault2019-03-141-4/+7
|
* Fetch valid UIDs from server after opening dirDrew DeVault2019-03-101-6/+29
|
* Improve error reportingDrew DeVault2019-03-101-3/+2
|
* Flesh out command parsing & handlingDrew DeVault2019-03-101-1/+1
|
* Start building out command subsystemDrew DeVault2019-03-101-1/+9
|
* Fix buildElias Naur2019-02-101-1/+1
|
* Implement Container interface in widgets/Drew DeVault2019-01-201-0/+4
|
* Send commands up to the top-level aerc widgetDrew DeVault2019-01-141-4/+10
|
* Handle errors from worker initializationDrew DeVault2019-01-131-1/+1
|