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.
This commit is contained in:
2026-07-06 20:22:57 +03:00
parent ae113df83c
commit c2dfeea1e8
3 changed files with 38 additions and 0 deletions
@@ -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)
@@ -78,6 +78,11 @@ fn panel_menu() -> Vec<MenuItem> {
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),
]
}
@@ -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",