Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
a38b0ca3dc |
1 changed files with 12 additions and 0 deletions
|
|
@ -39,6 +39,7 @@ enum Message {
|
|||
ChangeQuery(String),
|
||||
|
||||
Copy,
|
||||
Edit,
|
||||
|
||||
FocusNext,
|
||||
FocusPrevious,
|
||||
|
|
@ -65,6 +66,8 @@ struct State {
|
|||
selected_field: db::BasicField,
|
||||
query: String,
|
||||
|
||||
editing_entry: Option<keepass::db::EntryId>,
|
||||
|
||||
status: Cow<'static, str>,
|
||||
error: Cow<'static, str>,
|
||||
}
|
||||
|
|
@ -182,6 +185,13 @@ impl State {
|
|||
}
|
||||
}
|
||||
|
||||
Message::Edit => {
|
||||
self.editing_entry = self
|
||||
.db_view
|
||||
.get(self.selected_entry)
|
||||
.map(|entry| entry.id());
|
||||
}
|
||||
|
||||
Message::FocusNext => return widget::operation::focus_next(),
|
||||
Message::FocusPrevious => return widget::operation::focus_previous(),
|
||||
Message::FocusSearch => return widget::operation::focus("search"),
|
||||
|
|
@ -404,6 +414,8 @@ impl State {
|
|||
|
||||
Key::Character("y" | "c") if db_loaded => Some(Message::Copy),
|
||||
|
||||
Key::Character("e") if db_loaded => Some(Message::Edit),
|
||||
|
||||
Key::Character("q") => Some(Message::Quit),
|
||||
|
||||
// ignore unused keys
|
||||
|
|
|
|||
Loading…
Reference in a new issue