mirror of https://git.meli.delivery/meli/meli
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
952 B
Rust
40 lines
952 B
Rust
extern crate ncurses;
|
|
extern crate maildir;
|
|
extern crate mailparse;
|
|
|
|
mod ui;
|
|
|
|
use ui::index::*;
|
|
|
|
fn main() {
|
|
let locale_conf = ncurses::LcCategory::all;
|
|
ncurses::setlocale(locale_conf, "en_US.UTF-8");
|
|
ui::initialize();
|
|
let mailbox = Mailbox::new("PATH");
|
|
let mut index = Index::new(mailbox);
|
|
ncurses::refresh();
|
|
|
|
index.draw();
|
|
|
|
let mut ch;
|
|
loop {
|
|
ch = ncurses::get_wch();
|
|
match ch {
|
|
Some(ncurses::WchResult::KeyCode(k @ ncurses::KEY_UP)) |
|
|
Some(ncurses::WchResult::KeyCode(k @ ncurses::KEY_DOWN)) => {
|
|
index.scroll(k);
|
|
continue;
|
|
}
|
|
Some(ncurses::WchResult::Char(10)) => {
|
|
index.show_pager();
|
|
index.draw();
|
|
continue;
|
|
}
|
|
Some(ncurses::WchResult::KeyCode(ncurses::KEY_F1)) => {
|
|
break;
|
|
}
|
|
_ => {}
|
|
}
|
|
}
|
|
}
|