Rename go_back to hide_reload_menu
All checks were successful
Cargo CI / Build and Test (pull_request) Successful in 1m3s
Cargo CI / Lint (pull_request) Successful in 42s

This commit is contained in:
Wojciech Kozlowski 2024-02-01 23:11:27 +01:00
parent 4b9e6ff130
commit 9ccaab563a
2 changed files with 5 additions and 6 deletions

View File

@ -65,7 +65,7 @@ pub trait IAppInteractInfo {
pub trait IAppInteractReload { pub trait IAppInteractReload {
fn reload_library(&mut self); fn reload_library(&mut self);
fn reload_database(&mut self); fn reload_database(&mut self);
fn go_back(&mut self); fn hide_reload_menu(&mut self);
} }
pub trait IAppInteractError { pub trait IAppInteractError {
@ -201,8 +201,7 @@ impl<MH: IMusicHoard> IAppInteractReload for App<MH> {
self.refresh(previous, result); self.refresh(previous, result);
} }
// FIXME: Rename to hide_reload_menu fn hide_reload_menu(&mut self) {
fn go_back(&mut self) {
assert!(self.state.is_reload()); assert!(self.state.is_reload());
self.state = AppState::Browse(()); self.state = AppState::Browse(());
} }
@ -581,14 +580,14 @@ mod tests {
} }
#[test] #[test]
fn reload_go_back() { fn reload_hide_menu() {
let mut app = App::new(music_hoard(COLLECTION.to_owned())); let mut app = App::new(music_hoard(COLLECTION.to_owned()));
assert!(app.state().is_browse()); assert!(app.state().is_browse());
app.show_reload_menu(); app.show_reload_menu();
assert!(app.state().is_reload()); assert!(app.state().is_reload());
app.go_back(); app.hide_reload_menu();
assert!(app.state().is_browse()); assert!(app.state().is_browse());
} }

View File

@ -109,7 +109,7 @@ impl<APP: IAppInteract> IEventHandlerPrivate<APP> for EventHandler {
KeyCode::Char('l') | KeyCode::Char('L') => app.reload_library(), KeyCode::Char('l') | KeyCode::Char('L') => app.reload_library(),
KeyCode::Char('d') | KeyCode::Char('D') => app.reload_database(), KeyCode::Char('d') | KeyCode::Char('D') => app.reload_database(),
// Return. // Return.
KeyCode::Char('g') | KeyCode::Char('G') => app.go_back(), KeyCode::Char('g') | KeyCode::Char('G') => app.hide_reload_menu(),
// Othey keys. // Othey keys.
_ => {} _ => {}
} }