fn wle_tui(s: &mut Cursive) {
    // Removes the previous layer
    s.pop_layer();
    // get the settings dir
    let set_path = settings::settings_dir();
    // read the items from the database
    let items = settings::read_watch_list(&set_path).expect("Failed to unpack vectors");

    // Set-up the Watch-list Editor TableView
    let mut table = TableView::<Watchlist, WatchColumn>::new()
        .column(WatchColumn::Title, "Item Name", |c| c.width(60))
        .column(WatchColumn::Option, "Option", |c| c.width(10))
        .default_column(WatchColumn::Title);

    // Inserts the items into the table
    table.set_items(items);

    // Buttons at the left side of the TUI
    // Comprised of the Add and Delete Buttons
    let buttons_left = LinearLayout::horizontal()
        .child(Button::new("Add", add_item))
        .child(DummyView)
        .child(Button::new("Delete", delete_item));
    // Buttons at the right side of the TUI
    // Comprised of Navigation Buttons (Back and Quit)
    let buttons_right = LinearLayout::horizontal()
        .child(Button::new("Back", |s| main_tui_layer(s)))
        .child(DummyView)
        .child(Button::new("Quit", Cursive::quit));

    // Sets up the buttons into a horizontal layer
    let button_layer = LinearLayout::horizontal()
        .child(PaddedView::lrtb(0, 47, 0, 0, buttons_left))
        .child(buttons_right);
    // Adds the views to create the WLE
    s.add_layer(
        Dialog::around(
            LinearLayout::vertical()
                .child(table.with_name("watch-list").min_size((70, 18)))
                .child(button_layer),
        )
        .title("Watch-list Editor"),
    );
}
/// The Watch-list Editor TUI

The Watch-list Editor TUI
The Watch - list Editor TUI
fn wle_tui(s: &mut Cursive) {
    // Removes the previous layer
    s.pop_layer();
    // get the settings dir
    let set_path = settings::settings_dir();
    // read the items from the database
    let items = settings::read_watch_list(&set_path).expect("Failed to unpack vectors");
    // Set-up the Watch-list Editor TableView
    let mut table = TableView::<Watchlist, WatchColumn>::new()
        .column(WatchColumn::Title, "Item Name", |c| c.width(60))
        .column(WatchColumn::Option, "Option", |c| c.width(10))
        .default_column(WatchColumn::Title);
    // Inserts the items into the table
    table.set_items(items);
    // Buttons at the left side of the TUI
    // Comprised of the Add and Delete Buttons
    let buttons_left = LinearLayout::horizontal()
        .child(Button::new("Add", add_item))
        .child(DummyView)
        .child(Button::new("Delete", delete_item));
    // Buttons at the right side of the TUI
    // Comprised of Navigation Buttons (Back and Quit)
    let buttons_right = LinearLayout::horizontal()
        .child(Button::new("Back", |s| main_tui_layer(s)))
        .child(DummyView)
        .child(Button::new("Quit", Cursive::quit));
    // Sets up the buttons into a horizontal layer
    let button_layer = LinearLayout::horizontal()
        .child(PaddedView::lrtb(0, 47, 0, 0, buttons_left))
        .child(buttons_right);
    // Adds the views to create the WLE
    s.add_layer(
        Dialog::around(
            LinearLayout::vertical()
                .child(table.with_name("watch-list").min_size((70, 18)))
                .child(button_layer),
        )
        .title("Watch-list Editor"),
    );
}
fn wle_tui ( s : & mut Cursive ) { // Removes the previous layer
 s . pop_layer ( ) ; // get the settings dir
 let set_path = settings :: settings_dir ( ) ; // read the items from the database
 let items = settings :: read_watch_list ( & set_path ) . expect ( " " ) ; // Set-up the Watch-list Editor TableView
 let mut table = TableView :: < Watchlist , WatchColumn > :: new ( ) . column ( WatchColumn :: Title , " " , | c | c . width ( 60 ) ) . column ( WatchColumn :: Option , " " , | c | c . width ( 10 ) ) . default_column ( WatchColumn :: Title ) ; // Inserts the items into the table
 table . set_items ( items ) ; // Buttons at the left side of the TUI
 // Comprised of the Add and Delete Buttons
 let buttons_left = LinearLayout :: horizontal ( ) . child ( Button :: new ( " " , add_item ) ) . child ( DummyView ) . child ( Button :: new ( " " , delete_item ) ) ; // Buttons at the right side of the TUI
 // Comprised of Navigation Buttons (Back and Quit)
 let buttons_right = LinearLayout :: horizontal ( ) . child ( Button :: new ( " " , | s | main_tui_layer ( s ) ) ) . child ( DummyView ) . child ( Button :: new ( " " , Cursive :: quit ) ) ; // Sets up the buttons into a horizontal layer
 let button_layer = LinearLayout :: horizontal ( ) . child ( PaddedView :: lrtb ( 0 , 47 , 0 , 0 , buttons_left ) ) . child ( buttons_right ) ; // Adds the views to create the WLE
 s . add_layer ( Dialog :: around ( LinearLayout :: vertical ( ) . child ( table . with_name ( " " ) . min_size ( ( 70 , 18 ) ) ) . child ( button_layer ) , ) . title ( " " ) , ) ; }
The Watch-list Editor TUI
The Watch - list Editor TUI
s
&mut Cursive
s
&mut Cursive