aboutsummaryrefslogtreecommitdiff
path: root/src/tui/commands.rs
diff options
context:
space:
mode:
authorlukeflo2024-12-23 21:03:48 +0100
committerlukeflo2024-12-23 21:03:48 +0100
commit57126d7f42b871aa1835b056fbe74179c13e53b0 (patch)
treebf81db50446aa7a8e06553f4e8aff97ea0cfb816 /src/tui/commands.rs
parentad5c2cb586616eca99fc1db0efaaa0ff5aa97144 (diff)
parent9a33a794167d60ce35030f007674f6e9424b1ff3 (diff)
downloadbibiman-57126d7f42b871aa1835b056fbe74179c13e53b0.tar.gz
bibiman-57126d7f42b871aa1835b056fbe74179c13e53b0.zip
Merge branch 'add-entry-via-doi'
+ implement the functionality to add an entry via DOI + responsive error messages if resolving of DOI don't work + keep changes to choosen file to minimum
Diffstat (limited to 'src/tui/commands.rs')
-rw-r--r--src/tui/commands.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tui/commands.rs b/src/tui/commands.rs
index a3049ee..0e00f95 100644
--- a/src/tui/commands.rs
+++ b/src/tui/commands.rs
@@ -69,6 +69,8 @@ pub enum CmdAction {
Exit,
// Show keybindings
ShowHelp,
+ // Add new entry
+ AddEntry,
// Do nothing.
Nothing,
}
@@ -110,7 +112,6 @@ impl From<KeyEvent> for CmdAction {
Self::SelectPrevRow(5)
} else {
Self::Nothing
- // Self::Open(OpenRessource::WebLink)
}
}
// Scroll info/preview area
@@ -118,6 +119,8 @@ impl From<KeyEvent> for CmdAction {
KeyCode::PageUp => Self::ScrollInfoUp,
// Exit App
KeyCode::Char('q') => Self::Exit,
+ // Add new entry
+ KeyCode::Char('a') => Self::AddEntry,
KeyCode::Char('c') | KeyCode::Char('C') => {
if key_event.modifiers == KeyModifiers::CONTROL {
Self::Exit
@@ -129,15 +132,14 @@ impl From<KeyEvent> for CmdAction {
KeyCode::Tab => Self::ToggleArea,
KeyCode::BackTab => Self::ToggleArea,
// Enter search mode
- KeyCode::Char('/') => Self::Input(InputCmdAction::Enter),
+ KeyCode::Char('/') => Self::SearchList,
KeyCode::Char('f') => {
if key_event.modifiers == KeyModifiers::CONTROL {
- Self::Input(InputCmdAction::Enter)
+ Self::SearchList
} else {
Self::Nothing
}
}
- // KeyCode::Backspace => Self::Input(InputCommand::Resume(Event::Key(key_event))),
// Confirm selection
KeyCode::Enter => Self::Confirm,
// Reset lists/tables