refactor: migrate from mod.rs to named module files

This commit is contained in:
Christian Visintin
2026-04-19 01:54:46 +05:30
parent bc14b049c0
commit 0d24662b3d
20 changed files with 0 additions and 0 deletions
@@ -0,0 +1,56 @@
//! ## Components
//!
//! file transfer activity components
use tui_realm_stdlib::Phantom;
use tuirealm::event::{Event, Key, KeyEvent, KeyModifiers};
use tuirealm::{Component, MockComponent, NoUserEvent};
use super::{Msg, TransferMsg, UiMsg};
// -- export
mod log;
mod misc;
mod popups;
mod selected_files;
mod terminal;
mod transfer;
pub use misc::FooterBar;
pub use popups::{
ATTR_FILES, ChmodPopup, CopyPopup, DeletePopup, DisconnectPopup, ErrorPopup, FatalPopup,
FileInfoPopup, FilterPopup, GotoPopup, KeybindingsPopup, MkdirPopup, NewfilePopup,
OpenWithPopup, ProgressBarFull, ProgressBarPartial, QuitPopup, RenamePopup, ReplacePopup,
SaveAsPopup, SortingPopup, StatusBarLocal, StatusBarRemote, SymlinkPopup,
SyncBrowsingMkdirPopup, WaitPopup, WalkdirWaitPopup, WatchedPathsList, WatcherPopup,
};
pub use transfer::{ExplorerFind, ExplorerFuzzy, ExplorerLocal, ExplorerRemote};
pub use self::log::Log;
pub use self::selected_files::SelectedFilesList;
pub use self::terminal::Terminal;
#[derive(Default, MockComponent)]
pub struct GlobalListener {
component: Phantom,
}
impl Component<Msg, NoUserEvent> for GlobalListener {
fn on(&mut self, ev: Event<NoUserEvent>) -> Option<Msg> {
match ev {
Event::Keyboard(KeyEvent { code: Key::Esc, .. }) => {
Some(Msg::Ui(UiMsg::ShowDisconnectPopup))
}
Event::Keyboard(KeyEvent {
code: Key::Char('q') | Key::Function(10),
modifiers: KeyModifiers::NONE,
}) => Some(Msg::Ui(UiMsg::ShowQuitPopup)),
Event::Keyboard(KeyEvent {
code: Key::Char('h') | Key::Function(1),
modifiers: KeyModifiers::NONE,
}) => Some(Msg::Ui(UiMsg::ShowKeybindingsPopup)),
Event::WindowResize(_, _) => Some(Msg::Ui(UiMsg::WindowResized)),
_ => None,
}
}
}