diff options
| author | lukeflo | 2024-10-07 16:15:49 +0200 |
|---|---|---|
| committer | lukeflo | 2024-10-12 22:41:38 +0200 |
| commit | c9e749f811b16f7ec352d2aa8773105af046fad8 (patch) | |
| tree | 812d5917d968226fb532aad5c6c2d2198d6a4c29 /src/frontend/entries.rs | |
| parent | ff539341267df56d99d379066396f63fd7991bd6 (diff) | |
| download | bibiman-c9e749f811b16f7ec352d2aa8773105af046fad8.tar.gz bibiman-c9e749f811b16f7ec352d2aa8773105af046fad8.zip | |
add func for entry items, UI enhancement
- add functions to get url/doi and filepath
- get values for entry info from structs not by calling funcs again
Diffstat (limited to 'src/frontend/entries.rs')
| -rw-r--r-- | src/frontend/entries.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/frontend/entries.rs b/src/frontend/entries.rs index c532bf0..8eadfa2 100644 --- a/src/frontend/entries.rs +++ b/src/frontend/entries.rs @@ -29,7 +29,14 @@ impl FromIterator<Vec<String>> for EntryTable { let entry_table_items = iter .into_iter() .sorted() - .map(|i| EntryTableItem::new(&i[0], &i[1], &i[2], &i[3], &i[4], &i[5])) + // 0: authors, 1: title, 2: date, 3: pubtype, 4: keywords, 5: citekey + // 6: abstract, 7: doi/url, 8: pdf filepath + // See backend/bib.rs BibiEntry impl + .map(|i| { + EntryTableItem::new( + &i[0], &i[1], &i[2], &i[3], &i[4], &i[5], &i[6], &i[7], &i[8], + ) + }) .collect(); let entry_table_state = TableState::default().with_selected(0); Self { @@ -55,6 +62,9 @@ pub struct EntryTableItem { pub pubtype: String, pub keywords: String, pub citekey: String, + pub abstract_text: String, + pub doi_url: String, + pub filepath: String, } impl EntryTableItem { @@ -65,6 +75,9 @@ impl EntryTableItem { pubtype: &str, keywords: &str, citekey: &str, + abstract_text: &str, + doi_url: &str, + filepath: &str, ) -> Self { Self { authors: authors.to_string(), @@ -73,6 +86,9 @@ impl EntryTableItem { pubtype: pubtype.to_string(), keywords: keywords.to_string(), citekey: citekey.to_string(), + abstract_text: abstract_text.to_string(), + doi_url: doi_url.to_string(), + filepath: filepath.to_string(), } } |
