pub struct Status {Show 19 fields
pub tabs: [Tab; 2],
pub index: usize,
pub flagged: Flagged,
pub marks: Marks,
pub dual_pane: bool,
pub system_info: System,
pub display_full: bool,
pub preview_second: bool,
pub opener: Opener,
pub help: String,
pub trash: Trash,
pub encrypted_devices: CryptoDeviceOpener,
pub iso_mounter: Option<IsoMounter>,
pub compression: Compresser,
pub nvim_server: String,
pub force_clear: bool,
pub bulk: Bulk,
pub shell_menu: ShellMenu,
pub cli_info: CliInfo,
/* private fields */
}Expand description
Holds every mutable parameter of the application itself, except for
the “display” information.
It holds 2 tabs (left & right), even if only one can be displayed sometimes.
It knows which tab is selected, which files are flagged,
which jump target is selected, a cache of normal file colors,
if we have to display one or two tabs and if all details are shown or only
the filename.
Mutation of this struct are mostly done externally, by the event crate :
crate::event_exec.
Fields§
§tabs: [Tab; 2]Vector of Tab, each of them are displayed in a separate tab.
index: usizeIndex of the current selected tab
flagged: FlaggedThe flagged files
marks: MarksMarks allows you to jump to a save mark
dual_pane: booldo we display one or two tabs ?
system_info: System§display_full: booldo we display all info or only the filenames ?
preview_second: booluse the second pane to preview auto
opener: OpenerThe opener used by the application.
help: StringThe help string.
trash: TrashThe trash
encrypted_devices: CryptoDeviceOpenerEncrypted devices opener
iso_mounter: Option<IsoMounter>Iso mounter. Set to None by default, dropped ASAP
compression: CompresserCompression methods
nvim_server: StringNVIM RPC server address
force_clear: bool§bulk: Bulk§cli_info: CliInfoImplementations§
source§impl Status
impl Status
sourcepub const MAX_PERMISSIONS: u32 = 511u32
pub const MAX_PERMISSIONS: u32 = 511u32
Max valid permission number, ie 0o777.
sourcepub fn new(
args: Args,
height: usize,
term: Arc<Term>,
help: String,
opener: Opener
) -> Result<Self>
pub fn new( args: Args, height: usize, term: Arc<Term>, help: String, opener: Opener ) -> Result<Self>
Creates a new status for the application. It requires most of the information (arguments, configuration, height of the terminal, the formated help string).
sourcepub fn selected_non_mut(&self) -> &Tab
pub fn selected_non_mut(&self) -> &Tab
Returns a non mutable reference to the selected tab.
sourcepub fn reset_tabs_view(&mut self) -> Result<()>
pub fn reset_tabs_view(&mut self) -> Result<()>
Reset the view of every tab.
sourcepub fn toggle_flag_on_path(&mut self, path: &Path)
pub fn toggle_flag_on_path(&mut self, path: &Path)
Toggle the flagged attribute of a path.
sourcepub fn skim_output_to_tab(&mut self) -> Result<()>
pub fn skim_output_to_tab(&mut self) -> Result<()>
Replace the tab content with the first result of skim. It calls skim, reads its output, then update the tab content.
sourcepub fn skim_line_output_to_tab(&mut self) -> Result<()>
pub fn skim_line_output_to_tab(&mut self) -> Result<()>
Replace the tab content with the first result of skim.
It calls skim, reads its output, then update the tab content.
The output is splited at : since we only care about the path, not the line number.
sourcepub fn skim_find_keybinding(&mut self) -> Result<()>
pub fn skim_find_keybinding(&mut self) -> Result<()>
Run a command directly from help. Search a command in skim, if it’s a keybinding, run it directly. If the result can’t be parsed, nothing is done.
sourcepub fn filtered_flagged_files(&self) -> Vec<&Path>
pub fn filtered_flagged_files(&self) -> Vec<&Path>
Returns a vector of path of files which are both flagged and in current directory. It’s necessary since the user may have flagged files OUTSIDE of current directory before calling Bulkrename. It may be confusing since the same filename can be used in different places.
sourcepub fn cut_or_copy_flagged_files(&mut self, cut_or_copy: CopyMove) -> Result<()>
pub fn cut_or_copy_flagged_files(&mut self, cut_or_copy: CopyMove) -> Result<()>
Execute a move or a copy of the flagged files to current directory. A progress bar is displayed (invisible for small files) and a notification is sent every time, even for 0 bytes files…
sourcepub fn clear_flags_and_reset_view(&mut self) -> Result<()>
pub fn clear_flags_and_reset_view(&mut self) -> Result<()>
Empty the flagged files, reset the view of every tab.
sourcepub fn set_permissions<P>(path: P, permissions: u32) -> Result<()>where
P: AsRef<Path>,
pub fn set_permissions<P>(path: P, permissions: u32) -> Result<()>where P: AsRef<Path>,
Set the permissions of the flagged files according to a given permission. If the permission are invalid or if the user can’t edit them, it may fail.
sourcepub fn select_from_regex(&mut self) -> Result<(), Error>
pub fn select_from_regex(&mut self) -> Result<(), Error>
Flag every file matching a typed regex.
sourcepub fn select_tab(&mut self, index: usize) -> Result<()>
pub fn select_tab(&mut self, index: usize) -> Result<()>
Select a tab according to its index. It’s deprecated and is left mostly because I’m not sure I want tabs & panes… and I haven’t fully decided yet. Since I’m lazy and don’t want to write it twice, it’s left here.
sourcepub fn refresh_disks(&mut self)
pub fn refresh_disks(&mut self)
Refresh every disk information. It also refreshes the disk list, which is usefull to detect removable medias. It may be very slow… There’s surelly a better way, like doing it only once in a while or on demand.
sourcepub fn disk_spaces_per_tab(&self) -> (String, String)
pub fn disk_spaces_per_tab(&self) -> (String, String)
Returns a pair of disk spaces for both tab.
sourcepub fn disks_mounts(disks: &[Disk]) -> Vec<&Path>
pub fn disks_mounts(disks: &[Disk]) -> Vec<&Path>
Returns the mount points of every disk.
sourcepub fn term_size(&self) -> Result<(usize, usize)>
pub fn term_size(&self) -> Result<(usize, usize)>
Returns the sice of the terminal (width, height)
sourcepub fn selected_path_str(&self) -> &str
pub fn selected_path_str(&self) -> &str
Returns a string representing the current path in the selected tab.
sourcepub fn refresh_users(&mut self) -> Result<()>
pub fn refresh_users(&mut self) -> Result<()>
Refresh the existing users.
sourcepub fn remove_tree(&mut self) -> Result<()>
pub fn remove_tree(&mut self) -> Result<()>
Drop the current tree, replace it with an empty one.
sourcepub fn read_encrypted_devices(&mut self) -> Result<()>
pub fn read_encrypted_devices(&mut self) -> Result<()>
Updates the encrypted devices
sourcepub fn force_preview(&mut self, colors: &Colors) -> Result<()>
pub fn force_preview(&mut self, colors: &Colors) -> Result<()>
Force a preview on the second pane
sourcepub fn set_dual_pane_if_wide_enough(&mut self, width: usize) -> Result<()>
pub fn set_dual_pane_if_wide_enough(&mut self, width: usize) -> Result<()>
Set dual pane if the term is big enough
sourcepub fn force_clear(&mut self)
pub fn force_clear(&mut self)
Set a “force clear” flag to true, which will reset the display. It’s used when some command or whatever may pollute the terminal. We ensure to clear it before displaying again.