Commit Graph

144 Commits (alpha-0.5.1)

Author SHA1 Message Date
Manos Pitsidianakis fead7a5da4
meli: add invalid flag combo check 2020-02-09 02:56:39 +02:00
Manos Pitsidianakis 0aa2659072
meli: add cli-docs feature
Optionally build manpages to text with mandoc and print them from the
command line.
2020-02-09 02:26:21 +02:00
Manos Pitsidianakis c22a141b14
ui/themes: expand theme coverage to status panel and contacts 2020-02-09 00:30:50 +02:00
Manos Pitsidianakis 22fb0c0844
ui: handle ViewMailbox in listing.rs
handling viewmailbox inside a listing instead of their parent/manager
component is a leftover from before they even had a parent/manager.
2020-02-08 23:56:08 +02:00
Manos Pitsidianakis 647cb10b33
ui: Use FolderHash instead of usize for folder cursor
Use FolderHash directly as a cursor type for folders within an account
isntead of having a usize (being the order of the folder within the
account) and figuring out the folder_hash everytime it's needed.

Add OfflineListing for offline accounts and AccountStatusChange event.
2020-02-08 23:56:08 +02:00
Manos Pitsidianakis 42747ef590
ui/themes: make theme_default the default for other keys 2020-02-08 23:56:08 +02:00
Manos Pitsidianakis eef007600b
ui: improve theming coverage 2020-02-08 23:56:08 +02:00
Manos Pitsidianakis 9b7875c023
ui: change Component::get_status return type
There was no reason to return Option<String>, just return String::new()
instead of Option::None
2020-02-08 23:56:08 +02:00
Manos Pitsidianakis cadb1e1613
ui/conf: expand include() paths in config
Expand variables and `~` in included paths in user configuration.
2020-02-08 23:56:08 +02:00
Manos Pitsidianakis 0b4109dfdb
ui: fix wrong subscription status in folders
Subscription status was checked/modified in various places, whereas now
the universal truth is the `BackendFolder::is_subscribed()` method set
by the backend when a folder is created. The `Account` struct passes a
closure to the backend constructor that determines whether the folder is subscribed or not according to the user configuration.

- If subscribed_folders field is empty, then all folders are subscribed.
- OR check explicit folder configuration
- OR check if folder path matches to a glob in subscribed_folders.
2020-02-08 23:56:08 +02:00
Manos Pitsidianakis 50bfed7247
ui: fix subtraction overflow 2020-02-08 23:55:47 +02:00
Manos Pitsidianakis eb501b6d50
ui: add ThemeAttribute argument to clear_area()
clear_area() sets the cleared cell attributes according to the new
argument.
2020-02-08 23:54:15 +02:00
Manos Pitsidianakis 3bca6d1d9c
ui: add floating notifications within terminal
`DisplayMessage` messages are for user input responses (eg errors for
user actions). They now appear as floating boxes in the bottom right
corner of the UI and can be browsed with Alt('<') and Alt('>')
2020-02-08 23:54:15 +02:00
Manos Pitsidianakis 4a4c8e265a
ui: add overlay grid
Add second layer grid for overlays (messages, notifications)
2020-02-08 23:54:15 +02:00
Manos Pitsidianakis 333db9ed37
ui: remove notifications from StatusBar
It's bad UX, they aren't very visible.
2020-02-08 23:54:15 +02:00
Manos Pitsidianakis d6e3c51b07
ui: move box drawing to src/terminal
No logical reason for it not to be in the terminal module anymore (the
set_and_join* functions predate the terminal module which is why they
weren't there to begin with).
2020-02-08 23:54:15 +02:00
Manos Pitsidianakis f131e01bfc
Fix drawing getting stuck in empty terminal
Fix drawing getting stuck in loops when terminal is too small by
checking for it.
2020-02-08 23:54:15 +02:00
Manos Pitsidianakis 4301fa3b04
ui: Change ascii branch drawings in attachment tree 2020-02-08 23:54:15 +02:00
Manos Pitsidianakis af38b1306a
ui: use quoted_argument parser in Ex command arguments 2020-02-08 23:54:15 +02:00
Manos Pitsidianakis 144eb62b76
ui: force refresh_mailbox etc on Mailbox{Delete,Create} 2020-02-08 23:54:15 +02:00
Manos Pitsidianakis f5e694cf5a
Make small cosmetic fixes 2020-02-08 23:54:15 +02:00
Manos Pitsidianakis f208948651
melib: add mailbox delete/create to IMAP 2020-02-08 23:54:14 +02:00
Manos Pitsidianakis d6f04c9ed3
Fix IntoIterator warning 2020-02-05 03:41:28 +02:00
Manos Pitsidianakis 05b91f1c02
Remove text_processing
Unwrap text_processing into melib

In preparation for uploading meli as a separate crate on crates.io.
2020-02-04 17:29:55 +02:00
Manos Pitsidianakis 8b6ea8de9a
Remove ui crate
Merge ui crate with root crate.

In preparation for uploading `meli` as a separate crate on crates.io.

Workspace crates will need to be published as well and having a separate
`ui` crate and binary perhaps doesn't make sense anymore.
2020-02-04 17:29:55 +02:00
Manos Pitsidianakis 6fcc792b83
Remove src/python
In preparation for publishing meli as a separate crate on crates.io.

src/python was never used for anything, so remove it.
2020-02-04 17:29:50 +02:00
Manos Pitsidianakis dbc0fd81af
Rename config file to config.toml 2020-01-28 18:41:50 +02:00
Manos Pitsidianakis b823969ae2
small fixes
- Don't debug print Timer events in src/bin.rs event loop; they're too
frequent and pollute the logs
- chain set_{fg,bg,..} method calls for &mut Cell
- remove unneeded u8 to u8 cast
2020-01-27 17:15:29 +02:00
Manos Pitsidianakis 8ec82b836a
Add 2 theme-related cli flags 2020-01-24 16:15:31 +02:00
Manos Pitsidianakis f58ed387dd
ui: add ratelimiting in UI notifications and drawing 2020-01-20 16:03:06 +02:00
Manos Pitsidianakis 5e912db461
Send timer ID as si_value to SIGALRM handler
Associate each alarm signal with the timer of its origin.
2020-01-20 15:58:59 +02:00
Manos Pitsidianakis a365a846b8
Replace StackVec with smallvec::SmallVec
SmallVec has a less buggy and better implementation.
2020-01-20 15:58:59 +02:00
Manos Pitsidianakis beeea9a0c1
ui: implement PosixTimer
Add interface for posix timers timer_create(2) time(7)
2020-01-02 00:11:13 +02:00
Manos Pitsidianakis 17a0f31b3e
ui/accounts: split StartupCheck event semantics
UIEvent::StartupCheck was meant to notify the UI that a folder had made
progress and polling its async worker would return a
Result<Vec<Envelope>>. However the StartupCheck was received by
MailListing components which called account.status() which did the
polling. That means that if the polling got back results, the listing
would have to call account.status() again to show them. This is a
problem in configurations with only one account because there aren't any
other sources of event to force the listing to recheck account.status()

A new event UIEvent::WorkerProgress will do the job of notifying an
Account to poll its workers and the account will send a startupcheck if
it has made progress. That way the refresh progress is as follows:

Worker thread sends WorkerProgress event -> State calls appropriate
account's account.status() method -> account polls workers, and if there
are new results send StartupCheck events -> State passes StartupCheck
events to components -> Listings update themselves when they receive the
event
2019-12-14 19:56:43 +02:00
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
2019-12-12 01:04:33 +02:00
Manos Pitsidianakis ef26b03bb6
Add some documentation 2019-12-01 17:13:36 +02:00
Manos Pitsidianakis af365fa8d4
Set 600 perm mode to all created files
When creating a data file, set permissions to read/write for the user.
2019-11-24 17:00:55 +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 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.
2019-11-22 18:43:24 +02:00
Manos Pitsidianakis 0cea6368d9
ui/embed: fix scrolling area issues 2019-11-19 20:39:43 +02:00
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.
2019-11-16 00:33:22 +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 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 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 ee9ffffa12
bin: C-L issues manual redraw 2019-10-03 19:11:28 +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 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 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 81a55abc7c
Update crossbeam to 0.7.2 and remove chan 2019-09-15 13:21:14 +03:00