From c2dfeea1e8e34796216498927e49fee2522f09c4 Mon Sep 17 00:00:00 2001 From: vasilito Date: Mon, 6 Jul 2026 20:22:57 +0300 Subject: [PATCH] W27: VFS link submenu in Panel menu (FTP/Shell/SFTP) The F9 audit found that the Panel menu (Left/Right) was missing the MC-style VFS link entries (FTP link..., Shell link..., SFTP link...). The ConnectionDialog already supported all three kinds but the user could only reach them via the catch-all Cmd::Connection which defaulted to FTP. Add three new Cmd variants (ConnectFtp, ConnectShell, ConnectSftp) that each open the ConnectionDialog pre-set to the matching ConnectionKind. Wire them into the Panel menu (Left/Right) between 'External panelize' and 'Reload', separated by a separator so the group reads as a VFS submenu. Tests: 1393 pass, zero warnings. --- .../tlc/source/src/filemanager/dispatch.rs | 24 +++++++++++++++++++ .../tui/tlc/source/src/filemanager/menubar.rs | 5 ++++ .../recipes/tui/tlc/source/src/keymap/mod.rs | 9 +++++++ 3 files changed, 38 insertions(+) diff --git a/local/recipes/tui/tlc/source/src/filemanager/dispatch.rs b/local/recipes/tui/tlc/source/src/filemanager/dispatch.rs index 8ad49e6728..7ddc7d0e3a 100644 --- a/local/recipes/tui/tlc/source/src/filemanager/dispatch.rs +++ b/local/recipes/tui/tlc/source/src/filemanager/dispatch.rs @@ -593,6 +593,30 @@ impl FileManager { ))); Ok(true) } + Cmd::ConnectFtp => { + self.dialog = Some(DialogState::Connection(Box::new( + connection_dialog::ConnectionDialog::new( + connection_dialog::ConnectionKind::Ftp, + ), + ))); + Ok(true) + } + Cmd::ConnectShell => { + self.dialog = Some(DialogState::Connection(Box::new( + connection_dialog::ConnectionDialog::new( + connection_dialog::ConnectionKind::Shell, + ), + ))); + Ok(true) + } + Cmd::ConnectSftp => { + self.dialog = Some(DialogState::Connection(Box::new( + connection_dialog::ConnectionDialog::new( + connection_dialog::ConnectionKind::Sftp, + ), + ))); + Ok(true) + } Cmd::EditExtensionFile => { self.open_config_file("extensions"); Ok(true) diff --git a/local/recipes/tui/tlc/source/src/filemanager/menubar.rs b/local/recipes/tui/tlc/source/src/filemanager/menubar.rs index 9b673f05a6..cbe189c4ed 100644 --- a/local/recipes/tui/tlc/source/src/filemanager/menubar.rs +++ b/local/recipes/tui/tlc/source/src/filemanager/menubar.rs @@ -78,6 +78,11 @@ fn panel_menu() -> Vec { MenuItem::item("Quick cd", Cmd::QuickCd), MenuItem::separator(), MenuItem::item("External panelize", Cmd::Panelize), + MenuItem::separator(), + MenuItem::item("FTP link...", Cmd::ConnectFtp), + MenuItem::item("Shell link...", Cmd::ConnectShell), + MenuItem::item("SFTP link...", Cmd::ConnectSftp), + MenuItem::separator(), MenuItem::item("Reload", Cmd::Reload), ] } diff --git a/local/recipes/tui/tlc/source/src/keymap/mod.rs b/local/recipes/tui/tlc/source/src/keymap/mod.rs index e6486eb11d..db61edcde5 100644 --- a/local/recipes/tui/tlc/source/src/keymap/mod.rs +++ b/local/recipes/tui/tlc/source/src/keymap/mod.rs @@ -195,6 +195,12 @@ pub enum Cmd { Encoding, /// Alt-n — open a network connection (FTP/SFTP/Shell). Connection, + /// Left/Right panel menu — open an FTP link. + ConnectFtp, + /// Left/Right panel menu — open a shell link. + ConnectShell, + /// Left/Right panel menu — open an SFTP link. + ConnectSftp, /// Command menu — edit the extension mapping file. EditExtensionFile, /// Command menu — edit the user menu file. @@ -300,6 +306,9 @@ impl Cmd { Cmd::PanelFilter => "Panel filter", Cmd::Encoding => "Display encoding", Cmd::Connection => "Network connection", + Cmd::ConnectFtp => "FTP link", + Cmd::ConnectShell => "Shell link", + Cmd::ConnectSftp => "SFTP link", Cmd::EditExtensionFile => "Edit extension file", Cmd::EditMenuFile => "Edit menu file", Cmd::EditHighlightFile => "Edit highlighting file",