aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/account-wizard.go
Commit message (Collapse)AuthorAgeFilesLines
* lint: add missing panic handlers in goroutinesRobin Jarry2023-01-061-0/+2
| | | | | | | | These issues were all reported by the new custom analyzer introduced in previous commit. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* config: parse account from and aliases onceRobin Jarry2023-01-041-1/+8
| | | | | | | | | Instead of accepting any garbage for these configuration fields, parse them when parsing accounts.conf and store mail.Address objects. Reuse these objects everywhere. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* wizard: debounce warning to ensure pasted passwords are entered correctlyMoritz Poldrack2022-12-201-1/+12
| | | | | | | | | | | | | When entering passwords from a password-manager the wizard shows it's warning right after the first character has been pasted and the rest of the password is lost. Debounce the displaying of the "stored in plaintext"-warning to only show after the password has been entered. Reported-by: qbit (@qbit:tapenet.org) Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* config: make various sections accessible via global varsRobin Jarry2022-12-141-41/+38
| | | | | | | | | | | | | | | | | | | | There is only one instance of AercConfig which is associated to the Aerc widget. Everywhere we need to access configuration options, we need somehow to get a reference either to the Aerc widget or to a pointer to the AercConfig instance. This makes the code cluttered. Remove the AercConfig structure and every place where it is referenced. Instead, declare global variables for every configuration section and access them directly from the `config` module. Since bindings and ui sections can be "contextual" (i.e. per account, per folder or per subject), leave most local references intact. Replacing them with config.{Ui,Binds}.For{Account,Folder,Subject} would make this patch even more unreadable. This is something that may be addressed in the future. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* doc: extract accounts and binds into separate man pagesRobin Jarry2022-11-241-1/+1
| | | | | | | | | | | | | aerc-config(5) is getting too big and cluttered. Only keep aerc.conf settings in it. Move binds.conf settings in aerc-binds(5) and accounts.conf settings in aerc-accounts(5). Adjust all references accordingly. Update the README to reference the two new man pages. Update the Makefile to install them in proper locations. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Koni Marti <koni.marti@gmail.com>
* invalidatable: cleanup dead codeTim Culverhouse2022-10-121-14/+1
| | | | | | | | Remove invalidatable type and all associated calls. All items can directly invalidate the UI. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* wizard: add plaintext password warningKoni Marti2022-08-221-0/+18
| | | | | | | | | Warn users that the passwords are stored as plaintext. Add recommmendation to use personal password store. Implements: https://todo.sr.ht/~rjarry/aerc/39 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: homogenize operations and minor fixes (gocritic)Moritz Poldrack2022-08-041-2/+1
| | | | | | | | | | | | | | | | | | Apply GoDoc comment policy (comments for humans should have a space after the //; machine-readable comments shouldn't) Use strings.ReplaceAll instead of strings.Replace when appropriate Remove if/else chains by replacing them with switches Use short assignment/increment notation Replace single case switches with if statements Combine else and if when appropriate Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: removed unused code (deadcode, structcheck, unused)Moritz Poldrack2022-08-041-1/+0
| | | | | Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: ensure errors are at least logged (errcheck)Moritz Poldrack2022-08-041-6/+7
| | | | | Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: simplify code (gosimple)Moritz Poldrack2022-08-041-1/+1
| | | | | | | | | | | | | | Replaces infinite for loops containing a select on a channel with a single case with a range over the channel. Removes redundant assignments to blank identifiers. Remove unnecessary guard clause around delete(). Remove `if condition { return true } return false` with return condition Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: apply new formatting rulesMoritz Poldrack2022-08-011-1/+1
| | | | | | | Run `make fmt`. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* outgoing-cred-cmd: delay execution until an email needs to be sentStas Rudakou2022-07-311-1/+1
| | | | | | | | | | | | | | | | | | This can be useful in cases when: 1. outgoing-cred-cmd requires a user action or confirmation (e.g. when using pass with a Yubikey or similar smart card that requires a user to enter a pin or touch the device when decrypting the password) 2. A user starts aerc frequently, but not all the sessions end up with sending emails 3. So the user only wants to execute outgoing-cred-cmd when the password is really used, so the user doesn't have to enter pin or touch their Yubikey each time aerc starts Signed-off-by: Stas Rudakou <stas@garage22.net> Acked-by: Robin Jarry <robin@jarry.cc>
* logging: use level-based logger functionsRobin Jarry2022-07-231-2/+1
| | | | | | | | | | | | Do not pass logger objects around anymore. Shuffle some messages to make them consistent with the new logging API. Avoid using %v when a more specific verb exists for the argument types. The loggers are completely disabled (i.e. Sprintf is not even called) by default. They are only enabled when redirecting stdout to a file. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* uiconfig: use pointer references to uiConfigTim Culverhouse2022-07-031-16/+16
| | | | | | | | This patch changes references to uiConfig in function signatures and structs to be pointers. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* logging: fix race condition in startupMoritz Poldrack2022-03-241-1/+1
| | | | | | | | | If a panic occurs in one of the workers, it can happen after the UI was initialised, but before the cleanup function has been registered. With this the start of the worker loops is deferred until the cleanup routine was registered. Signed-off-by: Moritz Poldrack <git@moritz.sh>
* go vet: composite literal uses unkeyed fieldsMoritz Poldrack2022-03-181-49/+49
| | | | | | | | This commit fixes all occurrences of the abovementioned lint-error in the codebase. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* go.mod: change base git urlRobin Jarry2021-11-051-2/+2
| | | | | | | I'm not sure what are the implications but it seems required. Link: https://github.com/golang/go/issues/20883 Signed-off-by: Robin Jarry <robin@jarry.cc>
* view,compose: use border color to separate headers from bodyRobin Jarry2021-10-281-11/+11
| | | | | | | | | | When composing a message, there is an empty fill line between the headers and the text editor. The line is printed with the default style which may cause users to assume it is part of the editor. Display the fill lines with the border color to avoid confusion. Signed-off-by: Robin Jarry <robin@jarry.cc>
* Get rid of the aerc.PushError(" " + $string) idiomReto Brunner2021-01-301-3/+3
| | | | The individual callers should not be responsible for padding
* update tcell to v2 and enable TrueColor supporty0ast2020-12-181-1/+1
| | | | | | | | | Also update to the tcell v2 PaletteColor api, which should keep the chosen theme of the user intact. Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop clipping the value to one of the theme colors. Generally this is desired behaviour though.
* show error if account view creation failsReto Brunner2020-08-101-1/+6
| | | | | | | | This can happen for example if aerc is compiled without notmuch support but the notmuch worker is requested. Pushing a status message isn't good enough, as this gets overridden pretty quickly if one has multiple accounts configured. So we show a fullscreen error instead.
* Rename selecter to selectorKalyan Sriram2020-08-061-15/+15
|
* Implement style configuration.Kalyan Sriram2020-08-061-44/+58
| | | | | | Introduce the ability to configure stylesets, allowing customization of aerc's look (color scheme, font weight, etc). Default styleset is installed to /path/to/aerc/stylesets/default.
* Revert "Implement style configuration."Reto Brunner2020-07-301-58/+44
| | | | This reverts commit 1ff687ca2b0821c2cacc1fa725abb3302d2af9da.
* Revert "Rename selecter to selector"Reto Brunner2020-07-301-15/+15
| | | | This reverts commit 2c244222d508a32d3f5ba600944a46b6fdea1a10.
* Rename selecter to selectorKalyan Sriram2020-07-301-15/+15
|
* Implement style configuration.Kalyan Sriram2020-07-301-44/+58
| | | | | | Introduce the ability to configure stylesets, allowing customization of aerc's look (color scheme, font weight, etc). Default styleset is installed to /path/to/aerc/stylesets/default.
* Make grid sizes dynamicJeffas2020-06-091-49/+49
| | | | | | | | | The grid used static sizes which meant that changing settings didn't have an effect on elements of the ui, notably the sidebar width. This patch makes the `Size` parameter of a cell a function which returns the `int`, allowing for dynamic sizes. A `Const` function is also included for ease of use for static sizes.
* Revert "Add Style configuration"Drew DeVault2020-05-281-62/+47
| | | | This reverts commit 0f78f06610c0e8887aba2ae50e99b86477a384b3.
* Revert "Remove duration from the status methods"Drew DeVault2020-05-281-3/+4
| | | | This reverts commit f06d683688e3d2139b14f67b7e349089e7200bf4.
* Remove duration from the status methodsReto Brunner2020-05-271-4/+3
| | | | We always set 10 seconds anyhow, might as well do that without repeating ourselfs.
* Add Style configurationReto Brunner2020-05-271-47/+62
| | | | | | | | | | The following functionalities are added to configure aerc ui styles. - Read stylesets from file with very basic fnmatch wildcard matching - Add default styleset - Support different stylesets as part of UiConfig allowing contextual styles. - Move widgets/ui elements to use the stylesets. - Add configuration manual for the styleset
* gofmt fixesDrew DeVault2020-04-241-3/+3
|
* Use aerc.PushError where appropriateBen Fiedler2020-04-231-7/+3
| | | | Forgot an unused import, to save you the hassle here is v2.
* Add UI options to save/pipe messages with unsupported mimetypesGreg Anders2019-11-171-103/+7
| | | | | | | | | | | | | | | Adds a message indicating the user's ability to :save or :pipe a message with an unsupported mimetype and also adds a selector widget (similar to the tutorial). The selector widget was previously defined in the account wizard module, so this commit breaks it out into its own module to allow for re-use. Further, modify the BeginExLine() function to take an argument that pre-populates the command line, allowing functions to initiate an ex command without executing it. Closes #95.
* Add MouseableJeffas2019-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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.
* Add backtab to tutorial navigationJeffas2019-07-111-1/+3
| | | | | | | | This allows users to use backtab (Shift+tab) to go back through the fields in the tutorial, like C-K. This then mimics the other methods in having a forward and backward variant. Also documented this in the wizard help paragraph.
* account-wizard: look up imap and smtp server by SRV records (#100)Daniel Lublin2019-06-251-1/+42
|
* account-wizard: automatically replace imap.* with smtp.*Noah Loomans2019-06-181-1/+6
| | | | | | | | | Many email providers use the imap sub-domain for imap and the smtp sub-domain for smtp. FastMail is an example of this[1]. This is a small quality-of-life improvement which automatically replaces imap.* with smtp.* when going from the imap screen to the smtp screen in the wizard [1]: https://www.fastmail.com/help/technical/servernamesandports.html
* Introduce :new-account -tJanUlrich2019-06-051-14/+22
| | | | | | | | Adding the [-t] temporary flag to the new-account command - when using -t a newly created account will not be stored into the accounts.conf Issue #134
* Show account wizard if no accounts configuredDrew DeVault2019-05-221-5/+2
|
* Implement opening tutorial after account wizardDrew DeVault2019-05-221-1/+21
|
* Write new accounts to config and open tabDrew DeVault2019-05-221-7/+139
|
* Remove excess padding from incoming config pageDrew DeVault2019-05-211-1/+1
|
* New account wizard, part oneDrew DeVault2019-05-211-0/+625