Commit Graph

46 Commits (9ce62c735a80a5168c9d5982fe8ae9ac0e250fe0)

Author SHA1 Message Date
Manos Pitsidianakis 9ce62c735a
compose: add key selection state for gpg operations
Closes #81
2020-10-11 18:11:04 +03:00
Manos Pitsidianakis 39fab67523
compose: use melib::Bytes pretty print for attachment size 2020-10-11 16:53:05 +03:00
Manos Pitsidianakis 0ca7b0042e
utilities: ensure Form/Button widgets are not always non-dirty 2020-10-11 16:53:04 +03:00
Manos Pitsidianakis 406af1848f
compose: add `add-attachment-file-picker` command 2020-10-11 16:53:04 +03:00
Manos Pitsidianakis a4b78532b7
Refactor job structs into JoinHandle
Put oneshot::channel<R> into JoinHandle<R>
2020-10-11 16:53:04 +03:00
Manos Pitsidianakis 0dd9e6a34b
compose: kill selectors on ComponentKill 2020-10-11 16:53:04 +03:00
Manos Pitsidianakis eb1cb5cec6
compose: expand cursor reach to attachment area 2020-10-11 16:53:04 +03:00
Manos Pitsidianakis be45b0c02d
compose: add encrypt layer 2020-10-11 16:53:04 +03:00
Manos Pitsidianakis a2f11c341d
compose: add async draft filter stack in sending mail
Add a stack of "filter" closures that edit a draft before sending it.
Add PGP signing filter. An encryption filter will be added in a future
commit.
2020-10-11 16:53:04 +03:00
Manos Pitsidianakis 08df7f39b2
Add toggle encrypt action in composer
Does nothing for now, will be used in a future commit.
2020-10-11 16:53:04 +03:00
Manos Pitsidianakis 23ca41e3e8
add libgpgme feature 2020-10-05 21:10:00 +03:00
Manos Pitsidianakis 83bee279e6
melib/email/compose: set attachment status
Set Content-Disposition: attachment to, well, attachments.
2020-09-16 19:57:06 +03:00
Manos Pitsidianakis fadf20d7b1
NotificationType: add melib::ErrorKind 2020-09-13 15:23:14 +03:00
Manos Pitsidianakis 20b02ffd4f
Lookup tag color/ignore settings in all three setting levels
There are three setting levels for tag settings:

- per mailbox override    ^
- per account override    |
- global setting          |
                        depth

So lookup in each of them in this order for configuration, not just the
deepest level.
2020-09-12 23:02:06 +03:00
Manos Pitsidianakis c6c0da7fcb
melib: cleanup commit
Cleanup melib module exports, add some document tests, change some
documentation.
2020-09-10 21:19:38 +03:00
Manos Pitsidianakis 14663e46b9
Remove some old TODO comments 2020-08-26 00:54:07 +03:00
Manos Pitsidianakis 8d50e83a33
melib/email: add case-insensitive Header struct
- HeaderName is either 32 or less inlined bytes or heap-allocated vec for more than that.
- Equality and hashing is case-insensitive
- A HeaderMap is a hashmap from HeaderName to Strings that can be
indexed with &str, case insensitive. Insertion order is also preserved
2020-08-26 00:54:06 +03:00
Manos Pitsidianakis 9928ee78e7
Add Reply{ToAuthor,ToAll} actions
- previous Reply action now lets you select recipients by default
- ReplyToAuthor selects the Envelope author as recipient
- ReplyToAll selects all addresses
2020-08-26 00:54:05 +03:00
Manos Pitsidianakis 9afbdd4887
Add insert_user_agent option in composing
Add option for automatically inserting a 'User-Agent' header in new
drafts.
2020-08-26 00:54:05 +03:00
Manos Pitsidianakis 8a6bf3b217
Preserve Account order from configuration file
Use IndexMap to preserve the order of accounts in the UI from the
account definitions.
2020-08-26 00:54:05 +03:00
Manos Pitsidianakis 77dc1d74bf
Add smtp client support for sending mail in UI
`mailer_command` was removed, and a new setting `send_mail` was added.

Its possible values are a string, consisting of a shell command to
execute, or settings to configure an smtp server connection. The
configuration I used for testing this is:

  [composing]
  send_mail = { hostname = "smtp.mail.tld", port = 587, auth = { type = "auto", username = "yoshi", password = { type = "command_eval", value = "gpg2 --no-tty -q -d ~/.passwords/msmtp/yoshi.gpg" } }, security = { type = "STARTTLS" } }

For local smtp server:
  [composing]
  send_mail = { hostname = "localhost", port = 25, auth = { type = "none" }, security = { type = "none" } }
2020-07-15 15:24:01 +03:00
Manos Pitsidianakis ddafde7b37
jobs: save handle for each Job
If we save the JoinHandle for each task, we can cancel it in future
commits if we have to timeout network requests.
2020-07-15 15:22:33 +03:00
Manos Pitsidianakis 899d497c9c
Rename _cmd options to _command for consistency 2020-07-08 12:12:15 +03:00
Manos Pitsidianakis a7e177586a
Fix clippy lints 2020-07-06 15:27:08 +03:00
Manos Pitsidianakis bbedeed3e3
More imap async fixes 2020-07-06 15:27:06 +03:00
Manos Pitsidianakis b3876113aa
BackendOp: return future in as_bytes() 2020-07-06 15:26:39 +03:00
Manos Pitsidianakis 58aff83b95
Change "Draft saved" to "Message saved" 2020-06-26 21:12:57 +03:00
Manos Pitsidianakis 4ae7a57d45
Add save-draft command 2020-06-23 20:11:05 +03:00
Manos Pitsidianakis efb06be09b
melib: return Result<_> from operation()
Envelope might have been deleted before main thread requests an
operation, which is a race condition.
2020-06-23 20:10:54 +03:00
Manos Pitsidianakis 6ec249dd7f
melib: update nom dependency from 3.2.0 to 5.1.1
That was hecking exhausting
2020-06-06 23:19:07 +03:00
Manos Pitsidianakis bd404e6937
Execute user shell commands with /bin/sh
Execute user provided command invocations $CMD such as `editor_cmd` with
`/bin/sh` as `/bin/sh -c "$CMD"

Previously, user commands were split by whitespace which must trigger
erroneous behavior if quotes are involved.
2020-05-28 21:02:49 +03:00
Manos Pitsidianakis 3ea1ce5454
errors: add `source` field to MeliError 2020-05-09 14:32:30 +03:00
Manos Pitsidianakis 4930d1b46c
Add Italics, Blink, Dim and Hidden text attributes
Text attributes have been rewritten as bit flags, so for example instead of
"BoldUnderline" you'd have to define "Bold | Underline" in your theme
settings.

Requested in #21
2020-04-05 15:57:05 +03:00
Manos Pitsidianakis 9ff54f236b
Add conf_override! macro
conf_override! wraps struct definitions and defines a secondary Override
struct that wraps each field in an Option. The macro mailbox_settings!
is used to select settings from an account & mailbox index. If a user defines an overriding setting, the macro returns the override instead of the immediately next in the hierarchy setting.

The selection is done for a specific field as follows:

  if per-folder override is defined, return per-folder override
    else if per-account override is defined, return per-account override
      else return global setting field value.
2020-03-18 19:13:07 +02:00
Manos Pitsidianakis 9d20fd5576
Save forked processes for reaping 2020-03-01 17:56:58 +02:00
Manos Pitsidianakis 6c76db2063
Add delete, copy actions for envelopes 2020-03-01 17:48:10 +02:00
Manos Pitsidianakis 2a9059f9b4
Add add-attachment from pipe, default_header_values 2020-03-01 17:45:55 +02:00
Manos Pitsidianakis 63467a3c45
Check ComponentId equality on Composer::kill() 2020-02-28 09:18:31 +02:00
Manos Pitsidianakis 670485e8c7
compose: clear bounds of compose area properly 2020-02-28 09:15:11 +02:00
Manos Pitsidianakis 65666e6695
Fix double call of restore_input
restore_input is called in State::rcv_event on arrival of a fork
finished event:

```
            UIEvent::Fork(ForkType::Finished) => {
                self.switch_to_main_screen();
                self.switch_to_alternate_screen();
                self.context.restore_input();
                return;
            }
```

So there shouldn't be an extra call here.
2020-02-27 16:37:42 +02:00
Manos Pitsidianakis 4ac52d9d5b
Replace every use of Folder with Mailbox
Use Mailbox for consistency.
2020-02-26 10:54:10 +02:00
Manos Pitsidianakis c4c11e4abc
Make Selector widget accept FnOnce 2020-02-25 22:15:13 +02:00
Manos Pitsidianakis a806571322
Add UIDialog and UIConfirmationDialog widgets
They are just typedefs for the Selector widget. The API is kind of
messed up and this commit is part of the process of cleaning it up:
right now to use this, you check the is_done() method which if returns
true, the done() method executes the closure you defined when creating
the widget. The closure returns a UIEvent which you can forward
application-wide by context.replies.push_back(event) or handle it in
process_event() immediately.
2020-02-19 16:57:37 +02:00
Manos Pitsidianakis eef007600b
ui: improve theming coverage 2020-02-08 23:56:08 +02:00
Manos Pitsidianakis eb501b6d50
ui: add ThemeAttribute argument to clear_area()
clear_area() sets the cleared cell attributes according to the new
argument.
2020-02-08 23:54:15 +02:00
Manos Pitsidianakis 8b6ea8de9a
Remove ui crate
Merge ui crate with root crate.

In preparation for uploading `meli` as a separate crate on crates.io.

Workspace crates will need to be published as well and having a separate
`ui` crate and binary perhaps doesn't make sense anymore.
2020-02-04 17:29:55 +02:00