restore cli capabilites
This commit is contained in:
parent
46987e11ad
commit
5f7ab37935
38
src/main.rs
38
src/main.rs
@ -27,10 +27,18 @@ fn main() -> iced::Result {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(second_query) = arg.get(2) {
|
if let Some(second_query) = arg.get(2) {
|
||||||
// if let Some(f) = bible::get( query, second_query, vec![format!("{BIBLE_DIRECTORY}/EnglishNASBBible.xml").into()],
|
if let Ok(contents) = fs::read_to_string(&format!("{BIBLE_DIRECTORY}/EnglishNASBBible.xml")) {
|
||||||
// ) {
|
if let Ok(bible) = quick_xml::de::from_str::<bible::Bible>(&contents) {
|
||||||
// println!("{}", f);
|
if let Some(f) = bible::get(
|
||||||
// }
|
query,
|
||||||
|
second_query,
|
||||||
|
vec![&bible],
|
||||||
|
) {
|
||||||
|
println!("{}", f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -208,15 +216,15 @@ impl State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn view(&self) -> Element<Message> {
|
fn view(&self) -> Element<Message> {
|
||||||
scrollable(row![
|
scrollable(
|
||||||
|
row![
|
||||||
row((0..self.cols).map(|col_index| {
|
row((0..self.cols).map(|col_index| {
|
||||||
column![
|
column![
|
||||||
// header
|
// header
|
||||||
button("Delete Column")
|
button("Delete Column")
|
||||||
.on_press_with(move || Message::DeleteColumn(col_index))
|
.on_press_with(move || Message::DeleteColumn(col_index))
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.style(button::danger)
|
.style(button::danger),
|
||||||
,
|
|
||||||
combo_box(
|
combo_box(
|
||||||
&self.files,
|
&self.files,
|
||||||
"Select Bible",
|
"Select Bible",
|
||||||
@ -235,12 +243,10 @@ impl State {
|
|||||||
row![
|
row![
|
||||||
button("Clear All")
|
button("Clear All")
|
||||||
.on_press_with(move || Message::Clear(col_index))
|
.on_press_with(move || Message::Clear(col_index))
|
||||||
.style(button::secondary)
|
.style(button::secondary),
|
||||||
,
|
|
||||||
button("Copy Scripture")
|
button("Copy Scripture")
|
||||||
.on_press_with(move || Message::CopyText(col_index))
|
.on_press_with(move || Message::CopyText(col_index))
|
||||||
.style(button::primary)
|
.style(button::primary),
|
||||||
,
|
|
||||||
]
|
]
|
||||||
.spacing(5),
|
.spacing(5),
|
||||||
row![
|
row![
|
||||||
@ -263,7 +269,8 @@ impl State {
|
|||||||
)
|
)
|
||||||
.spacing(5),
|
.spacing(5),
|
||||||
// Body
|
// Body
|
||||||
scrollable(if let Some(body) = &self.states[col_index].scripture_body {
|
scrollable(
|
||||||
|
if let Some(body) = &self.states[col_index].scripture_body {
|
||||||
column(body.split("\n").enumerate().map(|(i, msg)| {
|
column(body.split("\n").enumerate().map(|(i, msg)| {
|
||||||
let msg = parse(msg);
|
let msg = parse(msg);
|
||||||
if i & 1 == 0 {
|
if i & 1 == 0 {
|
||||||
@ -278,7 +285,8 @@ impl State {
|
|||||||
.iter()
|
.iter()
|
||||||
.map(|_| text(String::new()).into()),
|
.map(|_| text(String::new()).into()),
|
||||||
)
|
)
|
||||||
})
|
}
|
||||||
|
)
|
||||||
.spacing(5)
|
.spacing(5)
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
@ -292,9 +300,9 @@ impl State {
|
|||||||
.on_press(Message::AddColRight)
|
.on_press(Message::AddColRight)
|
||||||
]
|
]
|
||||||
// 5 pixles css-like padding
|
// 5 pixles css-like padding
|
||||||
.padding([5,5])
|
.padding([5, 5])
|
||||||
// space elements inside this 5 pixels apart
|
// space elements inside this 5 pixels apart
|
||||||
.spacing(5)
|
.spacing(5),
|
||||||
)
|
)
|
||||||
.direction(Direction::Horizontal(Scrollbar::new()))
|
.direction(Direction::Horizontal(Scrollbar::new()))
|
||||||
.into()
|
.into()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user