Commit Graph

73 Commits (c6f1fa9be03616a66d3fadc1fdd439125c0b4702)

Author SHA1 Message Date
Manos Pitsidianakis c6f1fa9be0
ui: Add TagAction
Add/Remove
2019-12-07 17:31:49 +02:00
Manos Pitsidianakis e5da10093d
ui/listing: use MailListingTrait instead of ListingTrait 2019-12-07 17:17:05 +02:00
Manos Pitsidianakis 8e27b86453
Add MailListingTrait
Inheriting ListingTrait
2019-12-07 17:16:00 +02:00
Manos Pitsidianakis 6cf73b4238
Remove Option<EnvelopeHash> from ListingTrait
It was never used.
2019-12-07 01:38:43 +02:00
Manos Pitsidianakis c04513ac94
ui: add shortcut! macro to compare shortcuts values
This is used in process_event() functions of UI Components. When a key
has been input we have to compare it with the configured shortcuts from
a hashmap.

Add shortcut! macro that checks shortcut hashmaps for the given name and
doesn't panic if it's missing.
2019-11-28 22:16:56 +02:00
Manos Pitsidianakis afff63c781
ui: load vcards to addressbook with vcard_folder account setting 2019-11-27 17:42:11 +02:00
Manos Pitsidianakis 874a252394
ui: add periodic account connectivity check
1. spawn thread to send ThreadPulses to the main event loop that "parks" until unparked from State
2. State unparks thread if there are accounts that are offline
3. thread sends ThreadPulse and parks again
4. State checks accounts again and so on.
2019-11-23 19:34:16 +02:00
Manos Pitsidianakis f1588f6002
ui: shortcuts refactoring 2019-11-18 22:20:18 +02:00
Manos Pitsidianakis 995e70e009
ui: change line_break meaning in write_string_to_grid
Change line_break parameter from bool flag (whether to break in the end
of a line or not) to an Option<usize>, where the value is the x_offset
of the left side of the area. Thus if line_break == Some(_) when a line
ends its value is set as x to continue in the next line properly.
2019-11-18 14:49:50 +02:00
Manos Pitsidianakis 94152f7336
ui: add multiplier shortcuts to cursor movements
Prepend a cursor movement (Up/Down/PageUp/PageDown) with a multiplier
(e.g 23+Down, that is '2' then '3' then 'Down') to increase the
movement's length.
2019-11-12 22:14:44 +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 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 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 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 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 146acb70dd
ui: check account conf for index style in listing.rs 2019-09-20 09:15:13 +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 5ddd68ad9f
ui: add statusbar change with tab switch and updates 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 fd38dbed48
override configuration with per-folder configs 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
Manos Pitsidianakis 734bc109b0
ui: refactor menu 2019-08-18 15:47:10 +03:00
Matthias Beyer 02bfda5eed
Prefix unused variables with underscore
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-02 01:00:53 +03:00
Manos Pitsidianakis 8a0e702127
melib,ui: add MailboxEntry enum
Use an enum to describe a mailbox's state in ui::conf::Account instead
of Result.
2019-07-28 20:15:41 +03:00
Manos Pitsidianakis e0e520b2c4
ui: add filter method in ListingTrait
Implemented in CompactListing only for now. Filter results are stored in
the filter* fields of the struct.
2019-06-22 16:13:40 +03:00
Manos Pitsidianakis bb292486f4
ui: expand Listing trait with draw_list and highlight_line
In the course of making the Listing trait a generic way for any kind of
listing (eg. NNTP, RSS, et all)
2019-06-21 12:02:11 +03:00
Manos Pitsidianakis 06862c1484
ui: prevent some unnecessary redraws 2019-06-19 19:39:23 +03:00
Manos Pitsidianakis 9026fb866e
ui: Add ability to call mailing list actions from Envelope view 2019-06-18 22:16:32 +03:00
Manos Pitsidianakis 24831b3c13
Fix warnings, lints, and 2018 errors 2019-06-18 21:14:14 +03:00
Manos Pitsidianakis 42654410e3
ui: move Collection to Account
Each account had one mailbox per folder, which had one associated
collection. Now each Account has one Collection for all folders and each
Mailbox object holds only the hashes of each message.

Collection also gets Threads for each folder in order to mix messages
(ie from/to Sent folder).

Insert Sent emails in chronological order

if inserted unsorted, mails a, b with a happened-before b, might never
  get added.

Fix multiple insertions in ThreadTree upon insert_reply

insert_reply was creating multiple copies in threading
2019-06-10 19:40:50 +03:00
Manos Pitsidianakis 4582bcd5ae
fix warnings and lints 2019-06-10 19:40:49 +03:00
Manos Pitsidianakis 2dec7fa6b6
ui: set plain/threaded/compact keeps mailbox position
closes #109
2019-06-10 19:40:48 +03:00
Manos Pitsidianakis bf35894a18
ui: distinct shortcut maps with description
put shortcuts in different maps according to their source component
instead of bagging them all in the same one, and then print each
shortcut section on its own in the shortcut window
2019-06-10 19:40:48 +03:00
Manos Pitsidianakis 5a564dee63
melib: print folder tree in Listing menu properly
Depths weren't calculated correctly, and index (eg 0 Inbox) wasn't
colored correctly if the folder's name started with a number (eg 11 2019)
2019-06-10 19:40:48 +03:00
Manos Pitsidianakis c26dd0685b
ui: print menu entries in order
FolderNode is a tree structure to represent the sorted or user defined
order inside the Account type
2019-06-10 19:40:47 +03:00
Manos Pitsidianakis aade41401e
ui: add column sep between menu and listing 2019-06-10 19:40:47 +03:00
Manos Pitsidianakis fb406667ab
add debug! macro to replace eprintlns 2019-06-10 19:40:46 +03:00
Manos Pitsidianakis 03b9641bc6
ui: fix acc navigation shortcuts direction 2019-06-10 19:40:46 +03:00
Manos Pitsidianakis 4ae8cbadbf
ui: reassign listing shortcuts
after `312011c ui: move account menu functions to Listing`, shortcuts like prev_folder etc should be generic over all listing types.
2019-06-10 19:40:45 +03:00
Manos Pitsidianakis 69031e66f9
ui: move account menu functions to Listing
AccountMenu was completely semantically attached to Listing, so there's
no reason for them to be separate and communicating via events.
2019-06-10 19:40:45 +03:00
Manos Pitsidianakis 9bc76e3bcb
ui: unwrap UIEventType 2019-06-10 19:40:44 +03:00
Manos Pitsidianakis 106744c7ca
ui: remove Entity 2019-06-10 19:40:44 +03:00
Manos Pitsidianakis ee4462881e
run cargo fmt 2019-06-10 19:40:42 +03:00
Manos Pitsidianakis c91f0d73a5
ui: add ListingTrait to get/set coordinates 2019-06-10 19:40:42 +03:00
Manos Pitsidianakis bf038428c2
Run rustfmt 2019-06-10 19:40:39 +03:00
Manos Pitsidianakis b437e55b67
use shortcuts from config or default
closes #63
2019-06-10 19:40:39 +03:00
Manos Pitsidianakis d285913974
Add shortcut panel
Concerns #63
2019-06-10 19:40:38 +03:00
Manos Pitsidianakis e285d1006b
Open Contacts list from accounts tab 2019-06-10 19:40:38 +03:00