Commit Graph

759 Commits (alpha-0.4.2)

Author SHA1 Message Date
Manos Pitsidianakis 70fb34a2e4
ui/sqlite3: add env body in sqlite3 fts table
Add the envelope body in the full text search table inside the sqlite3
db. Now search returns results matching the e-mail content as well.
2019-11-08 15:13:41 +02:00
Manos Pitsidianakis 3b5dc33d3e
ui/Account: store backend behind an Arc<RwLock<_>>
The backend object stores the state of the backend associated with an
account.

Hide the backend object between a mutex, in order to be able to share it
with threads in the next commit.
2019-11-08 15:13:41 +02:00
Manos Pitsidianakis d926cadc4d
melib: remove argument from MailBackend operation()
The operation() method on the MailBackend trait returns a trait object
that can read or modify an Envelope directly from the backend. This is
used to get eg the envelope's text, or set flags. It has two arguments,
envelope hash and folder hash.

Only the Maildir backend needed the latter argument, and it can be replaced with a dictionary to match envelope hashes to folder hashes within the Maildir backend.
2019-11-08 15:13:41 +02:00
Manos Pitsidianakis 0a606a71d1
Add reindex command 2019-11-08 15:13:41 +02:00
Manos Pitsidianakis 78eecbb104
melib: Hide Envelope behind RwLock
Envelope can now only be accessed from within a RwLock. Two new structs
are introduced: EnvelopeRef and EnvelopeRefMut. These hold a reference
to an Envelope and the mutex guard that keeps them alive.

This change allows sharing of the envelopes hash map amongst threads.
2019-11-08 15:13:41 +02:00
Manos Pitsidianakis e9d17f6897
add cache struct in Account 2019-11-08 15:13:41 +02:00
Manos Pitsidianakis d1184d4ea5
ui/search: add sorting in search 2019-11-08 15:13:41 +02:00
Manos Pitsidianakis 1b0b699527
ui/listing: mail filter refactoring
- show result count and 'Press ESC to go back' message
- search successfully even if currently viewing search results
2019-11-08 15:13:41 +02:00
Manos Pitsidianakis 3af6f338ce
add sqlite3 feature WIP 2019-11-08 15:13:41 +02:00
Manos Pitsidianakis 6b5ed25289
Add history browse option in execute bar
Press Ctrl-P and Ctrl-N to get previous and next command in history.
2019-11-08 15:09:25 +02:00
Manos Pitsidianakis 599bda9f28
ui: option to embed editor in composing tab
Add configuration option to embed editor in the composing tab instead of
executing and waiting for it.

Set embed = true in Composing section of your configuration to activate.
2019-11-05 08:37:58 +02:00
Manos Pitsidianakis 99da9a35b6
Add embed pty support
Emulate a terminal within meli. In the next commit it will be used to
embed an editor in the composing tab.

This is a non-complete xterm emulation that has some bugs.
2019-11-05 08:37:27 +02:00
Manos Pitsidianakis 0566937a76
imap: reconnect if connection timed out 2019-11-02 12:25:18 +02:00
Manos Pitsidianakis a9425be61e
ui/contacts: add side-menu, remove accounts tab
- Rename accounts tab to status tab
- add side menu to contacts tab to switch between accounts
2019-10-26 15:58:56 +03:00
Manos Pitsidianakis ce11447a1a
Add information about building on debian systems 2019-10-24 20:40:44 +03:00
Manos Pitsidianakis c64ce58653
ui/accounts: show totals in account tab 2019-10-24 20:36:20 +03:00
Manos Pitsidianakis ab531f0294
Fix unused variable warnings 2019-10-24 20:35:30 +03:00
Manos Pitsidianakis e5b6faf6bd
Add account online status
Add a boolean field to accounts that states if the account can be
accessed. Local backends (Maildir/mbox) return true every time, but
remote backends (IMAP) may not. Accounts start as offline and then get
initialised when their status goes to online. Right now if an IMAP
account startup but later get offline, there are crashes. With this
change the account can be switched back to offline when that happens.
2019-10-24 20:30:17 +03:00
Manos Pitsidianakis 9ef9293a45
ui/conf: use custom deserializer for extra settings
If the user gives a configuration value in an `[account]` sections that
 isn't hard-coded, it gets filed up under the
 `extra: HashMap<String, String>` field of `FileAccount`. If the setting
 is something that isn't a string like key = true, the parsing will fail
 since it expects string values. We want to accept key = true as well as
 key = "true".
2019-10-24 18:16:41 +03:00
Manos Pitsidianakis 63b984d854
Remove std feature that got introduced in 1.36.0
std::convert::From<&std::string::String> for String was introduced in
1.36.0 and version below that version fail. Use `to_string()` instead to
make it build again.
2019-10-24 12:29:08 +03:00
Manos Pitsidianakis 212e9bd701
Revert "Show manuals with command line arguments"
Since this commit requires `mandoc` as a build dependency, it is removed
for now until a better compromise is found.

This reverts commit 6a8f869e5b.
2019-10-24 12:19:29 +03:00
Manos Pitsidianakis cde9eb43f5
fixup manual 2019-10-24 12:18:56 +03:00
Manos Pitsidianakis 72e301887f
ui/compose: clear empty space area properly 2019-10-23 13:58:04 +03:00
Manos Pitsidianakis 6a8f869e5b
Show manuals with command line arguments
Add --manual, --conf-manual command line arguments that display manpages
through a pager. If no pager is found, this currently fails. It should
print the manuals to stdout instead.

The manuals are read from src/manuals and are generated with mandoc
whenever changes to the manpage sources meli.1 and meli.conf.5 are made.
2019-10-23 10:45:13 +03:00
Manos Pitsidianakis 3a86a7ca16
ui: harden bounds check in inspect_bounds macro 2019-10-20 11:35:43 +03:00
Manos Pitsidianakis 565b11634a
ui: add two readline shortcuts in text fields 2019-10-20 11:35:43 +03:00
Manos Pitsidianakis 1a02491f04
ui/compose: add modification detection
Detect if modifications were done to the draft in the compose tab so
that we can ask for confirmation if user wants to quit an unsaved draft.
2019-10-20 11:35:41 +03:00
Manos Pitsidianakis 5beed91df2
contacts: add support for externally managed contacts
Adds support for contacts (Cards) marked as `external_resource` which
prevents modifications from happening. No way to import external
contacts is added yet.
2019-10-20 11:32:31 +03:00
Manos Pitsidianakis dc525b9ddd
contacts: make CardId an enum
CardId is the "Primary Key" of the contact type, Card. Meli-created
contacts had UUIDs for their CardId. In order to import external
contacts and ensure their primary key is the same each time, CardId is
made into an enum to add hashing as a choice.
2019-10-20 11:25:57 +03:00
Manos Pitsidianakis f3e08c17aa
Update uuid dependency to 0.7.4 2019-10-20 11:25:57 +03:00
Manos Pitsidianakis 9de15284d8
ui: initialise cursor in fields at the end
By convention and usability reasons, the cursor in a text field should
be initialised at the end of the string.
2019-10-20 11:25:57 +03:00
Manos Pitsidianakis cfe6138c44
melib: add VCard parsing for contacts
Add rough VCard conversion for melib::Card, to use eventually with
contacts.
2019-10-16 14:57:48 +03:00
Manos Pitsidianakis fa3e3791e9
Fix test compilation error 2019-10-16 14:57:48 +03:00
Manos Pitsidianakis 271cae025b
ui/listing: add search shortcut 2019-10-15 23:47:37 +03:00
Manos Pitsidianakis b075501ef7
ui/listing: tidy mail listing shortcuts
- move set_seen to Listing component (instead of having it in Listing's
child Component)
- add default values to shortcut definition macro `shortcut_key_values`
- do not redefine default values in each `shortcuts` method after
getting all valid shortcuts from `context.settings.shortcuts.*.key_values()`
2019-10-15 23:47:37 +03:00
Manos Pitsidianakis 9c3284d3fe
ui/listings: add set_movement method to ListingComponent
Page movements is an enum that describes the movements of the keyboard
keys "Home, End, PageUp, PageDown". Some mail listing Components
interpret these keys as changes to their cursors.
2019-10-15 23:47:37 +03:00
Manos Pitsidianakis 9b2621145c
Add doco for window_title option 2019-10-15 23:47:37 +03:00
Manos Pitsidianakis 205ebe2f1c
ui: add window title config option
Use xterm window title escape sequences to set window title when
launched and restoring the previous one when exiting. If option is
blank, no title setting occurs.
2019-10-15 23:47:37 +03:00
Manos Pitsidianakis ccc58860e6
conf: move serde default attributes from field to struct 2019-10-15 23:47:37 +03:00
Manos Pitsidianakis d17deaca01
ui: add M-{i} tab change 2019-10-15 23:47:37 +03:00
Manos Pitsidianakis 52a89ddf94
Add license comment to melib/src/structs.rs 2019-10-15 23:47:37 +03:00
Manos Pitsidianakis ea3f47fa44
ui: clear all state in Listing::set_coordinates
If a listing lists search results, ie when "filtering" with a filter
term, it sets up its state in filtered_selection, filtered_order etc.
set_coordinates() should reset that state.
2019-10-07 16:47:05 +03:00
Manos Pitsidianakis d32f0982a9
melib: StackVec fixups
Fix bound checks and add clear() method
2019-10-07 16:46:32 +03:00
Manos Pitsidianakis fe4349692e
ui: break line when printing mailing list actions
Break line instead of hiding the mailing list actions from the user.
2019-10-06 11:33:18 +03:00
Manos Pitsidianakis febea423d9
ui: Add RawBuffer component for raw ansi content 2019-10-06 11:32:47 +03:00
Manos Pitsidianakis 6f816d29c5
conf: add ascii_drawing option
If set to true, box drawing is done with ascii characters.
2019-10-06 11:32:35 +03:00
Manos Pitsidianakis b25f10f92a
conf: add a light theme option 2019-10-06 11:31:53 +03:00
Matthias Beyer a0602274f8
Run cargo fmt 2019-10-04 20:47:25 +03:00
Manos Pitsidianakis 2bdb41311e
Remove unused imports from testing/src/imap_conn.rs 2019-10-04 20:42:01 +03:00
Matthias Beyer fa29aec83d
Fix: Add missing parameter
Reviewed-by: Manos Pitsidianakis <epilys@nessuent.xyz>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-10-04 20:34:19 +03:00