start of help screen
This commit is contained in:
parent
bcc485f2c0
commit
bb6241ac97
4 changed files with 17 additions and 6 deletions
|
@ -15,6 +15,7 @@ impl App {
|
||||||
let mode = self.screen.last_mut().unwrap();
|
let mode = self.screen.last_mut().unwrap();
|
||||||
match mode {
|
match mode {
|
||||||
CurrentScreen::Main
|
CurrentScreen::Main
|
||||||
|
| CurrentScreen::Help
|
||||||
| CurrentScreen::Logging
|
| CurrentScreen::Logging
|
||||||
| CurrentScreen::Receiving
|
| CurrentScreen::Receiving
|
||||||
| CurrentScreen::Sending(SendingScreen::Files(FileMode::Picking))
|
| CurrentScreen::Sending(SendingScreen::Files(FileMode::Picking))
|
||||||
|
@ -24,13 +25,11 @@ impl App {
|
||||||
KeyCode::Char('r') => self.recv(),
|
KeyCode::Char('r') => self.recv(),
|
||||||
KeyCode::Char('l') => self.logs(),
|
KeyCode::Char('l') => self.logs(),
|
||||||
KeyCode::Char('m') => self.main(),
|
KeyCode::Char('m') => self.main(),
|
||||||
|
KeyCode::Char('h') | KeyCode::Char('?') => self.help(),
|
||||||
|
KeyCode::Char('c') => self.service.refresh_peers().await,
|
||||||
KeyCode::Esc => self.pop(),
|
KeyCode::Esc => self.pop(),
|
||||||
_ => match mode {
|
_ => match mode {
|
||||||
CurrentScreen::Main => {
|
CurrentScreen::Main | CurrentScreen::Help => {}
|
||||||
if let KeyCode::Char('d') = code {
|
|
||||||
self.service.refresh_peers().await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CurrentScreen::Logging => match code {
|
CurrentScreen::Logging => match code {
|
||||||
KeyCode::Left => super::change_log_level(-1),
|
KeyCode::Left => super::change_log_level(-1),
|
||||||
KeyCode::Right => super::change_log_level(1),
|
KeyCode::Right => super::change_log_level(1),
|
||||||
|
@ -177,6 +176,14 @@ impl App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn help(&mut self) {
|
||||||
|
let last = self.screen.last();
|
||||||
|
match last {
|
||||||
|
Some(CurrentScreen::Help) => {}
|
||||||
|
_ => self.screen.push(CurrentScreen::Help),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// accept a content receive request
|
// accept a content receive request
|
||||||
fn accept(&mut self) {
|
fn accept(&mut self) {
|
||||||
let Some(idx) = self.receiving_state.selected() else {
|
let Some(idx) = self.receiving_state.selected() else {
|
||||||
|
|
|
@ -68,6 +68,7 @@ pub enum CurrentScreen {
|
||||||
Receiving,
|
Receiving,
|
||||||
Stopping,
|
Stopping,
|
||||||
Logging,
|
Logging,
|
||||||
|
Help,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
|
|
|
@ -156,6 +156,9 @@ impl Widget for &mut App {
|
||||||
buf,
|
buf,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
CurrentScreen::Help => {
|
||||||
|
// TODO: display help
|
||||||
|
}
|
||||||
CurrentScreen::Logging | CurrentScreen::Stopping => {
|
CurrentScreen::Logging | CurrentScreen::Stopping => {
|
||||||
outer_frame(¤t_screen, &LOGGING_MENU, area, buf);
|
outer_frame(¤t_screen, &LOGGING_MENU, area, buf);
|
||||||
logger(area.inner(subscreen_margin), buf);
|
logger(area.inner(subscreen_margin), buf);
|
||||||
|
|
|
@ -115,7 +115,7 @@ impl JocalService {
|
||||||
let (tx, rx) = mpsc::unbounded_channel();
|
let (tx, rx) = mpsc::unbounded_channel();
|
||||||
let socket = UdpSocket::bind(LISTENING_SOCKET_ADDR).await?;
|
let socket = UdpSocket::bind(LISTENING_SOCKET_ADDR).await?;
|
||||||
socket.set_multicast_loop_v4(false)?;
|
socket.set_multicast_loop_v4(false)?;
|
||||||
socket.set_multicast_ttl_v4(8)?; // 8 hops out from localnet
|
socket.set_multicast_ttl_v4(1)?; // local subnet only
|
||||||
socket.join_multicast_v4(MULTICAST_IP, Ipv4Addr::from_bits(0))?;
|
socket.join_multicast_v4(MULTICAST_IP, Ipv4Addr::from_bits(0))?;
|
||||||
|
|
||||||
let client = reqwest::ClientBuilder::new()
|
let client = reqwest::ClientBuilder::new()
|
||||||
|
|
Loading…
Reference in a new issue