Commit Graph

113 Commits (c6f1fa9be03616a66d3fadc1fdd439125c0b4702)

Author SHA1 Message Date
Manos Pitsidianakis c6f1fa9be0
ui: Add TagAction
Add/Remove
2019-12-07 17:31:49 +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 3ae43817a1
ui: user-configured colors for tags in mail listings 2019-12-01 12:10:31 +02:00
Manos Pitsidianakis bca33370cc
Add tag settings in UI config module 2019-12-01 12:09:35 +02:00
Manos Pitsidianakis 19a268b8a7
ui: add tags in compact, conversations 2019-11-30 21:55:40 +02:00
Manos Pitsidianakis d31c629ac4
ui: add tags in plain listing 2019-11-30 17:44:54 +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 f1588f6002
ui: shortcuts refactoring 2019-11-18 22:20:18 +02:00
Manos Pitsidianakis 8798d84e43
ui: update cached rows on row update in CompactListing 2019-11-18 20:55:52 +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 f8a1a6caa5
melib: replace find_thread_group with find_root_hash
thread_group property of ThreadNode doesn't yet reflect the actual root
ThreadNode (the root of the thread, that is). So find the root manually
instead.
2019-11-17 12:05:52 +02:00
Manos Pitsidianakis bd4cf860fa
ui: persist row highlighting in CompactListing 2019-11-16 14:00:00 +02:00
Manos Pitsidianakis 0d03116e8a
ui: correct row highlighting in CompactListing 2019-11-16 13:41:33 +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 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 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 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 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 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 2b5472adc3
Add set_seen shortcut in CompactListing 2019-09-29 01:55:39 +03:00
Manos Pitsidianakis 31543bf2f9
ui: update CompactListing based on ConversationsListing 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 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 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 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 3f7d962abd
melib: remove ThreadTree, use ThreadNodes for root_set
Remove ThreadTree index in Threads {} struct. Keep a Vec<ThreadHash> for
root_set state of mailbox instead of rebuilding ThreadTrees every
time.
2019-09-08 11:49:23 +03:00
Manos Pitsidianakis b39b285711
ui: fix flag colors in re-highlight in CompactListing 2019-08-18 15:47:10 +03:00
Manos Pitsidianakis 1845b046fa
ui: add attribute support
bold/italic etc
2019-08-18 15:47:09 +03:00
Manos Pitsidianakis 84950ad740
ui, CompactListing: Don't accept listing actions if unfocused 2019-08-04 00:28:20 +03:00
Manos Pitsidianakis 714f8255fc
ui: fix pageup/dn behaviour 2019-08-02 01:00:54 +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 6e63e8a6f6
ui: rename read/unread uses to seen/unseen 2019-07-18 20:23:02 +03:00
Manos Pitsidianakis a62f1d6c01
add read-only option in accounts 2019-07-18 20:16:51 +03:00
Manos Pitsidianakis 46a0574713
ui: permanently mark selected rows in self.data_columns
`self.draw_list` detects `bg_color` by checking the first cell of the first column, so set it to make it permanent
2019-07-11 12:29:17 +03:00
Manos Pitsidianakis 74be47ec5a
ui: fix some lints 2019-07-06 12:47:27 +03:00
Manos Pitsidianakis a655a85b5f
ui: fix replies not being synced and inserted properly on RefreshEvents 2019-07-06 12:46:45 +03:00
Manos Pitsidianakis b5ba9c3a8c
ui: force redraw CompactListing after EnvelopeRename event 2019-07-06 00:19:37 +03:00
Manos Pitsidianakis f4f3b87f84
ui: add selections to CompactListing
Select multiple entries by pressing 'v'. Set read/unread and delete
actions are then performed on the selected entries.
2019-06-25 10:37:18 +03:00
Manos Pitsidianakis 8c97336307
ui: add set as read/unread, delete actions
Implemented only in compact listing for now.
2019-06-23 11:42:48 +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 24831b3c13
Fix warnings, lints, and 2018 errors 2019-06-18 21:14:14 +03:00