Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.

- Added a flag to indicate whether the app is scanning the networks or not.
- Changed the type of list that was send to the scan_networks function from main App `struct` to be `RwLock` wrapped type rather than Arc wrapped type.
- Removed the redundent key press kind.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typo: "redundent" → "redundant".

🧰 Tools
🪛 LanguageTool

[grammar] ~21-~21: Ensure spelling is correct
Context: ...er than Arc wrapped type. - Removed the redundent key press kind. ### Changed - Changed...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 21, Fix the typo in the CHANGELOG entry: replace the
phrase "Removed the redundent key press kind." with "Removed the redundant key
press kind." so the word "redundent" is corrected to "redundant" in the
CHANGELOG.md entry.


### Changed

Expand Down
13 changes: 2 additions & 11 deletions src/apps/core/delete_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use super::App;
use crate::utils::delete_connection::delete_connection;
use crate::utils::scan::scan_networks;

use crossterm::event::KeyEventKind::Press;
use crossterm::event::{self, Event, KeyCode, KeyEvent, poll};
use std::io;
use std::time::Duration;
Expand Down Expand Up @@ -31,57 +30,49 @@ impl App {
match event::read()? {
Event::Key(KeyEvent {
code: KeyCode::Enter,
kind: Press,
..
}) => {
self.delete_connection();
}
Event::Key(KeyEvent {
code: KeyCode::Char('Y'),
kind: Press,
..
}) => {
self.delete_connection();
}
Event::Key(KeyEvent {
code: KeyCode::Char('y'),
kind: Press,
..
}) => {
self.delete_connection();
}
Event::Key(KeyEvent {
code: KeyCode::Char('N'),
kind: Press,
..
}) => {
self.flags.show_delete_confirmation = false;
}
Event::Key(KeyEvent {
code: KeyCode::Char('n'),
kind: Press,
..
}) => {
self.flags.show_delete_confirmation = false;
}
Event::Key(KeyEvent {
code: KeyCode::Char('c'),
kind: Press,

modifiers: event::KeyModifiers::CONTROL,
..
}) => {
self.exit();
}
Event::Key(KeyEvent {
code: KeyCode::Esc,
kind: Press,
..
code: KeyCode::Esc, ..
}) => {
self.flags.show_delete_confirmation = false;
}
Event::Key(KeyEvent {
code: KeyCode::Char('q'),
kind: Press,
..
}) => {
self.flags.show_delete_confirmation = false;
Expand Down
21 changes: 2 additions & 19 deletions src/apps/core/event_handlers.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use super::App;
use crate::utils::scan::scan_networks;

use crossterm::event::KeyEventKind::Press;
use crossterm::event::{self, Event, KeyCode, KeyEvent, KeyModifiers, poll};
use std::io;
use std::time::Duration;
Expand Down Expand Up @@ -31,88 +30,74 @@ impl App {
match event::read()? {
Event::Key(KeyEvent {
code: KeyCode::Char('h'),
kind: Press,
..
}) => {
self.flags.show_help = true;
}

Event::Key(KeyEvent {
code: KeyCode::Char('?'),
kind: Press,
..
}) => {
self.flags.show_help = true;
}
Event::Key(KeyEvent {
code: KeyCode::Esc,
kind: Press,
..
code: KeyCode::Esc, ..
}) => {
self.exit();
}
Event::Key(KeyEvent {
code: KeyCode::Char('c'),
modifiers: KeyModifiers::CONTROL,
kind: Press,
..
}) => {
self.exit();
}
Event::Key(KeyEvent {
code: KeyCode::Char('r'),
modifiers: KeyModifiers::CONTROL,
kind: Press,
..
}) => {
scan_networks(self.wifi_list.clone(), self.flags.is_scanning.clone());
}
Event::Key(KeyEvent {
code: KeyCode::Enter,
kind: Press,
..
}) => {
self.prepare_to_connect();
}
Event::Key(KeyEvent {
code: KeyCode::Char('o'),
kind: Press,
..
}) => {
self.prepare_to_connect();
}
Event::Key(KeyEvent {
code: KeyCode::Up,
kind: Press,
..
code: KeyCode::Up, ..
}) => {
self.update_selected_network(-1);
}
Event::Key(KeyEvent {
code: KeyCode::Down,
kind: Press,
..
}) => {
self.update_selected_network(1);
}
// vim style
Event::Key(KeyEvent {
code: KeyCode::Char('k'),
kind: Press,
..
}) => {
self.update_selected_network(-1);
}
Event::Key(KeyEvent {
code: KeyCode::Char('j'),
kind: Press,
..
}) => {
self.update_selected_network(1);
}
Event::Key(KeyEvent {
code: KeyCode::Char('d'),
kind: Press,
..
}) => {
if self
Expand All @@ -126,14 +111,12 @@ impl App {
}
Event::Key(KeyEvent {
code: KeyCode::Char('s'),
kind: Press,
..
}) => {
self.open_saved_list();
}
Event::Key(KeyEvent {
code: KeyCode::Char('x'),
kind: Press,
..
}) => {
self.disconnect();
Expand Down
5 changes: 1 addition & 4 deletions src/apps/core/help_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,25 @@ impl App {
match event::read()? {
Event::Key(KeyEvent {
code: event::KeyCode::Esc,
kind: event::KeyEventKind::Press,
..
}) => {
self.close_help();
}
Event::Key(KeyEvent {
code: event::KeyCode::Enter,
kind: event::KeyEventKind::Press,
..
}) => {
self.close_help();
}
Event::Key(KeyEvent {
code: event::KeyCode::Char('q'),
kind: event::KeyEventKind::Press,
..
}) => {
self.close_help();
}
Event::Key(KeyEvent {
code: event::KeyCode::Char('c'),
kind: event::KeyEventKind::Press,

modifiers: event::KeyModifiers::CONTROL,
..
}) => {
Expand Down
13 changes: 2 additions & 11 deletions src/apps/core/saved_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,29 +87,26 @@ impl App {
match event::read()? {
Event::Key(KeyEvent {
code: event::KeyCode::Char('q'),
kind: event::KeyEventKind::Press,
..
}) => {
self.close_saved_list();
}
Event::Key(KeyEvent {
code: event::KeyCode::Esc,
kind: event::KeyEventKind::Press,
..
}) => {
self.close_saved_list();
}
Event::Key(KeyEvent {
code: event::KeyCode::Char('c'),
kind: event::KeyEventKind::Press,

modifiers: event::KeyModifiers::CONTROL,
..
}) => {
self.exit();
}
Event::Key(KeyEvent {
code: event::KeyCode::Char('d'),
kind: event::KeyEventKind::Press,
..
}) => {
// this will evaluate to run the delete confirmation dialog from the core ui
Expand All @@ -118,49 +115,43 @@ impl App {

Event::Key(KeyEvent {
code: event::KeyCode::Char('j'),
kind: event::KeyEventKind::Press,
..
}) => {
self.update_selected_saved_network(1);
}
Event::Key(KeyEvent {
code: event::KeyCode::Down,
kind: event::KeyEventKind::Press,
..
}) => {
self.update_selected_saved_network(1);
}
Event::Key(KeyEvent {
code: event::KeyCode::Char('k'),
kind: event::KeyEventKind::Press,
..
}) => {
self.update_selected_saved_network(-1);
}
Event::Key(KeyEvent {
code: event::KeyCode::Up,
kind: event::KeyEventKind::Press,
..
}) => {
self.update_selected_saved_network(-1);
}
Event::Key(KeyEvent {
code: event::KeyCode::Char('h'),
kind: event::KeyEventKind::Press,
..
}) => {
self.flags.show_help = true;
}
Event::Key(KeyEvent {
code: event::KeyCode::Char('?'),
kind: event::KeyEventKind::Press,
..
}) => {
self.flags.show_help = true;
}
Event::Key(KeyEvent {
code: event::KeyCode::Char('r'),
kind: event::KeyEventKind::Press,

modifiers: event::KeyModifiers::CONTROL,
..
}) => {
Expand Down
11 changes: 2 additions & 9 deletions src/apps/handlers/password_handler.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::WifiInputState;
use super::utils::{delete_char, enter_char, move_cursor_right};
use crossterm::event::{self, Event, KeyCode, KeyEvent, KeyEventKind::Press, poll};
use crossterm::event::{self, Event, KeyCode, KeyEvent, poll};
use std::io;
use std::time::Duration;

Expand All @@ -10,22 +10,18 @@ impl WifiInputState {
match event::read()? {
Event::Key(KeyEvent {
code: KeyCode::Left,
kind: Press,
..
}) => {
self.move_cursor_left();
}
Event::Key(KeyEvent {
code: KeyCode::Right,
kind: Press,
..
}) => {
move_cursor_right(&self.password, &mut self.cursor_pos);
}
Event::Key(KeyEvent {
code: KeyCode::Esc,
kind: Press,
..
code: KeyCode::Esc, ..
}) => {
// if we go back from password input, we should show the ssid popup again
// with the cursor at the end of the ssid
Expand All @@ -37,23 +33,20 @@ impl WifiInputState {
}
Event::Key(KeyEvent {
code: KeyCode::Char(c),
kind: Press,
..
}) => {
enter_char(&mut self.password, c, &self.cursor_pos);
move_cursor_right(&self.password, &mut self.cursor_pos);
}
Event::Key(KeyEvent {
code: KeyCode::Backspace,
kind: Press,
..
}) => {
delete_char(&mut self.password, &mut self.cursor_pos);
self.move_cursor_left()
}
Event::Key(KeyEvent {
code: KeyCode::Enter,
kind: Press,
..
}) => {
if self.password.is_empty() || self.password.chars().count() >= 8 {
Expand Down
Loading
Loading