mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
update gemtext error handler
This commit is contained in:
parent
c8607e151a
commit
33943d37f1
9 changed files with 64 additions and 108 deletions
|
|
@ -118,9 +118,30 @@ impl Content {
|
|||
/// `text/gemini`
|
||||
pub fn to_text_gemini(&self, base: &Uri, data: &str) -> Text {
|
||||
self.clean();
|
||||
let text = Text::gemini((&self.window_action, &self.item_action), base, data);
|
||||
self.g_box.append(&text.scrolled_window);
|
||||
text
|
||||
match Text::gemini((&self.window_action, &self.item_action), base, data) {
|
||||
Ok(text) => {
|
||||
self.g_box.append(&text.scrolled_window);
|
||||
text
|
||||
}
|
||||
Err((message, text)) => {
|
||||
self.g_box.append(&{
|
||||
let banner = adw::Banner::builder()
|
||||
.title(message)
|
||||
.revealed(true)
|
||||
.button_label("Ok")
|
||||
.build();
|
||||
banner.connect_button_clicked(|this| this.set_revealed(false));
|
||||
banner
|
||||
});
|
||||
match text {
|
||||
Some(text) => {
|
||||
self.g_box.append(&text.scrolled_window);
|
||||
text
|
||||
}
|
||||
None => todo!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// `text/plain`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue