/// Funtion to update status bar content and preview widget content on selection change.
/// First the status bar is updated to show relevant permission details and size of file.
/// Then preview is updated to reflect details about the selected entry.
Funtion to update status bar content and preview widget content on selection change.
First the status bar is updated to show relevant permission details and size of file.
Then preview is updated to reflect details about the selected entry.
Funtion to update status bar content and preview widget content on selection change . First the status bar is updated to show relevant permission details and size of file . Then preview is updated to reflect details about the selected entry .
fn update_info(siv: &mut Cursive, entry: &PathBuf) {
    siv.call_on_id("preview", |view: &mut TextView| {
        if !entry.is_dir() {
            let data: Mime = guess_mime_type(entry);
            view.set_content(format!("{}/{}", data.type_(), data.subtype()))
        } else {
            view.set_content("This is a directory!".to_string())
        }
    });
    siv.call_on_id("status", |view: &mut TextView| {
        view.set_content(
            Entry::from(PathBuf::from(entry))
                .permission_string()
                .unwrap(),
        );
    });
}
fn update_info ( siv : & mut Cursive , entry : & PathBuf ) { siv . call_on_id ( " " , | view : & mut TextView | { if ! entry . is_dir ( ) { let data : Mime = guess_mime_type ( entry ) ; view . set_content ( format ! ( " " data type_ ( ) data subtype ( ) ) ) } else { view . set_content ( " " . to_string ( ) ) } } ) ; siv . call_on_id ( " " , | view : & mut TextView | { view . set_content ( Entry :: from ( PathBuf :: from ( entry ) ) . permission_string ( ) . unwrap ( ) , ) ; } ) ; }
Funtion to update status bar content and preview widget content on selection change.
Funtion to update status bar content and preview widget content on selection change .
siv
&mut Cursive
entry
&PathBuf