(lines, CursorPosition::None) // FIXME
}
- fn handle_keypress(&mut self, _key: OurKey) -> LogicalAction {
+ fn handle_keypress(&mut self, _key: OurKey, _client: &mut Client) ->
+ LogicalAction
+ {
LogicalAction::Nothing // FIXME
}
}
use itertools::Itertools;
use super::activity_stack::{NonUtilityActivity, UtilityActivity};
+use super::client::Client;
use super::coloured_string::ColouredString;
use super::text::*;
use super::tui::{
(lines, CursorPosition::End)
}
- fn handle_keypress(&mut self, key: OurKey) -> LogicalAction {
+ fn handle_keypress(&mut self, key: OurKey, _client: &mut Client) ->
+ LogicalAction
+ {
match self.actions.get(&key) {
Some(action) => action.clone(),
None => LogicalAction::Nothing,
}
pub trait ActivityState {
- fn draw(&self, w: usize, h: usize) -> (Vec<ColouredString>, CursorPosition);
- fn handle_keypress(&mut self, key: OurKey) -> LogicalAction;
+ fn draw(&self, w: usize, h: usize) ->
+ (Vec<ColouredString>, CursorPosition);
+ fn handle_keypress(&mut self, key: OurKey, client: &mut Client) ->
+ LogicalAction;
}
struct TuiLogicalState {
OurKey::Escape => LogicalAction::Goto(
UtilityActivity::UtilsMenu.into()),
- _ => self.activity_state.handle_keypress(key),
+ _ => self.activity_state.handle_keypress(key, client),
};
match logact {