|
|
@ -63,10 +63,7 @@ impl Page { |
|
|
|
SimpleAction::new(&uuid_string_random(), Some(&String::static_variant_type())); |
|
|
|
SimpleAction::new(&uuid_string_random(), Some(&String::static_variant_type())); |
|
|
|
|
|
|
|
|
|
|
|
// Init components
|
|
|
|
// Init components
|
|
|
|
let content = Arc::new(Content::new( |
|
|
|
let content = Content::new_arc(action_tab_open.clone(), action_page_open.clone()); |
|
|
|
action_tab_open.clone(), |
|
|
|
|
|
|
|
action_page_open.clone(), |
|
|
|
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let navigation = Navigation::new_arc( |
|
|
|
let navigation = Navigation::new_arc( |
|
|
|
action_tab_page_navigation_base.clone(), |
|
|
|
action_tab_page_navigation_base.clone(), |
|
|
@ -189,11 +186,10 @@ impl Page { |
|
|
|
let description = gformat!("Protocol `{scheme}` not supported"); |
|
|
|
let description = gformat!("Protocol `{scheme}` not supported"); |
|
|
|
|
|
|
|
|
|
|
|
// Update widget
|
|
|
|
// Update widget
|
|
|
|
self.content.to_status_failure( |
|
|
|
self.content |
|
|
|
Some(title.as_str()), |
|
|
|
.to_status_failure() |
|
|
|
Some(description.as_str()), |
|
|
|
.set_title(title.as_str()) |
|
|
|
None, |
|
|
|
.set_description(Some(description.as_str())); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update meta
|
|
|
|
// Update meta
|
|
|
|
self.meta.replace(Meta { |
|
|
|
self.meta.replace(Meta { |
|
|
@ -524,11 +520,10 @@ impl Page { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Update widget
|
|
|
|
// Update widget
|
|
|
|
content.to_status_failure( |
|
|
|
content |
|
|
|
Some(title.as_str()), |
|
|
|
.to_status_failure() |
|
|
|
Some(description.as_str()), |
|
|
|
.set_title(title.as_str()) |
|
|
|
None |
|
|
|
.set_description(Some(description.as_str())); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update meta
|
|
|
|
// Update meta
|
|
|
|
meta.replace(Meta { |
|
|
|
meta.replace(Meta { |
|
|
@ -551,8 +546,6 @@ impl Page { |
|
|
|
=> { |
|
|
|
=> { |
|
|
|
// Final image size unknown, show loading widget
|
|
|
|
// Final image size unknown, show loading widget
|
|
|
|
let status = content.to_status_loading( |
|
|
|
let status = content.to_status_loading( |
|
|
|
Some(&"Loading.."), |
|
|
|
|
|
|
|
None, |
|
|
|
|
|
|
|
Some(Duration::from_secs(1)) // show if download time > 1 second
|
|
|
|
Some(Duration::from_secs(1)) // show if download time > 1 second
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -594,11 +587,10 @@ impl Page { |
|
|
|
let title = gformat!("Oops"); |
|
|
|
let title = gformat!("Oops"); |
|
|
|
|
|
|
|
|
|
|
|
// Update widget
|
|
|
|
// Update widget
|
|
|
|
content.to_status_failure( |
|
|
|
content |
|
|
|
Some(title.as_str()), |
|
|
|
.to_status_failure() |
|
|
|
Some(reason.message()), |
|
|
|
.set_title(title.as_str()) |
|
|
|
None |
|
|
|
.set_description(Some(reason.message())); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update meta
|
|
|
|
// Update meta
|
|
|
|
meta.replace(Meta { |
|
|
|
meta.replace(Meta { |
|
|
@ -623,17 +615,15 @@ impl Page { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Update widget
|
|
|
|
// Update widget
|
|
|
|
content.to_status_failure( |
|
|
|
content |
|
|
|
Some(title.as_str()), |
|
|
|
.to_status_failure() |
|
|
|
Some(description.as_str()), |
|
|
|
.set_title(title.as_str()) |
|
|
|
None |
|
|
|
.set_description(Some(description.as_str())); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update meta
|
|
|
|
// Update meta
|
|
|
|
meta.replace(Meta { |
|
|
|
meta.replace(Meta { |
|
|
|
status: Some(status), |
|
|
|
status: Some(status), |
|
|
|
title: Some(title), |
|
|
|
title: Some(title), |
|
|
|
//description: Some(description),
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -660,11 +650,10 @@ impl Page { |
|
|
|
let description = gformat!("Content type not supported"); |
|
|
|
let description = gformat!("Content type not supported"); |
|
|
|
|
|
|
|
|
|
|
|
// Update widget
|
|
|
|
// Update widget
|
|
|
|
content.to_status_failure( |
|
|
|
content |
|
|
|
Some(title.as_str()), |
|
|
|
.to_status_failure() |
|
|
|
Some(description.as_str()), |
|
|
|
.set_title(title.as_str()) |
|
|
|
None |
|
|
|
.set_description(Some(description.as_str())); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update meta
|
|
|
|
// Update meta
|
|
|
|
meta.replace(Meta { |
|
|
|
meta.replace(Meta { |
|
|
@ -696,11 +685,9 @@ impl Page { |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
None => { |
|
|
|
None => { |
|
|
|
content.to_status_failure( |
|
|
|
content |
|
|
|
Some(&"Oops"), |
|
|
|
.to_status_failure() |
|
|
|
Some(&"Could not parse redirect meta"), |
|
|
|
.set_description(Some("Could not parse redirect meta")); |
|
|
|
None |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -760,11 +747,10 @@ impl Page { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Update widget
|
|
|
|
// Update widget
|
|
|
|
content.to_status_failure( |
|
|
|
content |
|
|
|
Some(title.as_str()), |
|
|
|
.to_status_failure() |
|
|
|
Some(description.as_str()), |
|
|
|
.set_title(title.as_str()) |
|
|
|
None |
|
|
|
.set_description(Some(description.as_str())); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update meta
|
|
|
|
// Update meta
|
|
|
|
meta.replace(Meta { |
|
|
|
meta.replace(Meta { |
|
|
@ -785,11 +771,10 @@ impl Page { |
|
|
|
let title = gformat!("Oops"); |
|
|
|
let title = gformat!("Oops"); |
|
|
|
|
|
|
|
|
|
|
|
// Update widget
|
|
|
|
// Update widget
|
|
|
|
content.to_status_failure( |
|
|
|
content |
|
|
|
Some(title.as_str()), |
|
|
|
.to_status_failure() |
|
|
|
Some(reason.message()), |
|
|
|
.set_title(title.as_str()) |
|
|
|
None |
|
|
|
.set_description(Some(reason.message())); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update meta
|
|
|
|
// Update meta
|
|
|
|
meta.replace(Meta { |
|
|
|
meta.replace(Meta { |
|
|
@ -809,11 +794,10 @@ impl Page { |
|
|
|
let title = gformat!("Oops"); |
|
|
|
let title = gformat!("Oops"); |
|
|
|
|
|
|
|
|
|
|
|
// Update widget
|
|
|
|
// Update widget
|
|
|
|
content.to_status_failure( |
|
|
|
content |
|
|
|
Some(title.as_str()), |
|
|
|
.to_status_failure() |
|
|
|
Some(reason.message()), |
|
|
|
.set_title(title.as_str()) |
|
|
|
None |
|
|
|
.set_description(Some(reason.message())); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update meta
|
|
|
|
// Update meta
|
|
|
|
meta.replace(Meta { |
|
|
|
meta.replace(Meta { |
|
|
|