Commit Graph

482 Commits

Author SHA1 Message Date
Manos Pitsidianakis
749d453f00
ui: add query parsers 2019-11-08 15:13:42 +02:00
Manos Pitsidianakis
8488ce21bf
ui: move is_online() check to Context
Context needs to know when an account gets online in order to get the
mailbox hashes and launch the watcher threads for this account. Instead
of assuming all accounts are online when launching meli, move the
initialisation logic to an is_online() method on Context to do it on
demand.

The is_online() method is then called by ui::components::mail::Listing
everytime it's drawn to check for status changes.
2019-11-08 15:13:42 +02:00
Manos Pitsidianakis
61fa6d3d4b
ui: show supported IMAP CAPABILITIES list in Status
In status page for IMAP accounts, show a list of CAPABILITIES and
whether meli supports them
2019-11-08 15:13:42 +02:00
Manos Pitsidianakis
d780d81891
Add account statuses in Status tab
List accounts and information about them in Status tab
2019-11-08 15:13:42 +02:00
Manos Pitsidianakis
8ba9500de6
sqlite3: small refactors and fixes 2019-11-08 15:13:42 +02:00
Manos Pitsidianakis
f718510eeb
ui/listings: split events according to length
Some events are invalid when there are no messages shown in the listing.
Instead of checking for self.length > 0 in each of these events, put
them together in an if block.
2019-11-08 15:13:41 +02:00
Manos Pitsidianakis
498f8e8e21
ui/listings: Show errors when filtering
Errors were not shown properly because the data_columns grids were being
overwritten by redraw_list(). Call redraw_list() only if filtering was
succesful.
2019-11-08 15:13:41 +02:00
Manos Pitsidianakis
78955e3199
sqlite3: rename index db to index.db 2019-11-08 15:13:41 +02:00
Manos Pitsidianakis
d0c9774fe2
imap: disable sqlite3 full text search
Disable temporarily until server-side search is implemented.
2019-11-08 15:13:41 +02:00
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
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
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
72e301887f
ui/compose: clear empty space area properly 2019-10-23 13:58:04 +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
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
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
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
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
Manos Pitsidianakis
9a3b9b1409
conf: move html_filter to PagerSettings
html_filter was in Account settings, but it makes more sense for it to
be in PagerSettings
2019-10-03 19:51:34 +03:00
Manos Pitsidianakis
f14381056f
ui: small fix in view.rs 2019-10-03 19:11:02 +03:00
Manos Pitsidianakis
f485079404
ui: align buttons in Selector
Correct alignment of Ok, Cancel buttons
2019-10-03 14:38:58 +03:00
Manos Pitsidianakis
37a4b553bc
ui: ask user if they want to reply or reply to all in mailing lists 2019-10-03 12:22:01 +03:00
Manos Pitsidianakis
cd761b3166
ui: revamp option dialog
Selector component shows choices/options to the user. Ok and Cancel
buttons were added, along with a window border and window title.
2019-10-03 01:03:20 +03:00
Manos Pitsidianakis
51bb50abf3
Add support for aarch64 target 2019-09-29 15:44:15 +03:00
Manos Pitsidianakis
2b5472adc3
Add set_seen shortcut in CompactListing 2019-09-29 01:55:39 +03:00
Manos Pitsidianakis
b7edec0274
Bump version to 0.3.2 2019-09-28 12:25:44 +03:00
Manos Pitsidianakis
e35a93336a
Add GPG signing and sig verifying 2019-09-28 12:19:22 +03:00
Manos Pitsidianakis
250129665b
Pass attachment names through decoding
Attachment names in Content-Type parameters can be encoded (eg
=?UTF-8...), so try decoding with phrase() first
2019-09-27 22:21:35 +03:00
Manos Pitsidianakis
19ec6e54fc
Dont show notification for seen or draft Envelopes 2019-09-27 13:40:02 +03:00
Manos Pitsidianakis
31543bf2f9
ui: update CompactListing based on ConversationsListing 2019-09-27 13:40:02 +03:00
Manos Pitsidianakis
b3e1d88898
compose: rename Overview to ThreadView 2019-09-27 13:40:02 +03:00
Manos Pitsidianakis
d8ada69897
compose: don't lose draft if Draft folder isn't available
Try saving in INBOX or another folder instead. On complete failure, save
in /tmp/
2019-09-27 13:40:02 +03:00
Manos Pitsidianakis
68c40a2920
melib: return Result with error when an IO operation fails
Don't unwrap anything because this might be temporary, for example a
short IMAP disconnection.
2019-09-27 13:40:02 +03:00
Manos Pitsidianakis
d44a68ec69
ui: don't quit if editing a draft
Ask user to save draft or discard it.
2019-09-27 13:40:02 +03:00
Manos Pitsidianakis
713c4f73b9
conf: add editor_cmd setting
Set the editor to launch in configuration. If it's missing, check for
$EDITOR
2019-09-27 13:39:55 +03:00
Manos Pitsidianakis
0ece51612f
update bincode to 1.2.0 2019-09-26 18:25:30 +03:00
Manos Pitsidianakis
fa121820f7
Bump version to 0.3.1 2019-09-26 14:11:24 +03:00
Manos Pitsidianakis
ef338f353d
ui: add PGP settings in configuration 2019-09-26 14:09:01 +03:00
Manos Pitsidianakis
6d40a57a2e
ui: scroll in shortcuts panel 2019-09-26 13:11:53 +03:00
Manos Pitsidianakis
91ae539de1
Small fixes 2019-09-26 13:11:49 +03:00
Manos Pitsidianakis
f27b815aa7
Add verification of GPG signed messages 2019-09-26 13:11:08 +03:00
Manos Pitsidianakis
9305e543cf
melib: add a body field to Attachment
Attachment needs to know the range of bytes where the body part of the
attachment is located. The Attachment.raw field contains the entire
attachment, headers and body. The new Attachment.body fields contains a
`StrBuilder` which contains the offset and length of the body part inside
`raw`.
2019-09-26 13:10:06 +03:00
Manos Pitsidianakis
5a53020f3d
Add debug-tracing feature to all crates
The feature needs to be defined in all manifests in order to be enabled
in all crates.
2019-09-23 09:36:46 +03:00
Manos Pitsidianakis
26e4d50b40
Try to save sent messages elsewhere if Sent folder fails
If Sent folder wasn't correctly configured, the sent message would be
lost. With this change it tries these folders in this order:

 1. Sent
 2. Inbox
 3. Any other normal folder

The check is done by looking at the special usage metadata on each
folder. If everything fails, the message is saved in a file in the
tmpfs.
2019-09-23 09:30:23 +03:00
Manos Pitsidianakis
415fb2455b
ui: display status bar messages for 5 seconds 2019-09-22 13:35:50 +03:00
Manos Pitsidianakis
b07db29a19
ui: add timer tick every 300ms
Check for pending events in the main process by receiving a timer event
every 300ms. This way loaded folders or received emails will get
recognized even if the appropriate informing signals got lost.
2019-09-22 11:00:05 +03:00
Manos Pitsidianakis
7fe6532c73
ui: add log on child waiting error 2019-09-20 10:26:08 +03:00
Manos Pitsidianakis
fb7b038ee1
ui: add set_seen shortcut in {Compact,Conversation}
Shortcut sets an entire thread as seen.
2019-09-20 10:26:08 +03:00
Manos Pitsidianakis
fada0ffce1
ui: use ThreadNode instead of Envelope to print entries in
ConversationsListing
2019-09-20 09:17:04 +03:00
Manos Pitsidianakis
146acb70dd
ui: check account conf for index style in listing.rs 2019-09-20 09:15:13 +03:00
Manos Pitsidianakis
828718141a
ui: return valid values in ListingTrait::coordinates
By convention the valid values at any time of a cursor_pos in mail
listings is in self.new_cursor_pos, which the listing compares with
self.cursor_pos to detect position changes. Returning
self.cursor_pos values with coordinates() is invalid.
2019-09-20 09:12:53 +03:00
Manos Pitsidianakis
fe28e849b3
ui: send update event on folders even on no notification
Send an update event even if user's configuration has turned off
notification for this special event. This happens if the entire folder
is set to `ignore`, or when a particular thread is snoozed. In every
case we would want the UI to update.
2019-09-20 09:10:33 +03:00
Manos Pitsidianakis
79212621af
Bump version to 0.3.0 2019-09-16 16:44:04 +03:00
Manos Pitsidianakis
8795c2da4f
ui: small configuration fixes
- unused options were removed,
- renamed `index` conf option to `index_style`
2019-09-16 16:41:22 +03:00
Manos Pitsidianakis
86f21fbe52
ui: xbiff(1) support 2019-09-15 23:38:32 +03:00
Manos Pitsidianakis
bd8424c1f8
ui: add notification play_sound, sound_file conf settings 2019-09-15 23:38:32 +03:00
Manos Pitsidianakis
c695d7a8e2
ui: add Notification kinds 2019-09-15 23:38:32 +03:00
Manos Pitsidianakis
5cf620f43c
ui: add two log entries 2019-09-15 23:38:32 +03:00
Manos Pitsidianakis
ad01101b9b
ui: fix ThreadView drawing artifacts 2019-09-15 23:38:31 +03:00
Manos Pitsidianakis
af38b7e7cb
ui: add envelope views in new tab action 2019-09-15 23:38:31 +03:00
Manos Pitsidianakis
5ddd68ad9f
ui: add statusbar change with tab switch and updates 2019-09-15 23:38:31 +03:00
Manos Pitsidianakis
2eb41f3d3d
ui: dedup history suggestions in command execute bar 2019-09-15 23:38:31 +03:00
Manos Pitsidianakis
3ae2d03663
ui: add triptych thread mailing view
This mail list view shows one entry per thread just like CompactListing,
but the entry is slightly bigger just like in some GUIs, and when the
thread is opened the view becomes 3 columned:

+--+-------+----+
|~~|-------|~~~ |
|~~|-------|~~  |
|  |-------|    |
|  |-------|~~~ |
+--+-------+----+

This is meant to be used with bigger terminal sizes
2019-09-15 23:38:31 +03:00
Manos Pitsidianakis
e3cd2d4c67
ui: save execute cmd history to XDG_DATA_DIR 2019-09-15 13:21:15 +03:00
Manos Pitsidianakis
f61a43108c
ui: show worker and static threads in account tab 2019-09-15 13:21:15 +03:00
Manos Pitsidianakis
f394fde143
add priority and info to jobs and workers
jobs now have a priority given to them, in order to parse some mailboxes
(eg INBOX, Sent) first.

worker threads now can set their names and status
2019-09-15 13:21:14 +03:00
Manos Pitsidianakis
fd38dbed48
override configuration with per-folder configs 2019-09-15 13:21:14 +03:00
Manos Pitsidianakis
81a55abc7c
Update crossbeam to 0.7.2 and remove chan 2019-09-15 13:21:14 +03:00
Manos Pitsidianakis
ecb3fd7f3d
Add dyn keyword to Trait objects
And fix some unused var warnings as well
2019-09-15 13:21:14 +03:00
Manos Pitsidianakis
335a1011de
imap: add watch 2019-09-15 13:21:14 +03:00
Manos Pitsidianakis
c3e3c98fb0
melib: filter subscribed folders in MailBackend::new() 2019-09-15 13:21:14 +03:00