-
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0009d15
commit 6234283
Showing
16 changed files
with
402 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,47 @@ | ||
use strum::Display; | ||
use crate::app::app_states::AppState::*; | ||
|
||
#[derive(Copy, Clone, PartialEq, Default, Display)] | ||
pub enum AppState { | ||
#[default] | ||
#[strum(to_string = "Main menu")] | ||
Normal, | ||
|
||
#[strum(to_string = "Request menu")] | ||
SelectedRequest, | ||
|
||
#[strum(to_string = "Editing request URL")] | ||
EditingRequestUrl, | ||
|
||
#[strum(to_string = "Creating new request")] | ||
CreatingNewRequest, | ||
|
||
#[strum(to_string = "Editing request auth")] | ||
EditingRequestAuth, | ||
|
||
#[strum(to_string = "Editing request auth username")] | ||
EditingRequestAuthUsername, | ||
|
||
#[strum(to_string = "Editing request auth password")] | ||
EditingRequestAuthPassword, | ||
|
||
#[strum(to_string = "Editing request body")] | ||
EditingRequestBody | ||
} | ||
|
||
pub fn get_available_keys(app_state: AppState) -> String { | ||
match app_state { | ||
AppState::Normal => String::from("q ↑ ↓ ← → n d"), | ||
AppState::SelectedRequest => String::from("Esc Tab ^(U)rl ^(B)ody"), | ||
AppState::EditingRequestUrl => String::from("Esc Enter ← → copy paste"), | ||
AppState::CreatingNewRequest => String::from("Esc Enter ← → copy paste"), | ||
AppState::EditingRequestBody => String::from("Esc Enter Tab ^(s)ave ↑ ↓ ← → copy paste") | ||
Normal => String::from("q or ^c ↑ ↓ ← → n d"), | ||
|
||
SelectedRequest => String::from("Esc Tab ^(U)rl ^(B)ody"), | ||
CreatingNewRequest => String::from("Esc Enter ← → copy paste"), | ||
|
||
EditingRequestUrl => String::from("Esc Enter ← → copy paste"), | ||
|
||
EditingRequestAuth =>String::from("Esc Enter ↑ ↓"), | ||
EditingRequestAuthUsername => String::from("Esc Enter ← → copy paste"), | ||
EditingRequestAuthPassword => String::from("Esc Enter ← → copy paste"), | ||
|
||
EditingRequestBody => String::from("Esc Enter Tab ^(s)ave ↑ ↓ ← → copy paste"), | ||
} | ||
} |
Oops, something went wrong.