aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/app.rs b/src/app.rs
index 23230ba..92d89ba 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -15,7 +15,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/////
-use crate::bibiman::{CurrentArea, FormerArea};
+use crate::bibiman::CurrentArea;
use crate::config::BibiConfig;
use color_eyre::eyre::{Context, Ok, Result};
// use super::Event;
@@ -142,13 +142,14 @@ impl App {
|| doi.starts_with("http://doi.org")
|| doi.starts_with("http://dx.doi.org")
{
- self.bibiman.handle_new_entry_submission(doi);
+ self.bibiman.handle_new_entry_submission(doi)?;
} else {
- self.bibiman.popup_area.popup_message(
- "No valid DOI pattern: ",
- doi,
- false,
- );
+ self.bibiman.open_popup(
+ PopupKind::MessageError,
+ Some("No valid DOI pattern: "),
+ Some(doi),
+ None,
+ )?;
}
}
_ => {}
@@ -317,7 +318,7 @@ impl App {
// self.bibiman.current_area = CurrentArea::PopupArea;
// self.bibiman.popup_area.popup_state.select(Some(0));
self.bibiman
- .open_popup(PopupKind::YankItem, None, None, Some(items));
+ .open_popup(PopupKind::YankItem, None, None, Some(items))?;
}
}
CmdAction::EditFile => {
@@ -355,14 +356,14 @@ impl App {
// self.bibiman.popup_area.popup_state.select(Some(0))
self.bibiman
- .open_popup(PopupKind::OpenRes, None, None, Some(items));
+ .open_popup(PopupKind::OpenRes, None, None, Some(items))?;
} else {
self.bibiman.open_popup(
PopupKind::MessageError,
Some("Selected entry has no connected ressources: "),
Some(&entry.citekey),
None,
- );
+ )?;
// self.bibiman.popup_area.popup_message(
// "Selected entry has no connected ressources: ",
// &entry.citekey,
@@ -378,7 +379,7 @@ impl App {
}
}
CmdAction::ShowHelp => {
- self.bibiman.open_popup(PopupKind::Help, None, None, None);
+ self.bibiman.open_popup(PopupKind::Help, None, None, None)?;
}
CmdAction::Exit => {
self.quit();