Rename go_back to hide_reload_menu
This commit is contained in:
parent
4b9e6ff130
commit
9ccaab563a
@ -65,7 +65,7 @@ pub trait IAppInteractInfo {
|
||||
pub trait IAppInteractReload {
|
||||
fn reload_library(&mut self);
|
||||
fn reload_database(&mut self);
|
||||
fn go_back(&mut self);
|
||||
fn hide_reload_menu(&mut self);
|
||||
}
|
||||
|
||||
pub trait IAppInteractError {
|
||||
@ -201,8 +201,7 @@ impl<MH: IMusicHoard> IAppInteractReload for App<MH> {
|
||||
self.refresh(previous, result);
|
||||
}
|
||||
|
||||
// FIXME: Rename to hide_reload_menu
|
||||
fn go_back(&mut self) {
|
||||
fn hide_reload_menu(&mut self) {
|
||||
assert!(self.state.is_reload());
|
||||
self.state = AppState::Browse(());
|
||||
}
|
||||
@ -581,14 +580,14 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reload_go_back() {
|
||||
fn reload_hide_menu() {
|
||||
let mut app = App::new(music_hoard(COLLECTION.to_owned()));
|
||||
assert!(app.state().is_browse());
|
||||
|
||||
app.show_reload_menu();
|
||||
assert!(app.state().is_reload());
|
||||
|
||||
app.go_back();
|
||||
app.hide_reload_menu();
|
||||
assert!(app.state().is_browse());
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ impl<APP: IAppInteract> IEventHandlerPrivate<APP> for EventHandler {
|
||||
KeyCode::Char('l') | KeyCode::Char('L') => app.reload_library(),
|
||||
KeyCode::Char('d') | KeyCode::Char('D') => app.reload_database(),
|
||||
// Return.
|
||||
KeyCode::Char('g') | KeyCode::Char('G') => app.go_back(),
|
||||
KeyCode::Char('g') | KeyCode::Char('G') => app.hide_reload_menu(),
|
||||
// Othey keys.
|
||||
_ => {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user