Commit Graph

231 Commits (master)

Author SHA1 Message Date
Manos Pitsidianakis 3d85ca2edf
Bump version to 0.8.2
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis eb5d49c41a
meli/terminal/cells: use Self in self methods
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 714744366f
mail/listing: revert 22525d40 behavior when sidebar not focused
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 73b3ed559d
mail/view: fix forward dialog not workng
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 22525d40fb
mail/listing: go to end when pressing next/page down for the second time
When navigating the sidebar menu, if you reach the last account entry
and hit next account, nothing happens. This commit makes it so that
you're pointed to the last mailbox instead.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 7eed82783a
Bump version to 0.8.1
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 3944e4e60e
meli: update to 2021 edition
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 81974311c2
mail/view: show current number command buffer
The command buffer in the envelope view records numbers the user presses
and then combines them with an action (e.g. type n in decimal; press
open_url action to open nth link, analogously with attachments).

Since a few commits ago, the command buffer number stopped being printed
on the envelope view.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 64ba0459ee
mail/compose: init cursor at To: header field
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 39e99770da
Use Context::current_dir() when saving files to relative paths
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis a4f0dbac26
Add current working directory tracking to Context
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 7e4ed2fa10
view/envelope: fix some out of bounds drawing.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 45d4f611b1
Add install-man cli subcommand to install manpages on your system
If meli is installed via cargo or a package without manpages, this
command can be used to install them to the user's system.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 747e39bf55
meli: add print-used-paths subcommand
Print all paths that meli creates/uses e.g. XDG data path and temp dir
path.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis bb4d200036
command/parser: unify toggle_* parsers
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 7e3e938631
mail/view: fix out-of-bounds draw when terminal is small
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 54862f8651
listing.rs: add hide_sidebar_on_launch option
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis b673af02ac
accounts.rs: move to crate root
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis dd4d0b7972
state.rs: fix typo
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 6476985ce6
Add Cross.toml for aarch64-unknown-linux-gnu builds
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 6d5ebb5b04
command: split code into submodules, add better error reporting
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis f0075b86cf
ui: show descriptive tab names for composer and threads
Instead of showing the nondescript tab names in the tab area,
use Subject or To: data from the draft in the composer and a subject
from the thread entries.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis a615b4701b
dependencies: embed xdg-utils crate
No reason to have it out of the tree.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 0a9c89b6b3
mail/view/thread: add toggle_layout shortcut
Toggles between horizontal and vertical layout. Previously it was
decided on the terminal width.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 49c36009ce
mail/view: don't initialize entire thread at once
For large threads, this would result in a lot of futures being created.
The user just wants to read one entry, not all of them. So prioritize
the open entry and some of the latest ones as an optimistic
pre-fetching.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis c7825c76c3
mail/view: handle dialog Esc in the parent component
Dialogues handled Esc themselves, which meant the event didn't bubble up
to their parent to let them know they should remove the dialogue. This
commit fixes that.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 3344a8dbf6
mail/view: remove unnecessary Clone derives
There's no need to clone MailViews when opening them in new tabs,
just initialize new ones with the same metadata. That saves us the
trouble of implementing Clone for all related types.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 1b3bebe304
view/thread: open earliest unread email instead of first in thread
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 0132677ff5
commands.rs: Introduce CommandError with context
There was no way to provide context to the user why their
command failed to be parsed. This commit paves the way of returning for
invalid domain values, invalid types, etc.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 2dc2940586
melib/build.rs: add feature to use cache instead of downloading unicode data
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis a337e2269e
contacts: refactor module structure
To prepare for more functionality, refactor contacts module.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 46636d8748
Bump version to 0.8.0
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 65e82d8896
Add meli/README.md symbolic link
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 1c79786ea2
Add scripts/make_html_manual_page.py
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 290cfb86c0
themes: add a highlighted_selected theme key
So that if you select a mail/thread entry that is currently under the
cursor (making it `highlighted`) you can also see its `selected` status.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 31aa9ad29e
listing: autogen mbox filename when exporting mail to directories
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 9037f08495
listing: replace hardcoded Key::{Home,End} values with shortcut values
Replace hardcoded Key::{Home,End} values with shortcut values
"home_page" and "end_page".

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis ffba203a3b
sidebar: add support for Home and End key navigation
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 8551e1ba0b
clippy: fix new 1.72 default clippy lints
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 64982b4cab
mail/view/thread: fix page{up,down} event bubbling up
When pressing PageUp, PageDown, Home, End shortcuts in ThreadView
entries, the event is bubbled up to the mailbox listing because
ThreadView::process_event() didn't return `true`. This commit fixes
this bug.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 974b3a5305
Update bitflags, rusqlite dependencies
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 946309c6f3
melib: do some small parser refactoring
- Use HeaderName in parsers instead of raw byte strings.
- Use byte literal constants where appropriate instead of repeating
  &b"___"[..]

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 3963103d55
contacts: prevent duplicate contact creation
When adding contacts from an envelope view, its hash/id/key was a random
Uuidv4, so it was always possible to add a contact again and again with
no limits. Now, the id is calculated from the hash of the email address
and display name, preventing duplicate additions.

Note that the hash algorithm is not supposed to be stable across
versions, meaning that in the future the same contact might have a
different hash. This means a more sophisticated method for
detecting/disallowing dupes must eventually be introduced.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis ab57e9420d
contacts: add delete_contact shortcut
New exciting feature: contact deletion.

Default shortcut is `d`.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 96f0b3e6b4
components: fix shortcut section order
Shortcut sections are shown in order, sorted by focus--as if widgets are
stacked vertically by the order you've opened them. In some widgets that
order was wrong.

Also, when a parent widget retrieved its child shortcuts, sometimes it
overwrote children sections if they both have them. This commit adds a
sealed trait ExtendShortcutsMaps that instead of overriding them, it
merges them with the child map having the priority.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis f193bdf685
meli/jobs_view: add column headers and sorting
Sort with `sort <index> [asc/desc]` command or by pressing `1..5` keys.
Press them again to toggle between asc and desc.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis f93adb683a
meli/terminal: replace change_color uses with change_theme
change_color() predated addition of Cell Attributes (Bold, Underline,
etc) so it didn't accept an attribute argument.

This commit adds a change_theme() function that does the same thing as
change_color() but also sets the cell attributes. It also takes a
ThemeAttribute as an argument instead of {fg, bg, attrs} individually.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis a1e7006186
melib: move Sort{Order,Field} to utils mod
We want to use SortOrder enum for non-thread purposes in the next
commit, so move it out of the thread module.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 52874f9a97
mail/view: cancel previous jobs on MailView drop/update
When MailView loads a new thread or gets dropped, cancel all pending
jobs.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis b3858de2f4
melib/error: impl From<io::ErrorKind> for ErrorKind
We inspect errors in the frontend to check for network errors. If the
network error comes from std::io, this would get converted to an Error
with description "timed out", kind OSError, and source the actual
networking error.

This commit converts network std::io::ErrorKinds into appropriate
native ErrorKinds.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 0f60009ea9
Makefile: add RUSTFLAGS with -D warnings 10 months ago
Manos Pitsidianakis 5c2b04719b
Normalize std::fmt::* imports 10 months ago
Manos Pitsidianakis 7c9a4b4b7c
meli: Move components/mail -> mail 10 months ago
Manos Pitsidianakis 64ab65ddff
meli: Move components/contacts -> contacts 10 months ago
Manos Pitsidianakis 005bf3881e
meli: Move components/utilities -> utilities 10 months ago
Manos Pitsidianakis a5446975c2
terminal: move braille and screen to their own module files 10 months ago
Manos Pitsidianakis 0ee1b6e018
account: start background watch job in init
When IsOnline was introduced, the background watch job stopped being
created when the connection was initialized. Restore that behavior.
11 months ago
Manos Pitsidianakis 8cb2a515e1
melib/smtp: use localhost in lieu of 127.0.0.1 for CI 11 months ago
Manos Pitsidianakis 1e084c1d85
melib: move backends out of the backends module
No reason to have such a deep module tree.
11 months ago
Manos Pitsidianakis 89c90f224a
melib: add `nntp` feature 11 months ago
Manos Pitsidianakis 7db930cabd
melib: rename `jmap_backend` feature to `jmap` 11 months ago
Manos Pitsidianakis fe7dcc508e
melib: rename `notmuch_backend` feature to `notmuch` 11 months ago
Manos Pitsidianakis 129f10911b
melib: rename `imap_backend` feature to `imap` 11 months ago
Manos Pitsidianakis 51e9fbe8f2
sqlite3: add account_name identifier to sqlite3 index database name 11 months ago
Manos Pitsidianakis 8e698cabcf
Fix unreachable-pub and disjoint-capture lint errors 11 months ago
Manos Pitsidianakis 2df7354751
mail/{listing,view}: fix overflow substracts 11 months ago
Manos Pitsidianakis 6280bc75e5
melib/jmap: fix blob download URL formatting 11 months ago
Manos Pitsidianakis 48a10f7241
melib: remove unused BackendOp::fetch_flags() method 11 months ago
Manos Pitsidianakis 561ba9c87b
listing: add relative_list_indices setting for thread listing 11 months ago
Manos Pitsidianakis 8abc9358a7
mail/pgp: add newline after Version: 1 header 11 months ago
Manos Pitsidianakis e9cd800f49
melib/nntp: add support for storing read status locally 11 months ago
Manos Pitsidianakis 519257b08f
listing: add relative_menu_indices setting for menubar 11 months ago
Manos Pitsidianakis ab418c1d39
pgp: refresh documentation, fix encryption/signing
Closes #259
11 months ago
Manos Pitsidianakis cf9a04a591
Add metadata to Jobs, and add JobManager tab
Opened with command `manage-jobs`
11 months ago
Manos Pitsidianakis 369c1dbdac
view/html: show `open` command in status bar 11 months ago
Manos Pitsidianakis 13fe64a027
Cache pgp signature verification results 11 months ago
Manos Pitsidianakis 6086a3789d
Fix libgpgme segfault error and re-enable gpg
Closes #255
11 months ago
Manos Pitsidianakis d4e605c098
Add tagref source code annotations
Source Code Annotation Tags:

Global tags (in tagref format <https://github.com/stepchowfun/tagref>)
for source code annotation:

- [tag:hardcoded_color_value] Replace hardcoded color values with user
   configurable ones.
- [tag:needs_unit_test]
- [tag:needs_user_doc]
- [tag:needs_dev_doc]
- [tag:FIXME]
- [tag:TODO]
- [tag:VERIFY] Verify whether this is the correct way to do something
- [tag:DEBT] Technical debt
11 months ago
Manos Pitsidianakis 74e15316db
view/envelope: open message/rfc822 attachments in subview instead of new tab 11 months ago
Manos Pitsidianakis c2ed3e283f
view/envelope: fix Source::* view showing only envelope body
Instead of the entire envelope source
11 months ago
Manos Pitsidianakis b0e867eb68
Move src to meli/src 11 months ago