Added options to explorer, in order to define sorting modes and other options. Added bitflags to dependencies; Moved Explorer to Fs module

This commit is contained in:
ChristianVisintin
2020-12-26 17:29:12 +01:00
parent 4911cc5410
commit 14125f673a
11 changed files with 353 additions and 64 deletions

View File

@@ -24,6 +24,7 @@ use super::{
Color, ConfigClient, FileTransferActivity, InputField, InputMode, LogLevel, LogRecord,
PopupType,
};
use crate::fs::explorer::{builder::FileExplorerBuilder, FileExplorer};
use crate::system::environment;
use crate::system::sshkey_storage::SshKeyStorage;
// Ext
@@ -125,6 +126,17 @@ impl FileTransferActivity {
}
}
/// ### build_explorer
///
/// Build explorer reading configuration from `ConfigClient`
pub(super) fn build_explorer(cli: Option<&ConfigClient>) -> FileExplorer {
FileExplorerBuilder::new()
.sort_by_name()
.with_dirs_first()
.with_stack_size(16)
.build()
}
/// ### setup_text_editor
///
/// Set text editor to use