Commit Graph

594 Commits (5230ce2d033a61750702488722252cd76cef5295)

Author SHA1 Message Date
Manos Pitsidianakis 18a8d22b85
ui/shortcuts: Replace arrow key use with configurable shortcuts 5 years ago
Manos Pitsidianakis aa9a6a3128
melib: add SpecialUseMailbox::detect_usage method 5 years ago
Manos Pitsidianakis d69be5bb0b
ui/accounts: don't panic if Backend::folders is_err 5 years ago
Manos Pitsidianakis 328b17a995
ui/CompactListing: use Segment Trees to calculate max page column width
Given a range of entries that occupy a page (eg [0, 50] for a page of 50
rows high) get the max entry width for this column by using maximum
range queries with segment trees.
5 years ago
Manos Pitsidianakis 7432be5aaa
ui/listings: truncate subject at 150 grapheme width
Large subjects would cause large CellBuffer allocations.
5 years ago
Manos Pitsidianakis b401b64f35
ui/CellBuffer: change row_iter() bounds to Range
Writing a range x..y is more ergonomic than (x, y+ 1)
5 years ago
Manos Pitsidianakis 59f7f03d64
ui: refactor watch thread spawning procedure
- Remove unnecessary parameters from watch(), reload()
- Add NewThread event that adds new threads in
work_controller.static_threads hashmap
- removed obsolete field State.threads
- silence watch thread error notifications
5 years ago
Manos Pitsidianakis b93154a596
ui/MailListings: fix set_seen action not being processed 5 years ago
Manos Pitsidianakis f05a4205f7
melib/ui: small fixes
- melib/imap: accept quoted strings with escaped quotes in
protocol_parser
- ui/accounts: return unavailabity correctly if folder's worker slot is
empty instead of judging only by its vacancy
- ui/MailView: set view as not dirty if envelope loading from backend
fails so that it stops requesting it in every subsequent redraw
5 years ago
Manos Pitsidianakis 6f76cd9acc
melib: add special_usage() method to BackendFolder
Eventually after loading potential usage values from configuration,
backends will be able to change the usage values themselves. IMAP and
JMAP have the ability to set Mailbox roles (IMAP needs LIST-SPECIAL
extension
5 years ago
Manos Pitsidianakis ad7c91bc29
ui/sqlite3: warn user if db hasn't been initialised 5 years ago
Manos Pitsidianakis 40e928dad3
Push version to 0.4.1 5 years ago
Manos Pitsidianakis 0eaf17871a
melib: add set_tags command in BackendOp 5 years ago
Manos Pitsidianakis f632bc4c08
ui: update rows on TagAdd/TagRemove
Except for threadlisting
5 years ago
Manos Pitsidianakis c6f1fa9be0
ui: Add TagAction
Add/Remove
5 years ago
Manos Pitsidianakis fdb42cfc0c
ui/status: show tag and search backend info
Show tag and search backend info for each account.
5 years ago
Manos Pitsidianakis b858fcb0ab
ui/conf: change field order
Change field order because FolderConf has an extra_settings sinkhole
field for serde, which catches any setting that could go to the other
field.
5 years ago
Manos Pitsidianakis e5da10093d
ui/listing: use MailListingTrait instead of ListingTrait 5 years ago
Manos Pitsidianakis 8e27b86453
Add MailListingTrait
Inheriting ListingTrait
5 years ago
Manos Pitsidianakis 6cf73b4238
Remove Option<EnvelopeHash> from ListingTrait
It was never used.
5 years ago
Manos Pitsidianakis 46a807eee1
melib: remove control characters from subject 5 years ago
Manos Pitsidianakis d376f83f48
ui/conversations: fix padding left unpainted 5 years ago
Manos Pitsidianakis d048d8566d
ui: add format=flowed if text/plain att is the only one 5 years ago
Manos Pitsidianakis c431fb6dff
ui: use BoundsIterator in clear_area 5 years ago
Manos Pitsidianakis 3a3b815b3a
ui/accounts: add save_special method for mail
Add save_special method in Accounts. save_special() saves mail to the
first folder_type (eg Draft, Sent, Inbox) folder it finds or to any
other as fall over.
5 years ago
Manos Pitsidianakis ef26b03bb6
Add some documentation 5 years ago
Manos Pitsidianakis 16ccff0f44
ui: add RowIterator and BoundsIterator for CellBuffer
Use `RowIterator` to iterate the cells of a row without the need to do
any bounds checking; the iterator will simply return `None` when it
reaches the end of the row.  `RowIterator` can be created via the
`CellBuffer::row_iter` method and can be returned by `BoundsIterator`
which iterates each row.
5 years ago
Manos Pitsidianakis 3ae43817a1
ui: user-configured colors for tags in mail listings 5 years ago
Manos Pitsidianakis bca33370cc
Add tag settings in UI config module 5 years ago
Manos Pitsidianakis 19a268b8a7
ui: add tags in compact, conversations 5 years ago
Manos Pitsidianakis d31c629ac4
ui: add tags in plain listing 5 years ago
Manos Pitsidianakis 6d380cefd1
ui: add keep_{f,b}g flags in Cell
It might be necessary to know if a cell has to keep its colours while
the character content doesn't change. For example the tags in a mail
listing can have colour backgrounds that should be immutable if the user
highlights each entry.

The flags should be reset every time the cell itself is reset.
5 years ago
Manos Pitsidianakis b54bd6de84
ui: pass search to libnotmuch for notmuch accounts 5 years ago
Manos Pitsidianakis 49dccb94a5
bin: add notmuch feature
Add notmuch feature that includes melib/notmuch_backend and a new
feature for the ui crate. We need the latter in order to know from
within ui if we have been linked with libnotmuch
5 years ago
Manos Pitsidianakis 0b845a0d16
Small fixes
- Update documentation on include config syntax
- Accept relative paths in include config syntax
- Fix one line clearing that shouldn't be redrawn in html view
- Fix shortcuts not being honored in Composer
5 years ago
Manos Pitsidianakis d4f20b0c0d
Fix Raw envelope view starting one line line earlier 5 years ago
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.
5 years ago
Manos Pitsidianakis 4048eab424
ui/conf: Add include file feature
Use

  #include "path/to/file"

In configuration file to include other files.
5 years ago
Manos Pitsidianakis 8a17eee769
ui/compose: don't save sent mail with Draft flag 5 years ago
Manos Pitsidianakis ba52c59859
bin: add backend specific validation functions for --test-config flag 5 years ago
Manos Pitsidianakis 81b7195080
ui: add Ctrl-* Alt-* and F1..F12 parsers and tests 5 years ago
Manos Pitsidianakis 2199726b2c
Retidy shortcuts 5 years ago
Manos Pitsidianakis afff63c781
ui: load vcards to addressbook with vcard_folder account setting 5 years ago
Manos Pitsidianakis 9a516e0663
ui/text_editing: add Ctrl-{f,b,u} readline shortcuts 5 years ago
Manos Pitsidianakis 1df7a35f0f
ui: CellBuffer cleanups
- Remove unused Traits etc
- Make scrolling a method
5 years ago
Manos Pitsidianakis e5f5febd6b
Log notification script failures 5 years ago
Manos Pitsidianakis db197aaffe
ui/MailView: implement headers_sticky option
Kind of hacky, I don't like the way it is done but I'm willing to
compromise.
5 years ago
Manos Pitsidianakis af365fa8d4
Set 600 perm mode to all created files
When creating a data file, set permissions to read/write for the user.
5 years ago
Manos Pitsidianakis 3e33335914
ui/MailView: unwrap Pager out of option
There's no need anymore for pager to be inside an Option.
5 years ago
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.
5 years ago
Manos Pitsidianakis 12e4258ae4
conf: add * glob expansion to subscribed_folders field
You can now do:
 subscribed_folders = [ "*", ]
5 years ago
Manos Pitsidianakis b327bee3e4
text_processing: add GlobMatch trait
Move GlobMatch trait from ui::mailcap to text_processing in order to use
it for glob matching folder paths in subscribed_folders field of
account configuration. See next commit.
5 years ago
Manos Pitsidianakis eecec551c1
Display watch thread errors to user
Show a proper notification with the error message to the user instead of
just logging it on debug-tracing.
5 years ago
Manos Pitsidianakis b8e4a35963
melib/imap: add default capabilities to SUPPORTED_CAPABILITIES 5 years ago
Manos Pitsidianakis 41a678c6ef
melib: make MailBackend::folders return Result
Change folders() signature:
-    fn folders(&self) -> FnvHashMap<FolderHash, Folder>;
+    fn folders(&self) -> Result<FnvHashMap<FolderHash, Folder>>;

Imap may not be online, therefore we need the ability to return an
error.
5 years ago
Manos Pitsidianakis 3d3ead02e9
bin: add --test-config flag
meli --test-config PATH tests a configuration file for syntax issues or missing options.

Caveat: right now undefined options/values do not return an error.
Backend specific options are also not validated.
5 years ago
Manos Pitsidianakis 1063bb73b5
shortcuts tidiness
- Unflatten shortcuts configuration table.
  Shortcuts now have to be defined in levels:
  [shortcuts.general]
  ...
  [shortcuts.pager]
  ...

- Add shortcuts for thread view
- Sort alphabetically in help view
5 years ago
Manos Pitsidianakis 678889d706
ui/threadview: add show_thread shortcut
Press 't' by default to toggle thread visibility
5 years ago
Manos Pitsidianakis f3c938d8c3
Prevent OOM abort when printing large strings 5 years ago
Manos Pitsidianakis 424b244bb7
fixup some TODO and FIXMEs 5 years ago
Manos Pitsidianakis 501f1a0e1e
pager: add minimum_width and split_lines_reflow
Add options to pager settings
5 years ago
Manos Pitsidianakis 022e1f437d
ui/pager: reflow on resize 5 years ago
Manos Pitsidianakis 3d52b1f1b7
ui: fix bracket mode end code typo
Thanks to Gert Hulselmans for noticing in 35c3017419
5 years ago
Manos Pitsidianakis 62bfe2a91f
ui: embed editor cleanups 5 years ago
Manos Pitsidianakis ce646abc7a
ui: add send confirmation dialog in compose tab
Confirm before sending mail
5 years ago
Manos Pitsidianakis 458f8da332
ui: fix bounds check in StatusBar 5 years ago
Manos Pitsidianakis 0cea6368d9
ui/embed: fix scrolling area issues 5 years ago
Manos Pitsidianakis f1588f6002
ui: shortcuts refactoring 5 years ago
Manos Pitsidianakis 8798d84e43
ui: update cached rows on row update in CompactListing 5 years ago
Manos Pitsidianakis 51628ac9d2
ui: move list_management mod to melib
list_management module includes some small functions to handle mailing
list metadata (List-* headers)
5 years ago
Manos Pitsidianakis 449a24d075
ui: ListActions changes
- Parse List-Post value like List-Unsubscribe: comma separated angle bracket limited list of <mailto:> or <url> values
- Check if List-Archive value is angle bracket delimited
5 years ago
Manos Pitsidianakis 590619de0e
ui/compose: remove thread view in reply composer
You don't need to have the thread in the composer anymore, since you can
just switch tabs to the actual thread.
5 years ago
Manos Pitsidianakis 31a86533c5
ui/pager: add Left/Right movements
Left/Right movements change the horizontal offset by (page width) / 3.
5 years ago
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.
5 years ago
Manos Pitsidianakis a5e272c36e
Add tests/ dir and a test
Add a test for generating mail with melib's Draft struct.
5 years ago
Manos Pitsidianakis 094ce7ee69
Add format_flowed option for composing e-mail
When format_flowed=true, generated text/plain attachments include the
format=flowed MIME parameter.

format_flowed is set to true by default.
5 years ago
Manos Pitsidianakis 62f3d12253
ui/view: move reply and edit to view.rs
reply and edit actions where only in view/thread.rs, so simple envelope
views had no way to reply. view.rs is used standalone or within
view/thread.rs so it is the appropriate place for the actions.
5 years ago
Manos Pitsidianakis f8a2ce0bed
ui: small bounds checking fix in view.rs 5 years ago
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.
5 years ago
Manos Pitsidianakis 1168804cf8
ui: add reflow property to Pager
For displaying format=flowed formatted text/plain attachments properly.
5 years ago
Manos Pitsidianakis e1dec05881
ui/embed: don't increase cursor with multibyte chars
When waiting for a multibyte unicode codepoint to fill up, don't
increase cursor at all.
5 years ago
Manos Pitsidianakis bd4cf860fa
ui: persist row highlighting in CompactListing 5 years ago
Manos Pitsidianakis f3a3668f3f
ui: correct redrawing when entering Execute command 5 years ago
Manos Pitsidianakis 0d03116e8a
ui: correct row highlighting in CompactListing 5 years ago
Manos Pitsidianakis 321be8555f
Cleanup startup error exit paths
Make startup methods return Results so that the main binary can exit
cleanly instead of using std::process::exit from arbitrary positions,
which exits the process immediately and doesn't run destructors.
5 years ago
Manos Pitsidianakis aeb9d046a2
ui/ThreadListing: fix uninitialized array entry crash
If ThreadListing is uninitialized, self.locations is empty and
coordinates() would panic.
5 years ago
Manos Pitsidianakis 7463248da8
melib: change BackendOp::set_flag() signature 5 years ago
Manos Pitsidianakis ede512200b
conf: move FolderConf to melib
This will be needed to add notmuch-specific configuration settings in
the FolderConf struct in the next commit
5 years ago
Manos Pitsidianakis 56cda63c83
Fix some warnings 5 years ago
Manos Pitsidianakis c2da09de99
ui/sqlite3: insert account if non-existent 5 years ago
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.
5 years ago
Manos Pitsidianakis 134178a74a
ui/sqlite3: add remove/update for RefreshEvent
Remove and/or update envelopes in sqlite3 db when the appropriate events
happen.
5 years ago
Manos Pitsidianakis c6a4fcb959
ui: fix Account watching bug
Account::is_online(&mut self) should be called from ui/src/state.rs
only, since it launches the watcher threads when an account goes from
offline to online. If it's called from elsewhere the watcher threads
might not get launched ever.
5 years ago
Manos Pitsidianakis c9c4e1ea60
ui/sqlite3: add has:attachment query 5 years ago
Manos Pitsidianakis 35e34d1c09
ui: add "is:" alias for "flags:" query 5 years ago
Manos Pitsidianakis 6ce88667c0
ui/sqlite3: add flag query support 5 years ago
Manos Pitsidianakis dce1c39b48
ui: add mailcap support 5 years ago
Manos Pitsidianakis 9cd00cf53a
sqlite3: add accounts and folders table 5 years ago
Manos Pitsidianakis 1d6ef92a4f
ui: make StatusPanel grid growable 5 years ago
Manos Pitsidianakis 776dc107c2
Fix Pager::print_string() with empty string 5 years ago