mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
remove PhrasesControl trait
This commit is contained in:
parent
d1fdc7f8b6
commit
4fdc3911e4
10 changed files with 64 additions and 68 deletions
|
|
@ -11,8 +11,8 @@ pub enum FileBrowserCommand {
|
|||
Filter(String),
|
||||
}
|
||||
|
||||
impl<T: PhrasesControl> Command<T> for FileBrowserCommand {
|
||||
fn execute (self, state: &mut T) -> Perhaps<Self> {
|
||||
impl Command<PhraseListModel> for FileBrowserCommand {
|
||||
fn execute (self, state: &mut PhraseListModel) -> Perhaps<Self> {
|
||||
use FileBrowserCommand::*;
|
||||
use PhrasesMode::{Import, Export};
|
||||
let mode = state.phrases_mode_mut();
|
||||
|
|
@ -58,8 +58,8 @@ impl<T: PhrasesControl> Command<T> for FileBrowserCommand {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: PhrasesControl> InputToCommand<Tui, T> for FileBrowserCommand {
|
||||
fn input_to_command (state: &T, from: &TuiInput) -> Option<Self> {
|
||||
impl InputToCommand<Tui, PhraseListModel> for FileBrowserCommand {
|
||||
fn input_to_command (state: &PhraseListModel, from: &TuiInput) -> Option<Self> {
|
||||
use KeyCode::{Up, Down, Right, Left, Enter, Esc, Char, Backspace};
|
||||
use FileBrowserCommand::*;
|
||||
if let Some(PhrasesMode::Import(index, browser)) = state.phrases_mode() {
|
||||
|
|
@ -96,8 +96,8 @@ impl<T: PhrasesControl> InputToCommand<Tui, T> for FileBrowserCommand {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: PhrasesControl> InputToCommand<Tui, T> for PhraseLengthCommand {
|
||||
fn input_to_command (state: &T, from: &TuiInput) -> Option<Self> {
|
||||
impl InputToCommand<Tui, PhraseListModel> for PhraseLengthCommand {
|
||||
fn input_to_command (state: &PhraseListModel, from: &TuiInput) -> Option<Self> {
|
||||
use KeyCode::{Up, Down, Right, Left, Enter, Esc};
|
||||
if let Some(PhrasesMode::Length(_, length, _)) = state.phrases_mode() {
|
||||
Some(match from.event() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue