mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
format request, begin download feature implementation
This commit is contained in:
parent
88b3adaf2d
commit
09f2a17f22
6 changed files with 533 additions and 187 deletions
|
|
@ -9,9 +9,10 @@ use text::Text;
|
|||
use crate::app::browser::window::{tab::item::Action as TabAction, Action as WindowAction};
|
||||
use gtk::{
|
||||
gdk::Paintable,
|
||||
gio::{Cancellable, File},
|
||||
glib::Uri,
|
||||
prelude::{BoxExt, IsA, WidgetExt},
|
||||
Box, Orientation,
|
||||
Box, Label, Orientation,
|
||||
};
|
||||
use std::{rc::Rc, time::Duration};
|
||||
|
||||
|
|
@ -45,6 +46,21 @@ impl Content {
|
|||
image
|
||||
}
|
||||
|
||||
/// Set new `content::Status` component for `Self` with new `status::Download` preset
|
||||
///
|
||||
/// * action removes previous children component from `Self`
|
||||
pub fn to_status_download(
|
||||
&self,
|
||||
initial_filename: &str,
|
||||
cancellable: &Cancellable,
|
||||
on_choose: impl Fn(File, Label) + 'static,
|
||||
) -> Status {
|
||||
self.clean();
|
||||
let status = Status::new_download(initial_filename, cancellable, on_choose);
|
||||
self.gobject.append(status.gobject());
|
||||
status
|
||||
}
|
||||
|
||||
/// Set new `content::Status` component for `Self` with new `status::Failure` preset
|
||||
///
|
||||
/// * action removes previous children component from `Self`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue