Commit Graph

120 Commits (8b6ea8de9a89b3ad42276eb7835992f7b875128b)

Author SHA1 Message Date
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
Matthias Beyer 6e716946b7
Reformat to be a proper rust comment
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-02 01:00:53 +03:00
Manos Pitsidianakis 2a1bf37e69
Add --version command line flag 2019-08-02 01:00:53 +03:00
Manos Pitsidianakis df5559023d
add --help, --config, --create-config arguments 2019-07-29 20:22:34 +03:00
Manos Pitsidianakis 93f3d6e230
remove std::dbg uses 2019-07-09 13:05:11 +03:00
Manos Pitsidianakis fb406667ab
add debug! macro to replace eprintlns 2019-06-10 19:40:46 +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 1c7aa0ec9c
update to 2018 edition 2019-06-10 19:40:42 +03:00
Manos Pitsidianakis 551db51b00
ui: avoid full renders when worker threads return StartupChecks
Now listings only re-render when their folder gets a StartupCheck event,
account menu always re-renders to update new mail counts

closes #76
2019-06-10 19:40:41 +03:00
Manos Pitsidianakis 1867bb6aa3
ui: hide divider column in VSplit if !self.show_divider 2019-06-10 19:40:41 +03:00
Manos Pitsidianakis a2e81ed354
ui: enter EX mode with space 2019-06-10 19:40:40 +03:00
Manos Pitsidianakis bf038428c2
Run rustfmt 2019-06-10 19:40:39 +03:00
Manos Pitsidianakis 1bb1cf7aac
add notification filter
concerns #64
2019-06-10 19:40:38 +03:00
Manos Pitsidianakis 4ee5447cf9
Add FormWidget/ButtonWidget and use them in Contacts 2019-06-10 19:40:37 +03:00
Manos Pitsidianakis 62168e9183
Add contact view page, edit headers in compose, index style in conf 2019-06-10 19:40:37 +03:00
Manos Pitsidianakis 92bb3bf8d3
ui: add contacts and account panel 2019-06-10 19:40:36 +03:00
Manos Pitsidianakis 5a28320004
WIP 2019-06-10 19:40:36 +03:00
Manos Pitsidianakis fae1cdd33e
melib: Re-implement JWZ threading algorithm 2019-06-10 19:40:34 +03:00
Manos Pitsidianakis 4f715af248
melib: cache threads
closes #28
2019-06-10 19:40:33 +03:00
Manos Pitsidianakis bcef22b3f3
ui: add Listing component with 3 modes: compact plain and threaded 2019-06-10 19:40:33 +03:00
Manos Pitsidianakis 3e9d137310
melib: rework mail events
closes #39
2019-06-10 19:40:33 +03:00
Manos Pitsidianakis 8d3a2d8236
ui: refactor compose actions 2019-06-10 19:40:32 +03:00