Skip to content

Commit

Permalink
move keybinding handling to intuitils
Browse files Browse the repository at this point in the history
  • Loading branch information
micielski committed Sep 19, 2024
1 parent 07d4a2d commit 42c0f5e
Show file tree
Hide file tree
Showing 16 changed files with 207 additions and 554 deletions.
189 changes: 100 additions & 89 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ license = "GPL-3.0-or-later"
rm-config = { version = "0.5", path = "rm-config" }
rm-shared = { version = "0.5", path = "rm-shared" }

intuitils = "0.0.2"

magnetease = "0.3"
anyhow = "1"
serde = { version = "1", features = ["derive"] }
Expand Down
1 change: 1 addition & 0 deletions rm-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ crossterm.workspace = true
thiserror.workspace = true
transmission-rpc.workspace = true
magnetease.workspace = true
intuitils.workspace = true
5 changes: 2 additions & 3 deletions rm-config/src/keymap/actions/general.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use intuitils::user_action::UserAction;
use rm_shared::action::Action;
use serde::{Deserialize, Serialize};

use super::UserAction;

#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum GeneralAction {
ShowHelp,
Quit,
Expand Down
10 changes: 0 additions & 10 deletions rm-config/src/keymap/actions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
use rm_shared::action::Action;

pub mod general;
pub mod search_tab;
pub mod torrents_tab;

pub trait UserAction: Into<Action> {
fn desc(&self) -> &'static str;
fn merge_desc_with(&self, other: &Self) -> Option<&'static str> {
let _ = other;
None
}
}
5 changes: 2 additions & 3 deletions rm-config/src/keymap/actions/search_tab.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use intuitils::user_action::UserAction;
use rm_shared::action::Action;
use serde::{Deserialize, Serialize};

use super::UserAction;

#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum SearchAction {
ShowProvidersInfo,
}
Expand Down
5 changes: 2 additions & 3 deletions rm-config/src/keymap/actions/torrents_tab.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use intuitils::user_action::UserAction;
use rm_shared::action::Action;
use serde::{Deserialize, Serialize};

use super::UserAction;

#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum TorrentsAction {
AddMagnet,
MoveTorrent,
Expand Down
Loading

0 comments on commit 42c0f5e

Please sign in to comment.